ROS2 workspace for Agilex robots setup @ Innovlab
Required setup : Ubuntu 22.04 LTS
- Install
ros2
packages. The current development is based ofros2 humble
. Installation steps are described here. - Source your
ros2
environment:NOTE: The ros2 environment needs to be sources in every used terminal. If only one distribution of ros2 is used, it can be added to thesource /opt/ros/humble/setup.bash
~/.bashrc
file. - Install
colcon
and its extensions :sudo apt install python3-colcon-common-extensions
- Create a new ros2 workspace:
mkdir ~/ros2_ws/src
- Install libasio
$ sudo apt-get install libasio-dev
- Pull relevant packages, install dependencies, compile, and source the workspace by using:
cd ~/ros2_ws git clone https://github.com/maberobotics/ilab_agilex.git src/ilab_agilex rosdep install --ignore-src --from-paths . -y -r colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --symlink-install source install/setup.bash
- Setup CAN-To-USB adapter
-
Enable gs_usb kernel module(If you have already added this module, you do not need to add it)
$ sudo modprobe gs_usb
-
Bringup can device
$ sudo ip link set can0 up type can bitrate 500000
-
Testing command
# receiving data from can0 $ candump can0
- Launch ROS nodes
-
Start the base node for the Tracer robot
$ ros2 launch tracer_base tracer_base.launch.py
-
Then you can send command to the robot
$ ros2 topic pub /cmd_vel geometry_msgs/msg/Twist "linear: x: 0.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.0"
SAFETY PRECAUSION:
Always have your remote controller ready to take over the control whenever necessary.
To start lidar run
$ ros2 launch tracer_bringup open_rslidar.launch.py
Note: To get data from the lidar, the IP of the PC connected to the lidar needs to be 192.168.1.102
To start cartographer run
$ ros2 launch tracer_bringup cartographer.launch.py
The map can then be saved using
$ ros2 run nav2_map_server map_saver_cli -f map
To start navigation run
$ ros2 launch tracer_bringup navigation.launch.py