Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected command while setting mode #1294

Open
v-to opened this issue Aug 14, 2019 · 5 comments
Open

unexpected command while setting mode #1294

v-to opened this issue Aug 14, 2019 · 5 comments

Comments

@v-to
Copy link

v-to commented Aug 14, 2019

Issue details

Please describe the problem, or desired feature

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

mavsafety arm/disarm is working fine, mavcmd for setting servos as well, 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?

MAVROS version and platform

Mavros: 0.29.2
ROS: Lunar
Ubuntu: 16.04

Autopilot type and version

[ x ] ArduPilot
[ ] PX4

Version: 3.5.1 ArduRover

Node logs

[ INFO] [1565769114.857175129]: FCU URL: /dev/ttyS1:57600
[ INFO] [1565769114.858655472]: serial0: device: /dev/ttyS1 @ 57600 bps
[ INFO] [1565769114.858987507]: GCS URL: udp://@
[ INFO] [1565769114.859150206]: udp1: Bind address: 0.0.0.0:14555
[ INFO] [1565769114.878820334]: Plugin 3dr_radio loaded
[ INFO] [1565769114.880262191]: Plugin 3dr_radio initialized
[ INFO] [1565769114.880326545]: Plugin actuator_control loaded
[ INFO] [1565769114.883385227]: Plugin actuator_control initialized
[ INFO] [1565769114.891112436]: Plugin adsb loaded
[ INFO] [1565769114.903722850]: Plugin adsb initialized
[ INFO] [1565769114.904065093]: Plugin altitude loaded
[ INFO] [1565769114.907913076]: Plugin altitude initialized
[ INFO] [1565769114.908197238]: Plugin cam_imu_sync loaded
[ INFO] [1565769114.910433955]: Plugin cam_imu_sync initialized
[ INFO] [1565769114.910780415]: Plugin command loaded
[ INFO] [1565769114.929798884]: Plugin command initialized
[ INFO] [1565769114.930089141]: Plugin companion_process_status loaded
[ INFO] [1565769114.940013238]: Plugin companion_process_status initialized
[ INFO] [1565769114.940284215]: Plugin debug_value loaded
[ INFO] [1565769114.960504624]: Plugin debug_value initialized
[ INFO] [1565769114.960797651]: Plugin distance_sensor loaded
[ WARN] [1565769114.964736514]: DS: plugin not configured!
[ INFO] [1565769114.964815354]: Plugin distance_sensor initialized
[ INFO] [1565769114.965073022]: Plugin fake_gps loaded
[ INFO] [1565769114.999936357]: Plugin fake_gps initialized
[ INFO] [1565769115.000323849]: Plugin ftp loaded
[ INFO] [1565769115.023821379]: Plugin ftp initialized
[ INFO] [1565769115.024202377]: Plugin global_position loaded
[ INFO] [1565769115.078218371]: Plugin global_position initialized
[ INFO] [1565769115.078530845]: Plugin gps_rtk loaded
[ INFO] [1565769115.088804507]: Plugin gps_rtk initialized
[ INFO] [1565769115.089232083]: Plugin hil loaded
[ INFO] [1565769115.132297298]: Plugin hil initialized
[ INFO] [1565769115.132528141]: Plugin home_position loaded
[ INFO] [1565769115.139230362]: Plugin home_position initialized
[ INFO] [1565769115.139434098]: Plugin imu loaded
[ INFO] [1565769115.150187645]: Plugin imu initialized
[ INFO] [1565769115.150401325]: Plugin local_position loaded
[ INFO] [1565769115.160923382]: Plugin local_position initialized
[ INFO] [1565769115.161126213]: Plugin log_transfer loaded
[ INFO] [1565769115.166055331]: Plugin log_transfer initialized
[ INFO] [1565769115.166277394]: Plugin manual_control loaded
[ INFO] [1565769115.172050811]: Plugin manual_control initialized
[ INFO] [1565769115.172234636]: Plugin mocap_pose_estimate loaded
[ INFO] [1565769115.178572706]: Plugin mocap_pose_estimate initialized
[ INFO] [1565769115.178786036]: Plugin obstacle_distance loaded
[ INFO] [1565769115.183327480]: Plugin obstacle_distance initialized
[ INFO] [1565769115.183517415]: Plugin odom loaded
[ INFO] [1565769115.194977104]: Plugin odom initialized
[ INFO] [1565769115.195223829]: Plugin param loaded
[ INFO] [1565769115.200640146]: Plugin param initialized
[ INFO] [1565769115.200830801]: Plugin px4flow loaded
[ INFO] [1565769115.211481693]: Plugin px4flow initialized
[ INFO] [1565769115.211674291]: Plugin rangefinder loaded
[ INFO] [1565769115.212789203]: Plugin rangefinder initialized
[ INFO] [1565769115.213002720]: Plugin rc_io loaded
[ INFO] [1565769115.219271638]: Plugin rc_io initialized
[ INFO] [1565769115.219495461]: Plugin safety_area loaded
[ INFO] [1565769115.227534992]: Plugin safety_area initialized
[ INFO] [1565769115.227781765]: Plugin setpoint_accel loaded
[ INFO] [1565769115.233391734]: Plugin setpoint_accel initialized
[ INFO] [1565769115.233607678]: Plugin setpoint_attitude loaded
[ INFO] [1565769115.249610246]: Plugin setpoint_attitude initialized
[ INFO] [1565769115.249803637]: Plugin setpoint_position loaded
[ INFO] [1565769115.271869856]: Plugin setpoint_position initialized
[ INFO] [1565769115.272039560]: Plugin setpoint_raw loaded
[ INFO] [1565769115.281934571]: Plugin setpoint_raw initialized
[ INFO] [1565769115.282039306]: Plugin setpoint_velocity loaded
[ INFO] [1565769115.288683292]: Plugin setpoint_velocity initialized
[ INFO] [1565769115.288838281]: Plugin sys_status loaded
[ INFO] [1565769115.297458393]: Plugin sys_status initialized
[ INFO] [1565769115.297603547]: Plugin sys_time loaded
[ INFO] [1565769115.302266056]: TM: Timesync mode: MAVLINK
[ INFO] [1565769115.303286027]: Plugin sys_time initialized
[ INFO] [1565769115.303401904]: Plugin trajectory loaded
[ INFO] [1565769115.308299316]: Plugin trajectory initialized
[ INFO] [1565769115.308424416]: Plugin vfr_hud loaded
[ INFO] [1565769115.308971572]: Plugin vfr_hud initialized
[ INFO] [1565769115.309074649]: Plugin vibration loaded
[ INFO] [1565769115.309958964]: Plugin vibration initialized
[ INFO] [1565769115.310061265]: Plugin vision_pose_estimate loaded
[ INFO] [1565769115.315899988]: Plugin vision_pose_estimate initialized
[ INFO] [1565769115.316021102]: Plugin vision_speed_estimate loaded
[ INFO] [1565769115.320048809]: Plugin vision_speed_estimate initialized
[ INFO] [1565769115.320175454]: Plugin waypoint loaded
[ INFO] [1565769115.323769101]: Plugin waypoint initialized
[ INFO] [1565769115.323859340]: Plugin wheel_odometry loaded
[ WARN] [1565769115.327983322]: WO: Not all wheels have parameters specified (0/2).
[ WARN] [1565769115.328010581]: WO: No odometry computations will be performed.
[ INFO] [1565769115.328036199]: Plugin wheel_odometry initialized
[ INFO] [1565769115.328128786]: Plugin wind_estimation loaded
[ INFO] [1565769115.328690707]: Plugin wind_estimation initialized
[ INFO] [1565769115.328727009]: Built-in SIMD instructions: SSE, SSE2
[ INFO] [1565769115.328748877]: Built-in MAVLink package version: 2019.4.4
[ INFO] [1565769115.328775001]: Known MAVLink dialects: common ardupilotmega ASLUAV autoquad icarous matrixpilot paparazzi slugs standard uAvionix ualberta
[ INFO] [1565769115.328795428]: MAVROS started. MY ID 1.240, TARGET ID 1.1
[ INFO] [1565769115.644516143]: CON: Got HEARTBEAT, connected. FCU: ArduPilot
[ INFO] [1565769115.750032680]: RC_CHANNELS message detected!
[ INFO] [1565769115.757520444]: IMU: Raw IMU message used.
[ INFO] [1565769116.677169086]: VER: 1.1: Capabilities 0x00000000000031cf
[ INFO] [1565769116.677278886]: VER: 1.1: Flight software: 030501ff ( 71093b8)
[ INFO] [1565769116.677382286]: VER: 1.1: Middleware software: 00000000 ( )
[ INFO] [1565769116.677466744]: VER: 1.1: OS software: 00000000 ( 35ad8a7)
[ INFO] [1565769116.677548681]: VER: 1.1: Board hardware: 00000000
[ INFO] [1565769116.677634672]: VER: 1.1: VID/PID: 0000:0000
[ INFO] [1565769116.677722839]: VER: 1.1: UID: 0000000000000000
[ WARN] [1565769116.678987484]: CMD: Unexpected command 520, result 0
[ INFO] [1565769125.668757958]: FCU: ArduRover V3.5.1 (71093b86)
[ INFO] [1565769125.676969048]: FCU: ChibiOS: 35ad8a79
[ INFO] [1565769125.687359377]: FCU: fmuv3 00430030 31365114 30313330
[ INFO] [1565769130.691732989]: WP: item #0 F:0 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 54.312653 y: 18.110392 z: 143.169998
[ INFO] [1565769130.744116362]: WP: item #1 F:3 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 54.315193 y: 18.109932 z: 100.000000
[ INFO] [1565769130.773072370]: WP: item #2 F:3 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 54.315174 y: 18.110382 z: 100.000000
[ INFO] [1565769130.791839222]: WP: item #3 F:3 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 54.314976 y: 18.110470 z: 100.000000
[ INFO] [1565769130.843224100]: WP: item #4 F:3 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 54.314693 y: 18.110430 z: 100.000000
[ INFO] [1565769130.871632363]: WP: item #5 F:3 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 54.314510 y: 18.110489 z: 100.000000
[ INFO] [1565769130.893041195]: WP: item #6 F:3 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 54.314426 y: 18.110807 z: 100.000000
[ INFO] [1565769130.943817373]: WP: item #7 F:3 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 54.314342 y: 18.111145 z: 100.000000
[ INFO] [1565769130.971802104]: WP: item #8 F:3 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 54.314117 y: 18.111208 z: 100.000000
[ INFO] [1565769130.992662098]: WP: item #9 F:3 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 54.313900 y: 18.110962 z: 100.000000
[ INFO] [1565769131.043232711]: WP: item #10 F:3 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 54.313740 y: 18.110586 z: 100.000000
[ INFO] [1565769131.071572210]: WP: item #11 F:3 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 54.313625 y: 18.109974 z: 100.000000
[ INFO] [1565769131.092891310]: WP: item #12 F:3 C: 16 p: 0.000000 0.000000 0.000000 0.000000 x: 54.313560 y: 18.109573 z: 100.000000
[ INFO] [1565769131.093086643]: WP: mission received
[ INFO] [1565769147.289256949]: PR: parameters list received

