mavlink / mavlink2rest

mavlink2rest creates a REST server that provides mavlink information from a mavlink source
MIT License
75 stars 27 forks source link

Ardusub command MAV_CMD_DO_SET_MODE is unsupported #33

Closed enderocean closed 3 years ago

enderocean commented 3 years ago

Hi, Below message is submitted on "0.0.0.0:8088/mavlink" URL and works well using SITL autotest tool

msg.payload = {
      "header": {
        "system_id": 1,
        "component_id": 1,
        "sequence": 0
      },
      "message": {
        "type":"COMMAND_LONG",
        "param1":19.0,
        "param2":0.0,"param3":0.0,"param4":0.0,"param5":0.0,"param6":0.0,"param7":0.0,
        "command":{
          "type":"MAV_CMD_DO_SET_MODE"
        },
        "target_system":0,
        "target_component":0,
        "confirmation":0
      }
    };

In this case, system is set in STABILIZE mode.

But same message does not work on real BlueROV2.

When opening "0.0.0.0:8088/mavlink", I found this:

...
"COMMAND_ACK":{"command":{"type":"MAV_CMD_DO_SET_MODE"},"message_information":{"counter":3,"frequency":0.11999999731779099,"time":{"first_message":"2021-02-21T19:28:35.290372244+01:00","last_message":"2021-02-21T19:29:00.714305563+01:00"}},"progress":0,"result":{"type":"MAV_RESULT_UNSUPPORTED"},"result_param2":0,"target_component":0,"target_system":0,"type":"COMMAND_ACK"}
...

and

...
"HEARTBEAT":{"autopilot":{"type":"MAV_AUTOPILOT_ARDUPILOTMEGA"},"base_mode":{"bits":209},"custom_mode":19,"mavlink_version":3,"mavtype":{"type":"MAV_TYPE_SUBMARINE"},"message_information":{"counter":106,"frequency":1.009523868560791,"time":{"first_message":"2021-02-21T19:27:16.370862274+01:00","last_message":"2021-02-21T19:29:01.574418010+01:00"}},"system_status":{"type":"MAV_STATE_CRITICAL"},"type":"HEARTBEAT"}
...

Any idea why message is supported in SITL and not on BR2 ? Thank you for your return.

patrickelectric commented 3 years ago

Hi @enderocean, can you please inform your ardusub version and the entire output of the root page of the rest api ?

enderocean commented 3 years ago

ArduSub Version: 3.5.4

patrickelectric commented 3 years ago

Hi, please updates to the latest stable version (4.0.2)

On Sun, Feb 21, 2021, 5:02 PM Ender Ocean notifications@github.com wrote:

ArduSub Version: 3.5.4

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/patrickelectric/mavlink2rest/issues/33#issuecomment-782916730, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJIYCKMHUZSYECRWEA6IITTAFRE7ANCNFSM4X7HXROA .

enderocean commented 3 years ago

Problem solved. Thank @patrickelectric