Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ldrobotsensorteam/ldlidar_ros

LDROBOT LiDAR ROS Package(NEW)
https://github.com/ldrobotsensorteam/ldlidar_ros

ld06 ld14 ld14p ld19 ldrobot ros

Last synced: 25 days ago
JSON representation

LDROBOT LiDAR ROS Package(NEW)

Awesome Lists containing this project

README

        

# Instructions

## 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_ros.git

git submodule update --init --recursive
```
## 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_ros ld14.launch
```
- start ld14 lidar node and show on the Rviz:
``` bash
# if ROS_DISTRO in 'kinetic' or 'melodic'
roslaunch ldlidar_ros viewer_ld14_kinetic_melodic.launch
# if ROS_DISTRO in 'noetic'
roslaunch ldlidar_ros viewer_ld14_noetic.launch
```
- The product is LDROBOT LiDAR LD14P
- start ld14p lidar node:
``` bash
roslaunch ldlidar_ros ld14p.launch
```
- start ld14p lidar node and show on the Rviz:
``` bash
# if ROS_DISTRO in 'kinetic' or 'melodic'
roslaunch ldlidar_ros viewer_ld14p_kinetic_melodic.launch
# if ROS_DISTRO in 'noetic'
roslaunch ldlidar_ros viewer_ld14p_noetic.launch
```

- The product is LDROBOT LiDAR LD06
- start ld06 lidar node:
``` bash
roslaunch ldlidar_ros ld06.launch
```
- start ld06 lidar node and show on the Rviz:
``` bash
# if ROS_DISTRO in 'kinetic' or 'melodic'
roslaunch ldlidar_ros viewer_ld06_kinetic_melodic.launch
# if ROS_DISTRO in 'noetic'
roslaunch ldlidar_ros viewer_ld06_noetic.launch
```

- The product is LDROBOT LiDAR LD19
- start ld19 lidar node:
``` bash
roslaunch ldlidar_ros ld19.launch
```
- start ld19 lidar node and show on the Rviz:
``` bash
# if ROS_DISTRO in 'kinetic' or 'melodic'
roslaunch ldlidar_ros viewer_ld19_kinetic_melodic.launch
# if ROS_DISTRO in 'noetic'
roslaunch ldlidar_ros viewer_ld19_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
```