Diagnostics

header:
seq: 2737
stamp:
secs: 1565770882
nsecs: 829359576
frame_id: ''
status:

level: 0
name: "mavros: FCU connection"
message: "connected"
hardware_id: "/dev/ttyS1:57600"
values: 
  - 
    key: "Received packets:"
    value: "52780"
  - 
    key: "Dropped packets:"
    value: "0"
  - 
    key: "Buffer overruns:"
    value: "0"
  - 
    key: "Parse errors:"
    value: "0"
  - 
    key: "Rx sequence number:"
    value: "163"
  - 
    key: "Tx sequence number:"
    value: "200"
  - 
    key: "Rx total bytes:"
    value: "1575218"
  - 
    key: "Tx total bytes:"
    value: "4994"
  - 
    key: "Rx speed:"
    value: "1300.000000"
  - 
    key: "Tx speed:"
    value: "0.000000"
  • level: 0
    name: "mavros: GPS"
    message: "3D fix"
    hardware_id: "/dev/ttyS1:57600"
    values:

    key: "Satellites visible"
    value: "17"
    
    • key: "Fix type"
      value: "3"
    • key: "EPH (m)"
      value: "0.61"
    • key: "EPV (m)"
      value: "0.88"
  • level: 0
    name: "mavros: Heartbeat"
    message: "Normal"
    hardware_id: "/dev/ttyS1:57600"
    values:

    key: "Heartbeats since startup"
    value: "1768"
    
    • key: "Frequency (Hz)"
      value: "1.037019"
    • key: "Vehicle type"
      value: "Surface vessel"
    • key: "Autopilot type"
      value: "ArduPilot"
    • key: "Mode"
      value: "GUIDED"
    • key: "System status"
      value: "Active"
  • level: 0
    name: "mavros: System"
    message: "Normal"
    hardware_id: "/dev/ttyS1:57600"
    values:

    key: "Sensor present"
    value: "0x0320DC27"
    
    • key: "Sensor enabled"
      value: "0x0020DC27"
    • key: "Sensor helth"
      value: "0x0320DC27"
    • key: "3D gyro"
      value: "Ok"
    • key: "3D accelerometer"
      value: "Ok"
    • key: "3D magnetometer"
      value: "Ok"
    • key: "GPS"
      value: "Ok"
    • key: "3D angular rate control"
      value: "Ok"
    • key: "attitude stabilization"
      value: "Ok"
    • key: "yaw position"
      value: "Ok"
    • key: "x/y position control"
      value: "Ok"
    • key: "motor outputs / control"
      value: "Ok"
    • key: "AHRS subsystem health"
      value: "Ok"
    • key: "CPU Load (%)"
      value: "11.0"
    • key: "Drop rate (%)"
      value: "0.0"
    • key: "Errors comm"
      value: "0"
    • key: "Errors count mavconn library. #1"
      value: "0"
    • key: "Errors count Pub/sub for Mavlink.msg #2"
      value: "0"
    • key: "Errors count Plugin loading functionality. #3"
      value: "0"
    • key: "Errors count Diagnostic mesages. #4"
      value: "0"
  • level: 1
    name: "mavros: Battery"
    message: "Low voltage"
    hardware_id: "/dev/ttyS1:57600"
    values:

    key: "Voltage"
    value: "0.00"
    
    • key: "Current"
      value: "-0.0"
    • key: "Remaining"
      value: "-1.0"

