# How does MAV_FRAME_LOCAL_NED work?

Background

I am trying to use OFFBOARD control mode using px4 firmware and haven't decided if I want to publish my command to /setpoint_velocity/cmd_vel topic or /setpoint_position/local topic. I would like to develop a system so that I can command my quadrotor to move forward, backward, and yaw rate while quadrotor is holding its altitude.

Question

1. How exactly MAV_FRAME_LOCAL_NED work? Where is the origin of this frame?

2. When I command /setpoint_velocity/cmd_vel, if I give 0 to its linear.z value, would it be enough for the quadrotor to hold its altitude?

3. When I command /setpoint_velocity/cmd_vel, linear.x, linear.y, and linear.z commands are aligned with the quadrotor body frame or LOCAL_NED frame? (I think the latter is the answer, but I just want to make sure).

Thank you in advance for any help !

edit retag close merge delete

Sort by » oldest newest most voted
1. MAV_FRAME_LOCAL_NED is what the PX4 internally uses for all of its local coordinate frame calculations, this is in contrast to the ENU coordinate frame that is ROS standard. thankfully, the newer versions of MAVROS actually handles the coordinate frame conversion for you so if you are using MAVROS to send MAVLINK messages your coordinate frame should be based on the ROS ENU coordinate frame. The origin of the NED and ENU frame should be the same, where your quad booted up, or where your position estimation system launched. the difference lies in their directionality. For example in NED your altitude is actually -Z, whereas in ENU it is +Z

2. /setpoint_velocity/cmd_vel should have the quad attempt to hold altitude, if you set linear.z to 0 yes

3. I believe the aligned frame is actually the ROS ENU frame as stated above, MAVROS does a coordinate transform for you when you enter your commands to transform it into the NED frame that PX4 wants. If you want you can check out the MAVROS source code: https://github.com/mavlink/mavros/blo... which spells this transform out explicitly

more

'''/setpoint_velocity/cmd_vel''' doesn't hold its altitude by my experience. Thanks for the comment !

( 2017-06-30 16:00:01 -0600 )edit