Hello Blue Robotics, I am Having troubles picking out MAV commands from the MAV2REST endpoint sent from cockpit from a connected joystick. I connected a joystick and mapped some buttons to send Mav Commands using one of the mapping template format. My goal is when I trigger this functions I should recieve them or be able to read them from/through a local running app/script(python script running on the RPI). I have tried using the MAV2REST but after connecting I get a bunch of data and I am not sure which one to look out for that is related to mav commands sent from cockpit or is there a totally different or better way of recieving/interpreting mav commands from cockpit asides the mav2rest?.
For MAV commands, focus on message types like COMMAND_LONG or COMMAND_INT. The MAV2REST output includes general messages; use pymavlink to filter and parse specific commands. If MAV2REST isn’t detailed enough, a direct MAVLink connection might be better.
Thanks @abuislam and @patrickelectric for the Reply, But my main goal is to get joystick data from cockpit I am not interested in sending or injecting data back to cockpit, I understand that Cockpit send a MANUAL_CONTROL mav message to the vechile and this conatins joystick data however when I look and check for this MANUAL_CONTROL I don’t see it.
The MANUAL_CONTROL messages should start appearing under vehicle ID 255 once you activate it on Cockpit. To activate it you need to use the controller (move a joystick or click a button when on Cockpit’s tab).
As @patrickelectric mentioned above, the “watcher” function on mavlink2Rest (this service page) is not working for things other than vehicles (in this case Cockpit, which is a gcs), but that should be no problem for you guys.
The MANUAL_CONTROL messages are working perfectly in this case and you guys can consume from it normally. It’s just the “watcher” functionality (that is only used on this frontend) that is not working. If you poll the MANUAL_CONTROL endpoint, it will show you the changes in the joystick.
Forgive the next potentially daft question, what would the MANUAL_CONTROL end point config look like? I’m for details that I would use to populate the image below.