Skip to content

Commit

Permalink
[update] update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ldrobotsensor committed Apr 13, 2022
1 parent 78a67ac commit 875daff
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
46 changes: 36 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Parameter Description:
1.2. disable angle crop, example: {'enable_angle_crop_func': False}
2. Angle cropping interval setting:
- The distance and intensity data within the set angle range will be set to 0.
- angle >= 'angle_crop_min' and angle <= 'angle_crop_max' which is [angle_crop_min, angle_crop_max], unit is degress.
- angle >= 'angle_crop_min' and angle <= 'angle_crop_max' which is [angle_crop_min, angle_crop_max], unit is degress, angle belong to [0,360).
example:
{'angle_crop_min': 135.0}
{'angle_crop_max': 225.0}
Expand Down Expand Up @@ -95,10 +95,22 @@ $ cd ~/ldlidar_ros2_ws
$ colcon build
```
## 3. 运行方法
### 3.1. 设置功能包环境变量

- 编译完成后需要将编译生成的相关文件加入环境变量,便于 ROS 环境可以识别, 执行命令如下所示, 该命令是临时给终端加入环境变量,意味着您如果重新打开新的终端,也需要重新执行如下命令.

```bash
$ cd ~/ldlidar_ros2_ws
$ source install/setup.bash
```
- 为了重新打开终端后,永久不用执行上述添加环境变量的命令,可以进行如下操作.

```bash
$ echo "source ~/ldlidar_ros2_ws/install/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
```
### 3.2. 启动激光雷达节点

```bash
$ source install/setup.bash
```
- 产品型号为 LDROBOT LiDAR LD14

``` bash
Expand All @@ -122,7 +134,7 @@ $ rviz2
> This SDK is only applicable to the LiDAR products sold by Shenzhen LDROBOT Co., LTD. The product models are :
> - LDROBOT LiDAR LD14
## 0. get LiDAR ROS2 Package
## step 0: get LiDAR ROS2 Package
```bash
$ cd ~

Expand Down Expand Up @@ -176,7 +188,7 @@ Parameter Description:
1.2. disable angle crop, example: {'enable_angle_crop_func': False}
2. Angle cropping interval setting:
- The distance and intensity data within the set angle range will be set to 0.
- angle >= 'angle_crop_min' and angle <= 'angle_crop_max' which is [angle_crop_min, angle_crop_max], unit is degress.
- angle >= 'angle_crop_min' and angle <= 'angle_crop_max' which is [angle_crop_min, angle_crop_max], unit is degress, angle belong to [0,360).
example:
{'angle_crop_min': 135.0}
{'angle_crop_max': 225.0}
Expand Down Expand Up @@ -216,17 +228,31 @@ $ colcon build
```
## step 3: run

```bash
$ source install/setup.bash
```
### 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_ros2_ws
$ source install/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_ros2_ws/install/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
```
### step3.2: start LiDAR node

- The product is LDROBOT LiDAR LD14

``` bash
$ ros2 launch ldlidar_sl_ros2 ld14.launch.py
```


## step 3: test
## step 4: test

> The code supports ubuntu 20.04 ros2 foxy version and above, using rviz2 visualization.
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int main(int argc, char **argv) {
node->get_parameter("angle_crop_min", angle_crop_min);
node->get_parameter("angle_crop_max", angle_crop_max);

RCLCPP_INFO(node->get_logger(), " [ldrobot] SDK Pack Version is v2.1.4");
RCLCPP_INFO(node->get_logger(), " [ldrobot] SDK Pack Version is v2.1.5");
RCLCPP_INFO(node->get_logger(), " [ldrobot] <topic_name>: %s ,<port_name>: %s ,<frame_id>: %s",
topic_name.c_str(), port_name.c_str(), frame_id.c_str());

Expand Down

0 comments on commit 875daff

Please sign in to comment.