Why TF2 transform affects odometry accuracy but Tf transform does not
Good Day all,
I have a 3 wheel omni-wheel triangular robot with an RPlidar that I am trying to set up navigation. However, I am seeing a weird issue..... I recently changed my tf publisher which publishes my base to laser transform to a TF2 static publisher using "static_transform_publisher x y z yaw pitch roll frame_id child_frame_id" (because TF is depreciated).
BUT when I use the TF2 static publisher, my odometry is terrible ( here I use teleop, driving the robot straing forward for 1 meters in a corridor at .2m/s and observe very bad rotational drift).However if I use regular TF amd create a publisher as you see in my code below.. and drive the robot forward in the corridor for 1 meter at the same speed the odometery looks good showing only little rotational drift..
See here https://drive.google.com/folderview?i...
Any Idea why?
TF Publisher :
/////////////////////////////////////////////////////////
int main(int argc, char** argv){ ros::init(argc, argv, "robot_tf_publisher"); ros::NodeHandle n;
ros::Rate r(100);
tf::TransformBroadcaster broadcaster;
while(n.ok()){ broadcaster.sendTransform( tf::StampedTransform( tf::Transform(tf::Quaternion(0, 0, 1.57, 1.571), tf::Vector3(0.0, 0.025, 0.2)), ros::Time::now(),"base_link", "base_laser")); r.sleep(); }
TF2 Static Transform :
///////////////////////////////////////////////////////////////
node pkg="tf2_ros" type="static_transform_publisher" name="omnisTF" args="0 0.025 0.2 1.571 0 0 base_link base_laser"
Please edit your question to add enough details to be able to reproduce your problem. As well as what you're seeing and what you expect to see differently. Without more description it's impossible to much but guess what's your doing differently.
@ tfoote, Thanks. I edited my question to include additional details.
Can you show the difference in odometry? A gif of both cases maybe? You're only showing the inputs, and not the outputs that you talk about. Also I'll note that your first implementation the transform quaternion appears to be non-normalized which is potentially a problem.
@tfoote thanks again. Added images
The end result aggregated images are not very informative. Can you show the output of the coordinate frames in the visualization and an animation of them as you drive? Also it would be helpful to use
tf_echo
orview_frames
to see what you're actually publishing.Numerically the two broadcasters look equivalent to me. What's not the same is how often the messages are sent: 100 Hz vs once (ever). One of your ros nodes may have code that relies on being woken up every 10 milliseconds, and that is not happening after the change you made.