0
$\begingroup$

Rosanswers logo

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 !


Originally posted by magiccjae on ROS Answers with karma: 13 on 2017-05-10

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

  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/blob/master/mavros/src/plugins/setpoint_velocity.cpp which spells this transform out explicitly


Originally posted by eric1221bday with karma: 245 on 2017-06-21

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by magiccjae on 2017-06-30:
'''/setpoint_velocity/cmd_vel''' doesn't hold its altitude by my experience. Thanks for the comment !

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.