I am using this code with little modifications for forwarding the odometry provided by a D435i + rtabmap to PX4 using the uxrce_dds. However, the estimation is not stable (QGC mainly declares velocity estimate error).
While trying to figure out the problem(s) with my setup, I noticed that some covariance values were negative, this should be due to a wrong covariance frame conversion.
Would you mind submitting a PR to fix? I also realized after the fact I should be using the static transform publisher rather than hard coding the rotation
Hi,
Problem description
I am using this code with little modifications for forwarding the odometry provided by a D435i + rtabmap to PX4 using the uxrce_dds. However, the estimation is not stable (QGC mainly declares velocity estimate error).
While trying to figure out the problem(s) with my setup, I noticed that some covariance values were negative, this should be due to a wrong covariance frame conversion.
Relevant code
position_variance = tf2::quatRotate(rotation, position_variance);
orientation_variance = tf2::quatRotate(rotation, orientation_variance);
velocity_variance = tf2::quatRotate(rotation, velocity_variance);
Solution
Refer also to mavros, odom.cpp for the transformation.
Thanks for making your code freely available. Best!