ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

rosservice call /mavros/set_mode "base_mode: 0 custom_mode: 'OFFBOARD'

asked 2021-05-02 01:54:37 -0500

Daniel15 gravatar image

I am trying to change the mode of my iris drone in gazebo using ROS Service from its base mode MANUAL to custom mode OFFBOARD. But when I hit the following command in the terminal, I get the following error. What should I do to resolve this issue

$ rosservice call /mavros/set_mode manual offboard

ERROR: Unable to send request. One of the fields has an incorrect type:
field base_mode must be unsigned integer type

srv file: uint8 MAV_MODE_PREFLIGHT=0 uint8 MAV_MODE_STABILIZE_DISARMED=80 uint8 MAV_MODE_STABILIZE_ARMED=208 uint8 MAV_MODE_MANUAL_DISARMED=64 uint8 MAV_MODE_MANUAL_ARMED=192 uint8 MAV_MODE_GUIDED_DISARMED=88 uint8 MAV_MODE_GUIDED_ARMED=216 uint8 MAV_MODE_AUTO_DISARMED=92 uint8 MAV_MODE_AUTO_ARMED=220 uint8 MAV_MODE_TEST_DISARMED=66 uint8 MAV_MODE_TEST_ARMED=194 uint8 base_mode string custom_mode --- bool mode_sent

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-08-05 16:18:48 -0500

gaussian gravatar image

updated 2021-08-05 16:29:22 -0500

The syntax to make that service call has a return key between the base_mode and custom_mode like below

rosservice call /mavros/set_mode "base_mode: 0 <Hit Enter key> custom_mode: 'OFFBOARD'"

Like this!

image description

edit flag offensive delete link more

Question Tools

Stats

Asked: 2021-05-02 01:52:37 -0500

Seen: 694 times

Last updated: Aug 05 '21