How to use mavros plugins in px4 C code?

Hi All,
I need to get rostopics messages and use them in the C code in PX4.
How should I do? Use mavros/src/plugins?
How to use mavros plugins in C code?
Is there any example?

Thanks &Best Regards!

What information exactly are you trying to send to PX4? Can you be a bit more specific?

And, yes mavros can usually be used to convert something from the ROS world in the MAVLink world in order to get it to PX4.

1 Like

I want to get the pwm value of throttle and steering from the ROS world and then subscribe them in the form of the servo_output raw data in PX4 as follows.
int act_sub_fd = orb_subscribe(ORB_ID(actuator_outputs));
Is it ok? And how?

So to say it differently you want to “directly” control the servos attached to PX4.
For that I would suggest to look into offboard control: and actuator control:

1 Like

Yes, you are really helpful.

Thanks & Best Regards!

1 Like