rosservice call /mavros/set_mode "base_mode: 0 custom_mode: 'OFFBOARD'
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 typesrv file: uint8 MAVMODEPREFLIGHT=0 uint8 MAVMODESTABILIZEDISARMED=80 uint8 MAVMODESTABILIZEARMED=208 uint8 MAVMODEMANUALDISARMED=64 uint8 MAVMODEMANUALARMED=192 uint8 MAVMODEGUIDEDDISARMED=88 uint8 MAVMODEGUIDEDARMED=216 uint8 MAVMODEAUTODISARMED=92 uint8 MAVMODEAUTOARMED=220 uint8 MAVMODETESTDISARMED=66 uint8 MAVMODETESTARMED=194 uint8 basemode string custommode --- bool mode_sent
Asked by Daniel15 on 2021-05-02 01:52:37 UTC
Answers
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!
Asked by gaussian on 2021-08-05 16:18:48 UTC
Comments