How to publish transformation from map(world) to odom?
I am working on a particular autonomous robot car application. The robot car uses lidar to find some traffic cones. Since the cones' positions are known, the robot can localize itself by matching the detected cones with the cone's known coordinates. I have written my own particle filters for localization. Now I am trying to visualize the result (car true loaction) with rviz. Currently, my system publish odom, tf, but it does not publish a map message. I have a few questions here
- The results of particle filters are location of the car in the world coordinate. Since my system does not publish map, how can I display the car position in rviz?
- Currently, I am using odom as fixed frame in my rviz. I can see that the lidar data for the wall, cones are moving around slightly when the robot moves. This means my odom data is no exactly accurate. correct?
- How can I publish my own map message? If I publish my own map message, how can I publish the transformation between the map and odom?
Thanks,
I have my own mapping and localization algorithm. I just do not know how to publish a map frame in my algorithm and how to push the transformation between my map and odom.
you can write a launch file like <node pkg="tf" type="static_transform_publisher" name="xxx" args="0 0 0 0 0 1 map odom 100">
Thanks. This will publish the transformation between map and odom. However my system does not have a map frame. Is this command going to add a map frame also?
when you generate a map(I assume it's OGM), there is a info inside the message defining the pose of your map, that will give you the position of the origin of the map [m, m, rad], This is the real-world pose of the cell (0,0) in the map. I think that will give you map frame.
my bad, the info should be frame_id inside std_msgs/header
Thanks, do you have some information about how to publish a map frame from mapping/slam?
since your map and odom will be changing the proper way would be to use a transform broadcaster