NickL77 / RPLidar_Hector_SLAM

Hector SLAM without odometry data on ROS with the RPLidar A1
111 stars 49 forks source link

Multiple Machine Setup doesn't work #11

Closed ywiyogo closed 4 years ago

ywiyogo commented 4 years ago

Hi Nicholas, I tried your launch parameters setting in my raspberrypi+RPLidarA2. Also on my laptop and directly pluged the lidar, both setups work perfectly. Now, since I would like to visualize the RViz on my Ubuntu PC and run the sensor on RaspberryPi board, I did the ROS multiple machine setup just like described in this page: https://wiki.ros.org/ROS/Tutorials/MultipleMachines.

I started the roscore and roslaunch rplidar_ros rplidar.launch in my RaspberryPi board. I can see the laser scan data in my Ubuntu PC with rostopic echo scan. However, I cannot see the visualization on RViz. The console output of the hector_slam shows lookupTransform base_link to laser timed out. Could not transform laser scan into base_frame. This is the rqt_graph output of the failed SLAM:

rosgraph_err

If hector_slam works in one machine, I get this graph: rosgraph_1machine

Thus, somehow the node parameter setting <node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 0 0 0 base_link laser 100" /> is for the setup with two machines not suitable. Based on the tf documentation, the arguments mean frame_id is base_link, and child_frame_id is laser.