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

Add Mount Control plugin to control mount continuously #1257

Merged
merged 6 commits into from Jun 27, 2019

Conversation

@Jaeyoung-Lim
Copy link
Contributor

Jaeyoung-Lim commented Jun 22, 2019

I have been trying to control the gimbal continously while the vehicle is constantly being commanded with continuous setpoints in offboard mode. This can be used for image based object / human tracking control.

I have been trying to use actuator_setpoints with mixer group = 2 but this led to some problems. However, to use actuator control setpoints, vmount needs to be disabled.

A better alternative is to use MAV_CMD_DO_MOUNT_CONTROL message as this utilizes the vmount running on the drone. However, the command plugin in mavros only has a service interface, which is not suited for controlling the gimbal continuously.

Solution
This PR adds a MountControl plugin, which streams a MAV_CMD_DO_MOUNT_CONTROL mavlink stream by subscribing to a topic ~mount_control/command. A custom MountControl.msg was defined for this interafce.

Test data / coverage
The vehicle is flown in offboard mode to follow a circular trajectory while being streamed mount control setpoints.

Additional context
This provides a alternative to the issues with controlling the gimbal with actuator_control messages as in PX4/Firmware#12029
The video above is comparable to the video below where the gimbal is controlled by actuator setpoints: https://youtu.be/vEbUaGOuFjs

@Jaeyoung-Lim Jaeyoung-Lim changed the title Add Mount Control plugin to control mount Add Mount Control plugin to control mount continuously Jun 22, 2019
@vooon
vooon approved these changes Jun 25, 2019
Copy link
Member

vooon left a comment

LGTM

mavros_extras/src/plugins/mount_control.cpp Outdated Show resolved Hide resolved
cmd.param4 = req->altitude; //
cmd.param5 = req->latitude; // lattitude in degrees * 1E7
cmd.param6 = req->longitude; // longitude in degrees * 1E7
cmd.param7 = req->mode; // MAV_MOUNT_MODE

This comment has been minimized.

Copy link
@TSC21

TSC21 Jun 25, 2019

Member

Is this something you change on the fly, or rather a fixed mode from start to beginning?

This comment has been minimized.

Copy link
@Jaeyoung-Lim

Jaeyoung-Lim Jun 25, 2019

Author Contributor

@TSC21 I guess this could depend on the application, but the intention was to define the mavros_msgs as close as to the real mavlink message. There is a separate mavlink for DO_MOUNT_CONFIGURE which is not implemented in this plugin

This comment has been minimized.

Copy link
@TSC21

TSC21 Jun 25, 2019

Member

Can you extend it already? Would make it more complete.

This comment has been minimized.

Copy link
@Jaeyoung-Lim

Jaeyoung-Lim Jun 26, 2019

Author Contributor

@TSC21 This would be possible already with the services using the command plugin. Do you think defining a new custom service in this plugin would be better approach?

This comment has been minimized.

Copy link
@TSC21

TSC21 Jun 26, 2019

Member

@Jaeyoung-Lim yes that could work yes :)

@TSC21
TSC21 approved these changes Jun 26, 2019
Copy link
Member

TSC21 left a comment

LGTM

@vooon vooon merged commit 10dd815 into mavlink:master Jun 27, 2019
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
@vooon vooon added this to the Version 0.32 milestone Jun 27, 2019
@Jaeyoung-Lim Jaeyoung-Lim deleted the Jaeyoung-Lim:pr-gimbal-control branch Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.