mavlink / mavros

MAVLink to ROS gateway with proxy for Ground Control Station
Other
879 stars 990 forks source link

custom_mode: OFFBOARD invalid? #620

Closed zhahaoyu closed 7 years ago

zhahaoyu commented 7 years ago

After I connected my ros node to mavros, I was trying to send custom_mode OFFBOARD, but the mavros console outputs [ WARN] [1477604919.660821416]: CMD: Unexpected command 176, result 0

The code I use is

    ros::ServiceClient set_mode_client = nh.serviceClient<mavros_msgs::SetMode("mavros/set_mode");
    mavros_msgs::SetMode offb_set_mode;
    offb_set_mode.request.custom_mode = "OFFBOARD";
    set_mode_client.call(offb_set_mode)
vooon commented 7 years ago

And what? State.custom_mode won't change to offboard?

vooon commented 7 years ago

And i guess you use PX4? Versions? ROS?

vooon commented 7 years ago

Related / dup of #512

zhahaoyu commented 7 years ago

@vooon Yes I am using PX4, latest source version and ROS kinetic. What I found out is

  1. I have to arm the vehicle first, then switch it to offboard, which is different from the order suggested by the example http://dev.px4.io/ros-mavros-offboard.html
  2. I am able to change it to offboard mode, but mavros still reports it as unexpected command.
vooon commented 7 years ago

You may ignore command 176 and 400 because it's parasitic effect of PX4 internal message processing. PX4 resend SET_MODE message to uORB command topic (also it serve COMMAND_LONG and _INT) so command processor later send confirmation which is unexpected for command plugin.

zhahaoyu commented 7 years ago

Thanks @vooon

bhaskar-glitch commented 2 years ago

You may ignore command 176 and 400 because it's parasitic effect of PX4 internal message processing. PX4 resend SET_MODE message to uORB command topic (also it serve COMMAND_LONG and _INT) so command processor later send confirmation which is unexpected for command plugin.

HI @vooon I need a help..I'm unable to switch to offbaord mode and the error is CMD: Unexpected command 176, result 1 please help