ROS 2 official website:https://docs.ros.org/
ROS 2 Feature pack:https://github.com/ldrobotSensorTeam/ldlidar_stl_ros
ROS 2 Feature pack:https://gitee.com/ldrobotSensorTeam/ldlidar_stl_ros
Device : PC;LD 06(LD 19)
Environment : Ubuntu18.04;ROS2(eloquent)
New Workspace
mkdir -p my_ws/src
When the radar is used, it is necessary to enter the workspace each time the command is executed
xxxxxxxxxx
cd ~/my_ws
Decompress the [ldlidar_ros2. zip] function package and put it in the src folder of your workspace. Open the terminal in the workspace
xxxxxxxxxx
colcon build # compile
source install/setup.bash # Update the environment
Note: Every time a new terminal is opened, it needs to [update the environment]. Every time the code in the function pack is changed, it needs to [re-compile] and then update the environment.
To perform this step, run the installation USB port remapping command in the scripts folder of the ldlidar_stl_ros2 function package
xxxxxxxxxx
cd ~/my_ws/src/ldlidar_stl_ros2/scripts
sudo chmod 777 *
./create_udev_rules.sh
Use the following command to view the modified remapping
xxxxxxxxxx
ls -l /dev | grep ttyUSB
xxxxxxxxxx
ros2 launch ldlidar_stl_ros2 ld06.launch.py
You should see the radar scan results in rviz2
Note: the [Fixed Frame] coordinate system and [LaserScan] topics should be consistent with those published.
A key to start
xxxxxxxxxx
ros2 launch ldlidar_stl_ros2 ld06_gmapping.launch.py
You should see the result in rviz2
Note: [Fixed Frame] coordinate system, [LaserScan] topic, [map] topic should be the same as published.