I would like to write a C/C++ program to control a quadrotor but I’m not sure of which commands to use. Here’s some context: I am using a Pixhawk4 (and a Pixhawk 4 mini for an other drone but I guess it works the same way) on which I connected the GPS module and a telemetry module. Then on a computer, an other telemetry module is connected. For now, I am able to read and send MAVLink messages. My final goal would be to build a neural network to send decision order (go left,right,up,down,forward,backward, speed doesn’t matter) through MAVLink.
So my question is, which MAVLink commands is/are the most suited for this case ?
I found some that could be interesting but I am not sure how to make them work properly (the autopilot reject the commands, i suspect it’s a mode problem) : SET_POSITION_TARGET_LOCAL_NED, MANUAL_CONTROL, MAV_CMD_DO_REPOSITION (sent in a COMMEND_INT command), MAV_CMD_NAV_WAYPOINT ? Am I going to the right direction or is there better command ?
You might want to build on top of MAVSDK which provides an API that’s much more simple than having to deal with raw MAVLink. Just look at offboard examples, or goto.
I’m linking the examples from the v1.4 branch as they work against MAVSDK installed from release where you find a .deb to install.