Check ID

WARNING: mavros/target_system_id not set. Used default value: 1
WARNING: mavros/target_component_id not set. Used default value: 1
NOTE: Target parameters may be unset, but that may be result of incorrect --mavros-ns option.Double check results!
OK. I got messages from 1:1.


Received 442 messages, from 2 addresses
sys:comp list of messages
255:190 0, 111
1:1 0, 1, 2, 22, 129, 137, 152, 150, 24, 27, 29, 30, 32, 33, 34, 163, 36, 165, 42, 49, 178, 158, 182, 62, 65, 194, 74, 193, 111, 241, 242, 116, 125

@vooon
Copy link
Member

vooon commented Aug 14, 2019

I suppose that better to use string-custom modes, i'm not sure does base mode mask still works ok.
Take a look at http://wiki.ros.org/mavros/CustomModes , it's a bit outdated, but most of modes should be there.

@v-to
Copy link
Author

v-to commented Aug 16, 2019

Thanks vooon. I've tried this already. For custom modes I got "Unsupported FCU" :(
Any ideas why?

rgds

VV

@vooon
Copy link
Member

vooon commented Aug 16, 2019

Check Rover modes, if not helps, then check that https://github.com/mavlink/mavros/blob/master/mavros/src/lib/uas_stringify.cpp#L197

@v-to
Copy link
Author

v-to commented Jun 21, 2021

Hi vooon,

After shifting another project I am back to this place.
The problm is still unsolved however :(
I have looked over all the parameters.
The newest idea is that maybe there is an issue with FCU type?

I can see in code that MAV_TYPE should be SURFACE_BOAT.
In my mavros/diagnostics I have
key: "Vehicle type"
value: "Surface vessel" and not surface boat.
Can this be an issue?
Or maybe you have other ideas?

Kind regards

VV

@vooon
Copy link
Member

vooon commented Jun 24, 2021

That's ok, vehicle type uses shortened description for entry: https://mavlink.io/en/messages/common.html#MAV_TYPE_SURFACE_BOAT

rosrun mavros mavsys mode -c AUTO - that didn't work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants