Change [velodyne] frame for gmapping
I have .pcap file collected from VLP16 and I first run
roslaunch velodyne_pointcloud VLP16_points.launch pcap:=/home/soowon/Documents/111.pcap
I can now see in RVIZ in fixed frame of [velodyne]
Then I use
rosrun pointcloud_to_laserscan pointcloud_to_laserscan_node cloud_in:=/velodyne_points
to convert to 2d laser scan.
and then record it as rosbag file.
But when I want to combine it with laser_scan_matcher and gmapping, the frame is always not correct.
I searched online and it seems that I should reset frame_id when doing the first step. But I don't know what to do in detail.
Does your robot model currently have a frame for velodyne and its just under a different name? If you aren't publishing a frame for the velodyne it simply won't work and I highly suggest publishing a velodyne frame before changing the name. http://wiki.ros.org/robot_state_publi...
@nxydes I'm not using a robot. Thats why I want to use laser_scan_matcher to get tf from /map to /base_link I dont know what should I do in this case. Can you tell me?
Try this then, publish a static transform from base_link to velodyne of all 0's. Will effectively make velodyne frame the same as base_link: rosrun tf static_transform_publisher 0 0 0 0 0 0 base_link velodyne
@nxydes Thanks, I will try
@nxydes It works, but the tf has some problem. It has two branches: 1) map->odom 2) map->base_link->velodyne Generally there should only be one line, right?
Seems that laser scan matcher is publishing map->base_link. You need to set its "world frame" to be odom so it publishes odom-> baselink. See 4.3.1: http://wiki.ros.org/laser_scan_matcher
@nxydes Oh, you are really helpful. If you want, you can write a formal answer and I will choose yours