I am experimenting with the plugin architecture in QGC. I have created a working custom build that can control a robot with MAV_AUTOPILOT_GENERIC and MAV_TYPE_SURFACE_BOAT combination. I can plan and execute missions successfully with QGC on a simulated robot. I want to change the UI elements in the plan view for waypoints. Since I am using a surface boat as the vehicle type, I want to remove certain parameters from MAV_CMD_NAV_WAYPOINT definition. I created a json file and added the override method missionCommandOverrides in my firmware plugin. However, with this override, QGC crashes when I try to add a waypoint in the plan view. I also added MAV_TYPE_SURFACE_BOAT in MissionCommandTree::setToolbox method, which already contains a few other vehicle types.
// Load all levels of hierarchy
for (MAV_AUTOPILOT firmwareType: _toolbox->firmwarePluginManager()->supportedFirmwareTypes()) {
FirmwarePlugin* plugin = _toolbox->firmwarePluginManager()->firmwarePluginForAutopilot(firmwareType, MAV_TYPE_QUADROTOR);
QList<MAV_TYPE> vehicleTypes;
vehicleTypes << MAV_TYPE_GENERIC << MAV_TYPE_SURFACE_BOAT << MAV_TYPE_FIXED_WING << MAV_TYPE_QUADROTOR << MAV_TYPE_VTOL_QUADROTOR << MAV_TYPE_GROUND_ROVER << MAV_TYPE_SUBMARINE;
for(MAV_TYPE vehicleType: vehicleTypes) {
QString overrideFile = plugin->missionCommandOverrides(vehicleType);
if (!overrideFile.isEmpty()) {
_staticCommandTree[firmwareType][vehicleType] = new MissionCommandList(overrideFile, firmwareType == MAV_AUTOPILOT_GENERIC && vehicleType == MAV_TYPE_GENERIC /* baseCommandList */, this);
}
}
}
My mav-info json file includes the following -
{
"comment": "Generic, Surface Boat",
"version": 1,
"fileType": "MavCmdInfo",
"mavCmdInfo": [
{
"id": 16,
"comment": "MAV_CMD_NAV_WAYPOINT",
"paramRemove": "1,4"
}
]
}
I am not sure what I am doing wrong. Any input is greatly appreciated!