Skip to content

Commit

Permalink
Condition Get testing hack
Browse files Browse the repository at this point in the history
  • Loading branch information
DonLakeFlyer committed Apr 21, 2019
1 parent 68b26ee commit bac384a
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ QList<MAV_CMD> PX4FirmwarePlugin::supportedMissionCommands(void)
<< MAV_CMD_SET_CAMERA_MODE
<< MAV_CMD_IMAGE_START_CAPTURE << MAV_CMD_IMAGE_STOP_CAPTURE << MAV_CMD_VIDEO_START_CAPTURE << MAV_CMD_VIDEO_STOP_CAPTURE
<< MAV_CMD_NAV_DELAY
<< MAV_CMD_CONDITION_YAW;
<< MAV_CMD_CONDITION_YAW << MAV_CMD_CONDITION_GATE;

return list;
}
Expand Down
35 changes: 35 additions & 0 deletions src/MissionManager/MavCmdInfoCommon.json
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,41 @@
"enumValues": "3,4"
}
},
{
"id": 4501,
"rawName": "MAV_CMD_CONDITION_GATE",
"friendlyName": "Condition Gate",
"description": "Travel to a position in 3D space.",
"specifiesCoordinate": true,
"standaloneCoordinate": true,
"friendlyEdit": true,
"category": "Conditionals",
"param1": {
"label": "Hold",
"units": "secs",
"default": 0,
"decimalPlaces": 0
},
"param2": {
"label": "Acceptance",
"units": "m",
"default": 3,
"decimalPlaces": 2
},
"param3": {
"label": "PassThru",
"units": "m",
"default": 0,
"decimalPlaces": 2
},
"param4": {
"label": "Heading",
"units": "radians",
"nanUnchanged": true,
"default": null,
"decimalPlaces": 2
}
},
{ "id": 30001, "rawName": "MAV_CMD_PAYLOAD_PREPARE_DEPLOY", "friendlyName": "Payload prepare deploy" },
{ "id": 30002, "rawName": "MAV_CMD_PAYLOAD_CONTROL_DEPLOY", "friendlyName": "Payload control deploy" }
]
Expand Down
5 changes: 4 additions & 1 deletion src/MissionManager/MissionController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1914,7 +1914,7 @@ void MissionController::_scanForAdditionalSettings(QmlObjectListModel* visualIte
continue;
}
}

#if 0
SimpleMissionItem* simpleItem = qobject_cast<SimpleMissionItem*>(visualItem);
if (simpleItem) {
scanIndex++;
Expand All @@ -1923,6 +1923,9 @@ void MissionController::_scanForAdditionalSettings(QmlObjectListModel* visualIte
// Complex item, can't have sections
scanIndex++;
}
#else
scanIndex++;
#endif
}
}

Expand Down
35 changes: 35 additions & 0 deletions src/MissionManager/SurveyComplexItem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,41 @@ void SurveyComplexItem::_buildAndAppendMissionItems(QList<MissionItem*>& items,
bool transectEntry = true;

for (const CoordInfo_t& transectCoordInfo: transect) {
if (transectCoordInfo.coordType == TransectStyleComplexItem::CoordTypeSurveyEdge && !transectEntry) {
item = new MissionItem(seqNum++,
MAV_CMD_CONDITION_GATE,
mavFrame,
0, 0, 0, 0,
transectCoordInfo.coord.latitude(),
transectCoordInfo.coord.longitude(),
transectCoordInfo.coord.altitude(),
true, // autoContinue
false, // isCurrentItem
missionItemParent);
items.append(item);
item = new MissionItem(seqNum++,
MAV_CMD_DO_SET_CAM_TRIGG_DIST,
MAV_FRAME_MISSION,
0, // stop triggering
0, // shutter integration (ignore)
0, // trigger immediately when starting
0, 0, 0, 0, // param 4-7 unused
true, // autoContinue
false, // isCurrentItem
missionItemParent);
items.append(item);
item = new MissionItem(seqNum++,
MAV_CMD_IMAGE_START_CAPTURE,
MAV_FRAME_MISSION,
0, // Reserved (Set to 0)
0, // Interval (none)
1, // Take 1 photo
qQNaN(), qQNaN(), qQNaN(), qQNaN(), // param 4-7 reserved
true, // autoContinue
false, // isCurrentItem
missionItemParent);
items.append(item);
}
item = new MissionItem(seqNum++,
MAV_CMD_NAV_WAYPOINT,
mavFrame,
Expand Down

0 comments on commit bac384a

Please sign in to comment.