-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
AP_MISSION: Add missing do nothing commands mavsdk compatability #24702
AP_MISSION: Add missing do nothing commands mavsdk compatability #24702
Conversation
We have a general policy of not introducing dead code into ArduPilot. The intent of those commands seems more than "unimportant" to me - how did you come to the conclusion they weren't? |
Hello @peterbarker, |
@trolledbypro, These are just some beside code things to consider:
|
Hello @khanasif786, |
Hi, I wonder why MAVSDK support requires adding support for new mission items. I thought MAVSDK would normally be used for real-time control of a vehicle rather than for creating missions. I can imagine that MAVSDK can create missions.. but I would have thought that would have been a lesser used feature. The MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE mission command is near useless I think. We've added real-time support for this command so as to ease QGC development but I really question even the real-time messages usefulness. MAV_CMD_IMAGE_STOP_CAPTURE is useful and we should definitely add support for that one. |
At the moment, with the pull requests I have contributed to MAVSDK and have been approved, the mission module is compatible with ArduPilot save for camera and gimbal control. The mission module is the main area of MAVSDK that is incompatible with ArduPilot. Still lots of testing required to validate my changes to Mission module |
By the way, thanks very much for working on improving AP's MAVSDK compatibility! |
In support of #24692
Hello,
As I continue to troubleshoot ArduPilot compatibility with MAVSDK Mission module, I noticed that several camera action commands are missing. ArduPilot was rejecting mission sequences generated by MAVSDK that included MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE and MAV_CMD_IMAGE_STOP_CAPTURE.
After examining the code in the AP_Mount and AP_Camera libraries, I concluded that these two commands do not do anything of importance. My solution to extend MAVSDK compatibility is to add these two commands as mission commands that do nothing for now and then implement the proper functions of the commands as they are implemented in AP_Mount/AP_Camera.
MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE:
Support for this command was recently added to AP_Mount from PR #23737. This PR added the ability to set who is in primary control of a gimbal to the struct mavlink_control_id.
ardupilot/libraries/AP_Mount/AP_Mount_Backend.h
Lines 270 to 275 in 7d264f1
This struct is not used anywhere except to broadcast who is in control of the gimbal in the gimbal_manager_status message.
Since this struct is not used for actual gimbal control, my interim solution to allow for MAVSDK compatibility is to allow for MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE to be accepted as a mission command and have it do nothing. In the future, I can try to implement this command like in PR #23737 to allow for the gimbal control struct to be populated (if it is deemed important enough to need to be done now) and definately once gimbal development advances to a point where gimbal control is developed.
MAV_CMD_IMAGE_STOP_CAPTURE:
This command currently not implemented in the AP_Camera library. My interim solution to allow for MAVSDK compatibility is to allow for this mission command to be accepted and do nothing until support is added into AP_Camera.
In terms of testing, the only testing I have done is in ArduPilot SITL is to see if the commands are accepted. I have not tested with real hardware.
Does this sound like a reasonable solution to add MAVSDK compatibility now while allowing for further gimbal/camera development?