Skip to content

Commit

Permalink
Adding example service calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Beaty authored and Crowdedlight committed May 21, 2024
1 parent 72269d9 commit adfcd9e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mavros_extras/src/plugins/gimbal_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ class GimbalControlPlugin : public plugin::Plugin
: Plugin(uas_, "gimbal_control"),
tf_send(false)
{
/**
* Sample service calls for interfacing with a Gimbal Protocol v2 gimbal:
* This service must be called first to take control of the gimbal:
* ros2 service call /mavros/gimbal_control/manager/configure mavros_msgs/srv/GimbalManagerConfigure "{sysid_primary: -2, compid_primary: 191, sysid_secondary: -1, compid_secondary: -1, gimbal_device_id: 0}"
* Set pitch and yaw:
* ros2 service call /mavros/gimbal_control/manager/pitchyaw mavros_msgs/srv/GimbalManagerPitchyaw "{pitch: -45, yaw: 90, pitch_rate: -0.2, yaw_rate: -0.2, flags: 0, gimbal_device_id: 0}"
* Set region of intrest for tracking:
* ros2 service call /mavros/gimbal_control/manager/set_roi mavros_msgs/srv/GimbalManagerSetRoi "{mode: 0, gimbal_device_id: 0, latitude: x, longitude: y, altitude: z}"
*/
// Callback group for supporting nested service calls
cb_group = node->create_callback_group(rclcpp::CallbackGroupType::Reentrant);

Expand Down

0 comments on commit adfcd9e

Please sign in to comment.