Servers by jDrones

Unexpected command from mavros

(VV) #1

I am using Ardurover for floating drone and working on anticollision system.

I am trying to send mavlink commands via mavros to ardupilot rover.

mavsafety arm/disarm is working fine, but I can’t change mode of the autopilot.

I am sending message with: rosrun mavros mavsys mode -b 4
I am getting response: CMD: Unexpected command 11, result 3

I run out of ideas how to solve this. Any idea of what might be the issue?
Any help appreciated.

All the best!

v-to

(rmackay9) #2

@v-to,

I’m not much of a ROS expert but I put together this wiki page and it seems to change mode the command would be, “rosrun mavros mavsys mode -c 4”

(VV) #3

Thanks rmackay9 for this quick answer and hint.
I’ve tried this before though. -c is for custom modes, which are not supported by mu FCU - I’ve got mode:Unsupported FCU in reply.
So I can choose only between basic modes (-b).
I feel like it is more ardupilot issue rather than ROS - the command is being sent properly, but FCU doesn;t accept it in its particular state for some reason.

I had similiar problem before with DO_SET_SERVO and the solution was to … switch joystick on in GCU…
BUt it still doesn’t help for changing mode.

Any other ideas?

rgds

VV

(rmackay9) #4

@v-to,

I’m pretty sure that it must be “-c”. Perhaps try connecting a ground station to the flight controller to test changing modes and see if it displays a message. Alternatively the dataflash logs will contain a message saying why requests to change flight mode failed.

(VV) #5

Thanks gents. In this situation I will try to debug Mission Planner to see what it sends from GCS while changing mode.

What do you mean by “dataflash logs”?

ROS logs only says “Unsupported FCU”

Rgds

VV

(VV) #6

So, Mission Planner can change modes via GUI and via Joystick. As I can see in code cmd 176 is used.
Anyway no luck with mavros :frowning:

commands:
hd@nawigacyjny:~$ rosrun mavros mavsys mode -b 4
hd@nawigacyjny:~$ rosrun mavros mavsys mode -c HOLD
Request failed. Check mavros logs
hd@nawigacyjny:~$ rosrun mavros mavcmd long 176 0 HOLD 0 0 0 0 0
usage: mavcmd long [-h] [-c] [-b]
command param1 param2 param3 param4 param5 param6 param7
mavcmd long: error: argument param2: invalid float value: ‘HOLD’
hd@nawigacyjny:~$ rosrun mavros mavcmd long 176 0 4 0 0 0 0 0
Request failed. Check mavros logs. ACK: 3
hd@nawigacyjny:~$ rosrun mavros mavcmd long 176 0 0 0 0 0 0 0
Request failed. Check mavros logs. ACK: 3
hd@nawigacyjny:~$ rosrun mavros mavcmd long 176 0 4 0 0 0 0 0
Request failed. Check mavros logs. ACK: 3
hd@nawigacyjny:~$ rosrun mavros mavcmd long 176 0 0 0 0 0 0 0
Request failed. Check mavros logs. ACK: 3
hd@nawigacyjny:~$ rosrun mavros mavsafety arm
hd@nawigacyjny:~$ rosrun mavros mavcmd long 176 0 4 0 0 0 0 0
Request failed. Check mavros logs. ACK: 3
hd@nawigacyjny:~$ rosrun mavros mavcmd long 176 0 0 0 0 0 0 0
Request failed. Check mavros logs. ACK: 3

Responces:
[ WARN] [1565947314.909183781]: CMD: Unexpected command 11, result 3
[ WARN] [1565947326.511162588]: TM : RTT too high for timesync: 1565941334950.23 ms.
[ERROR] [1565947381.779252178]: MODE: Unsupported FCU

I ran out of ideas …
Any concept?

rgds

VV

(rmackay9) #7

@v-to,

Dataflash logs are discussed here on the wiki.

I’m not sure what the issue is with mavros. I’ve certainly been able to change modes. Maybe someone in this gitter chat will know.

EDIT: it might also be good to compare your setup to what is described on the wiki here.

(VV) #8

Gents,

I’ve check the logs and I didn’t find anything…

Anyway our site test are finished already and at the moment I have no direct access to hardware.

I will try to duplicate the environment In SITL and get back to the issue, hopefully before tests in September.

Many thank for help -probably I will bother you again soon :wink:

Rgds

VV

1 Like