MrXandbadas / rplidar_ros2

rplidar_ros2 rplidar ros2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RPLIDAR ROS2 Package

ROS2 node for RPLIDAR

Visit following Website for more details about RPLIDAR:

rplidar roswiki: http://wiki.ros.org/rplidar

rplidar HomePage: http://www.slamtec.com/en/Lidar

rplidar SDK: https://github.com/Slamtec/rplidar_sdk

rplidar Tutorial: https://github.com/robopeak/rplidar_ros/wiki

ubuntu

How to configuring your ROS 2 environment

Configuring your ROS 2 environment

How to Create a ROS2 workspace

Create a workspace

Compile & Install rplidar_ros2 package

  1. Clone rplidar_ros2 package from github into the src folder in your ROS 2 workspace:

    git clone -b ros2 https://github.com/MrXandbadas/rplidar_ros2.git
  2. Navigate to your workspace folder and Build rplidar_ros2 package :

    cd <your_own_ros2_ws>
    colcon build --symlink-install

    if you find output like "colcon:command not found",you need separate install colcon build tools.

  3. From your workspace folder Package environment setup :

    source ./install/setup.bash

    Note: Add permanent workspace environment variables. It's convenientif the ROS2 environment variables are automatically added to your bash session every time a new shell is launched:

    $echo "source <your_own_ros2_ws>/install/setup.bash" >> ~/.bashrc
    $source ~/.bashrc

RPLIDAR ROS package

ROS node and test application for RPLIDAR

Visit following Website for more details about RPLIDAR:

rplidar roswiki: http://wiki.ros.org/rplidar

rplidar HomePage: http://www.slamtec.com/en/Lidar

rplidar SDK: https://github.com/Slamtec/rplidar_sdk

rplidar Tutorial: https://github.com/robopeak/rplidar_ros/wiki

How to build rplidar ros package

1) Clone this project to your colcon workspace src folder
2) Install Eloquent ROS2 and colcon compiler.
source /opt/ros/eloquent/setup.sh
colcon build --symlink-install

How to run rplidar ros package

There're two ways to run rplidar ros package Note! Just test for RPLIDAR A1/A2,not test A3 and S1,need your test. I. Run rplidar node and view in the rviz

At first console,

source ./install/setup.bash
ros2 run rplidar_ros rplidarNode 

At second console,

source ./install/setup.bash
ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0  world laser_frame  

At third console,

source ./install/setup.bash
rviz2 ./install/rplidar_ros/share/rplidar_ros/rviz/rplidar.rviz

Note: In Rviz settings, set "Fixed Frame" to laser_frame

You should see rplidar's scan result in the rviz.

II. Run rplidar node and view using test application

source ./install/setup.bash
ros2 run rplidar_ros rplidarNodeClient 

You should see rplidar's scan result in the console

Notice: the different is serial_baudrate between A1/A2 and A3/S1

RPLidar frame

RPLidar frame must be broadcasted according to picture shown in rplidar-frame.png

About

rplidar_ros2 rplidar ros2

License:BSD 2-Clause "Simplified" License


Languages

Language:C++ 88.9%Language:C 8.3%Language:Python 1.9%Language:CMake 0.5%Language:Shell 0.4%