Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Survey 3D #1293

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:text="@string/waypointType_BuildingMapper"
android:text="@string/waypointType_structureScanner"
android:textAllCaps="true" />

<TextView
Expand Down
2 changes: 1 addition & 1 deletion Android/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
<string name="waypointType_Loiter">悬停</string>
<string name="waypointType_ROI">兴趣区域</string>
<string name="waypointType_Survey">勘测多边形</string>
<string name="waypointType_BuildingMapper">结构扫描</string>
<string name="waypointType_structureScanner">结构扫描</string>

<!-- Waypoint info -->
<string name="waypointInfo_Land">在当前位置降落模型。你必须手动退出自动模式来锁定电机。</string>
Expand Down
2 changes: 1 addition & 1 deletion Android/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
<string name="waypointType_Loiter">Loiter</string>
<string name="waypointType_ROI">Region of Interest</string>
<string name="waypointType_Survey">Survey Polygon</string>
<string name="waypointType_BuildingMapper">Structure Scan</string>
<string name="waypointType_structureScanner">Structure Scan</string>

<!-- Waypoint info -->
<string name="waypointInfo_Land">Land vehicle at the current location. You must manually exit Auto mode to disarm motors.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.droidplanner.core.mission.commands.ReturnToHome;
import org.droidplanner.core.mission.commands.Takeoff;
import org.droidplanner.core.mission.survey.Survey;
import org.droidplanner.core.mission.survey.Survey2D;
import org.droidplanner.core.mission.survey.Survey3D;
import org.droidplanner.core.mission.waypoints.SpatialCoordItem;
import org.droidplanner.core.mission.waypoints.SplineWaypoint;
import org.droidplanner.core.mission.waypoints.Waypoint;
Expand Down Expand Up @@ -139,11 +141,11 @@ public void removeItemList(List<MissionItemProxy> items) {
* 2D points making up the survey
*/
public void addSurveyPolygon(List<Coord2D> points) {
Survey survey = new Survey(mMission, points);
Survey3D survey = new Survey3D(mMission, points);
mMissionItems.add(new MissionItemProxy(this, survey));
mMission.addMissionItem(survey);
try {
survey.build();
//survey.build();
} catch (Exception e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -616,6 +618,7 @@ public List<List<Coord2D>> getPolygonsPath() {
if (item instanceof Survey) {
polygonPaths.add(((Survey)item).polygon.getPoints());
}

}
return polygonPaths;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
import org.droidplanner.core.mission.MissionItem;
import org.droidplanner.core.mission.commands.Takeoff;
import org.droidplanner.core.mission.survey.Survey;
import org.droidplanner.core.mission.survey.Survey2D;
import org.droidplanner.core.mission.survey.Survey3D;
import org.droidplanner.core.mission.waypoints.Circle;
import org.droidplanner.core.mission.waypoints.SpatialCoordItem;
import org.droidplanner.core.mission.waypoints.SplineWaypoint;
import org.droidplanner.core.mission.waypoints.StructureScanner;
import org.droidplanner.core.survey.grid.Grid;

import android.content.Context;
Expand Down Expand Up @@ -109,15 +110,14 @@ public List<Coord2D> getPath(Coord2D previousPoint) {
}
break;

case SURVEY:
Grid grid = ((Survey) mMissionItem).grid;
case SURVEY2D:
Grid grid = ((Survey2D) mMissionItem).grid;
if (grid != null) {
pathPoints.addAll(grid.gridPoints);
}
break;
case CYLINDRICAL_SURVEY:
StructureScanner survey = (StructureScanner)mMissionItem;
pathPoints.addAll(survey.getPath());
case SURVEY3D:
pathPoints.addAll(((Survey3D) mMissionItem).getPath());
break;
case TAKEOFF:
break;
Expand Down Expand Up @@ -157,7 +157,7 @@ public View getListViewItemView(Context context, ViewGroup parent) {
} catch (Exception e) {
// Do nothing when last item doesn't have an altitude
}
} else if (mMissionItem instanceof Survey) {
} else if (mMissionItem instanceof Survey2D) {
altitudeView.setText(((Survey) mMissionItem).surveyData.getAltitude().toString());

} else if (mMissionItem instanceof Takeoff) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.droidplanner.core.mission.MissionItemType;
import org.droidplanner.core.mission.commands.MissionCMD;
import org.droidplanner.core.mission.survey.Survey;
import org.droidplanner.core.mission.waypoints.StructureScanner;
import org.droidplanner.core.util.Pair;

import android.app.Activity;
Expand Down Expand Up @@ -86,9 +85,12 @@ public static MissionDetailFragment newInstance(MissionItemType itemType) {
case RTL:
fragment = new MissionRTLFragment();
break;
case SURVEY:
case SURVEY2D:
fragment = new MissionSurveyFragment();
break;
case SURVEY3D:
fragment = new MissionSurvey3DFragment();
break;
case TAKEOFF:
fragment = new MissionTakeoffFragment();
break;
Expand All @@ -98,9 +100,6 @@ public static MissionDetailFragment newInstance(MissionItemType itemType) {
case SPLINE_WAYPOINT:
fragment = new MissionSplineWaypointFragment();
break;
case CYLINDRICAL_SURVEY:
fragment = new MissionStructureScannerFragment();
break;
case CAMERA_TRIGGER:
fragment = new MissionCameraTriggerFragment();
break;
Expand Down Expand Up @@ -162,16 +161,13 @@ public void onViewCreated(View view, Bundle savedInstanceState) {

if ((currentItem instanceof Survey)) {
list.clear();
list.add(MissionItemType.SURVEY);
list.add(MissionItemType.SURVEY2D);
list.add(MissionItemType.SURVEY3D);
} else {
list.remove(MissionItemType.SURVEY);
list.remove(MissionItemType.SURVEY2D);
list.remove(MissionItemType.SURVEY3D);
}

if ((currentItem instanceof StructureScanner)) {
list.clear();
list.add(MissionItemType.CYLINDRICAL_SURVEY);
}

if (mMissionProxy.getItems().indexOf(itemProxy) != 0) {
list.remove(MissionItemType.TAKEOFF);
}
Expand All @@ -187,7 +183,6 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
list.remove(MissionItemType.CIRCLE);
list.remove(MissionItemType.ROI);
list.remove(MissionItemType.WAYPOINT);
list.remove(MissionItemType.CYLINDRICAL_SURVEY);
}

final TextView waypointIndex = (TextView) view.findViewById(R.id.WaypointIndex);
Expand Down Expand Up @@ -216,8 +211,7 @@ else if(mSelectedProxies.size() > 1){
list.remove(MissionItemType.TAKEOFF);
list.remove(MissionItemType.LAND);
list.remove(MissionItemType.RTL);
list.remove(MissionItemType.SURVEY);
list.remove(MissionItemType.CYLINDRICAL_SURVEY);
list.remove(MissionItemType.SURVEY2D);
}
else{
//Invalid state. We should not have been able to get here.
Expand Down

This file was deleted.

Loading