Mavlink message for offboard control

Hello everybody,

I would like your opinion regarding a project I am trying to achieve.
I have a drone equipped with a pixhawk and a raspberry Pi 3, the two are linked in order to create an autonomous flight mode. I generate mavlink messages from raspberry, the code is in C.

Let me explain, I would like to be able to fly the drone using Mavlink messages. I have already done some research and I came across the messages MAV_LOCAL_POSITION_NED and MAV_GLOBAL_POSITION_INT, but I would like to be able to give a relative displacement order which does not depend on the NED convention.
For example, I would like to be able to give the order to move the drone X meters to the right (of the drone) without taking care the NED orientation.

I could see that you could use MAVSDK except that my code is in C, and that MAVSDK is available in C ++. Do you have any alternatives for or ideas for making this movement?

Thank you for your help

You can look at this implementation at reference: https://github.com/Jaeyoung-Lim/mavros_controllers

Thanks for your link, but i can’t seem to figure out how you build your mavlink messages and which types of messages are used (i’m not comfortable with c ++).

I use mavros for that application. If you don’t want to use cpp, there are alot of different options such as mavsdk-python / mavsdk-java etc

You can look at https://auterion.com/getting-started-with-mavsdk-python/

Yes I saw that you could use mavros or MAVSDK, but precisely I would like to implement my code in C without going through an SDK or ROS. I use functions from this directory (https://github.com/PX4/Flow/tree/master/mavlink/include/mavlink/v1.0/common) when creating my message and going directly through a UDP link. I already use this method to program proximity sensor messages.
Here my problem is that I have trouble identifying the MAVlink messages (https://mavlink.io/en/messages/common.html) to use/build in order to be able to control the movement of a drone in the manner of set_velocity_body with MAVSDK (https://mavsdk.mavlink.io/develop/en/guide/offboard.html).

I don’t know if I’m clear but thanks for your help

I finally decide to use ATTITUDE message in order to control manually the drone movement : https://mavlink.io/en/messages/common.html#ATTITUDE
And I will use the C "library “:https://github.com/mavlink/c_library_v1/tree/master/common” to generate Mavlink messages from the raspberry.

Thank you for your help