https://github.com/ldrobotsensorteam/ldlidar_sl_ros
LDROBOT Triangle LiDAR ROS Package
https://github.com/ldrobotsensorteam/ldlidar_sl_ros
ld14 ros
Last synced: 9 months ago
JSON representation
LDROBOT Triangle LiDAR ROS Package
- Host: GitHub
- URL: https://github.com/ldrobotsensorteam/ldlidar_sl_ros
- Owner: ldrobotSensorTeam
- License: mit
- Created: 2022-03-11T02:50:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-10T09:29:12.000Z (over 3 years ago)
- Last Synced: 2025-01-30T20:40:47.937Z (over 1 year ago)
- Topics: ld14, ros
- Language: C++
- Homepage:
- Size: 159 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Instructions
> This SDK is only applicable to the LiDAR products sold by Shenzhen LDROBOT Co., LTD. The product models are :
> - LDROBOT LiDAR LD14
> - LDROBOT LiDAR LD14P
## step 0: get LiDAR ROS Package
```bash
cd ~
mkdir -p ldlidar_ros_ws/src
cd ldlidar_ros_ws/src
git clone https://github.com/ldrobotSensorTeam/ldlidar_sl_ros.git
```
## step 1: system setup
- Connect the LiDAR to your system motherboard via an onboard serial port or usB-to-serial module (for example, CP2102 module).
- Set the -x permission for the serial port device mounted by the radar in the system (for example, /dev/ttyUSB0)
- In actual use, the LiDAR can be set according to the actual mounted status of your system, you can use 'ls -l /dev' command to view.
``` bash
cd ~/ldlidar_ros_ws
sudo chmod 777 /dev/ttyUSB0
```
- Modify the `port_name` value in the Lanuch file corresponding to the radar product model under `launch/`, using `ld14.launch` as an example, as shown below.
``` xml
```
## step 2: build
- install package depend
```bash
cd ~/ldlidar_ros_ws
rosdep install --from-paths src --ignore-src -r -y
```
- build compile
```bash
cd ~/ldlidar_ros_ws
catkin_make
```
## step 3: run
### step3.1: package environment variable settings
- After the compilation is completed, you need to add the relevant files generated by the compilation to the environment variables, so that the ROS environment can recognize them. The execution command is as follows. This command is to temporarily add environment variables to the terminal, which means that if you reopen a new terminal, you also need to re-execute it. The following command.
```bash
cd ~/ldlidar_ros_ws
source devel/setup.bash
```
- In order to never need to execute the above command to add environment variables after reopening the terminal, you can do the following.
```bash
echo "source ~/ldlidar_ros_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
```
### step3.2: start LiDAR node
- The product is LDROBOT LiDAR LD14
- start ld14 lidar node:
``` bash
roslaunch ldlidar_sl_ros ld14.launch
```
- start ld14 lidar node and show on the Rviz:
``` bash
# if ROS_DISTRO in 'kinetic' or 'melodic'
roslaunch ldlidar_sl_ros viewer_ld14_kinetic_melodic.launch
# if ROS_DISTRO in 'noetic'
roslaunch ldlidar_sl_ros viewer_ld14_noetic.launch
```
- The product is LDROBOT LiDAR LD14P
- start ld14p lidar node:
``` bash
roslaunch ldlidar_sl_ros ld14p.launch
```
- start ld14p lidar node and show on the Rviz:
``` bash
# if ROS_DISTRO in 'kinetic' or 'melodic'
roslaunch ldlidar_sl_ros viewer_ld14p_kinetic_melodic.launch
# if ROS_DISTRO in 'noetic'
roslaunch ldlidar_sl_ros viewer_ld14p_noetic.launch
```
## step 4: test
> The code was tested under ubuntu16.04 ROS kinetic、ubuntu18.04 ROS melodic、ubuntu20.04 ROS noetic, using rviz visualization.
- new a terminal (Ctrl + Alt + T) and use Rviz tool,open the rviz config file below the rviz folder of the readme file directory
```bash
rviz
```