Please refer to the ROS 2 Support Policy for the recommended system configurations.

Build

Clone the project and run the following commands:

mkdir -p ~/lgdx_ws/src
cd ~/lgdx_ws/src
git clone https://gitlab.com/lgdxrobotics/lgdxrobot2-rplidar-c1.git -b $ROS_DISTRO
git clone https://gitlab.com/lgdxrobotics/lgdxrobot2-ros2.git -b $ROS_DISTRO
cd ..

# Install build dependencies
rosdep update
rosdep install --from-paths src --ignore-src -y

# Ensure that interfaces is in the system
colcon build --packages-select lgdxrobot2_msgs --symlink-install
source install/setup.bash

colcon build --symlink-install

Configuration

First, configure the permissions for the hardwares.

curl -L -s -o rplidar.rules https://gitlab.com/lgdxrobotics/release-strategy-front/-/raw/main/lgdxrobot2-udev/usr/lib/udev/rules.d/99-rplidar.rules
curl -L -s -o lgdxrobot2.rules https://gitlab.com/lgdxrobotics/release-strategy-front/-/raw/main/lgdxrobot2-udev/usr/lib/udev/rules.d/99-lgdxrobot2.rules
sudo mv rplidar.rules /etc/udev/rules.d
sudo mv lgdxrobot2.rules /etc/udev/rules.d
sudo service udev reload
sudo service udev restart

Then, source the setup files for the ROS 2 workspaces.

source ~/lgdx_ws/install/setup.bash