How can I set MAVROS setpoints in the body frame?

asked 2023-04-13 14:51:26 -0500

DuffRumkins gravatar image

I have recently been trying to build a vision-based controller for a drone. I have been testing this using the PX4 and MAVROS SITL setup with Gazebo.

Using a depth camera, I first detect the relative position of an object that I would like to fly towards in the body frame of the drone (the frame that moves and rotates with the drone). I would like to pass this as a setpoint to the flight controller, but when I try to do this using the topic /mavros/setpoint_position/local I have noticed that the frame used is actually the ENU fixed frame.

For my controller, I would like to be able to define position (or even better velocity) setpoints in the body frame (FRU) that moved with the drone.

I have spent quite a while browsing through different forums but have as of yet not been able to find anything that was able to tell me how to do this. I think it should be possible to change the MAV_FRAME parameter to a body frame in the configurations somewhere, but I was also unable to find out how to do this.

I am quite new to the PX4 autopilot and MAVLink/MAVROS so I would not be surprised at all if I am missing something obvious. Thanks for the help!

edit retag flag offensive close merge delete

Comments

Hey! Were you able to solve the issue?

farhan_haroon_ gravatar image farhan_haroon_  ( 2023-07-29 07:33:26 -0500 )edit