-
Notifications
You must be signed in to change notification settings - Fork 20.2k
AP_Mount_MAVLink: forward MAV_CMD_DO_SET_ROI_LOCATION to gimbal #32162
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
base: master
Are you sure you want to change the base?
AP_Mount_MAVLink: forward MAV_CMD_DO_SET_ROI_LOCATION to gimbal #32162
Conversation
peterbarker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic!
| if (natively_supports(MountTargetType::LOCATION)) { | ||
| send_target_location(_roi_target); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be here - it should be handled by the output stage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In clear_roi_target(), mode is set back to default mode, mount target type will no longer be LOCATION therefore send_target_location with zero target (ROI_NONE) will not be sent to gimbal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In clear_roi_target(), mode is set back to default mode, mount target type will no longer be LOCATION therefore send_target_location with zero target (ROI_NONE) will not be sent to gimbal.
Right - but we should be in some other targetting mode (e.g. ANGLE) and be sending angles (or retract, or...)
| pkt.x = roi_loc.lat, // param5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 | ||
| pkt.y = roi_loc.lng, // param6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7 | ||
| pkt.z = roi_loc.alt * 0.01f; // param7 / z position: global: altitude in meters (relative or absolute, depending on frame). | ||
| pkt.frame = (uint8_t)roi_loc.get_alt_frame(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does raise the question as to how to handle frames.
<entry value="131072" name="GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL">
<description>Gimbal manager supports to point to a global latitude, longitude, altitude position.</description>
</entry>
That doesn't give any sort of frame - so when we go to add the same thing for GIMBAL_DEVICE we need to pay a bit of attention.
One would usually assume AMSL here, but it's possible you could say "terrain" and let the gimbal sort itself out with a laser rangefinder.
Any suggestions, @hamishwillee ?
I think for the time being throwing the problem over to the camera like this will be fine.
|
I've created mavlink/mavlink#2411 to track adding a capability flag (which, presumably, the AVT cameras may start to emit) |
Forwards MAV_CMD_DO_SET_ROI_LOCATION to AVT gimbal.
Temporarily use vendor name to identify whether target location is supported.