mavlink / mavros

MAVLink to ROS gateway with proxy for Ground Control Station
Other
902 stars 993 forks source link

Accessing body frame velocities #470

Closed scott-eddy closed 8 years ago

scott-eddy commented 8 years ago

Hi all, I am having trouble extracting the PX4 velocity estimate expressed in the body frame. First let me start off by saying that I'm aware of #438 and think that this is a different problem. So, looking at the local_position plugin we read in the FCU's estimate of velocity expressed in NED coordinates, as well as extract the vehicle's attitude WRT to the NED frame. We then transform the velocity to be with respect to the NWU frame (as discussed in #438). Additionally, the attitude quaternion is changed to represent the vehicle attitude WRT to the NWU frame.

So, if my custom node does the inverse transformation of the reported velocity with the reported quaternion I will get the vehicle's velocity estimate in the NED frame. Extrapolating further if I want the vehicle's velocity in the body frame I will need to rotate the quaternion to once again describe the vehicle's attitude WRT the NED frame and transform the NED veloicity with this new quaternion. Is that correct?

I don't think that having the vehicle's body frame velocity is specific to my use case and could be handled within MAVROS as a nav_msgs/Odometry publisher. This change would obviously require strict definitions for child and header frame ids, but I think it would be minimally impactful if a new frame called "body" was introduced. Then nav_msgs/Odometry could be pose of the vehicle in the ROS frame (again NWU according to #438 and ENU according to documentation) and the velocity of the vehicle in the body frame.

scott-eddy commented 8 years ago

Fixed in #473. Closing