mavlink / mavlink2rest

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

MANUAL_CONTROL command not supported #24

Closed enderocean closed 4 years ago

enderocean commented 4 years ago

Hi, I try to control BlueROV2 by sending MANUAL_CONTROL messages in POST mode to: 0.0.0.0:8088/mavlink Message content is retrieved and adapted from helper

{
        "header": {
        "system_id": 1,
        "component_id":1,
        "sequence":0
        },
        "message": {
            "type":"MANUAL_CONTROL",
            "x":1000,
            "y":0,
            "z":0,
            "r":0,
            "buttons":0,
            "target":0
        }
}

mavlink2rest logout is two parenthesis as if everything was fine: () But command has no effect whatever the control mode I use. Any ideas what happens ? Thanks Note. Other commands in COMMAND_LONG are working well: ARM, DISARM, SET_MODE

patrickelectric commented 4 years ago

Are you sending this message periodically ? From ArduPilot documentation:

"When the autopilot is being commanded to move via RC_CHANNELS_RAW or MANUAL_CONTROL messages, the messages must be sent at a constant rate like the HEARTBEAT message. Otherwise, the autopilot will execute a failsafe if it has not received an updated command after a timeout period."

enderocean commented 4 years ago

I send a HEARTBEAT message every second. I will try to make MANUAL_CONTROL sent at a regular rate and let you know. Thx.

enderocean commented 4 years ago

I have set a program that send :

Normally, we are not in a "failsafe" case. But it does not work neither. The issue might be elsewhere. I will close this one as long as mavlink2rest does the job and is not the root cause. Thank you.

enderocean commented 4 years ago

I found the bug. Variable "system_id" must be set to 255 and "target" to 1 in MANUAL_CONTROL message.