This project contains the launchers to run the Turtlebot2 Kobuki, both in simulated running different Gazebo worlds, as in the real robot using its drivers.
You need to have previously installed ROS2. Please follow this guide if you don't have it.
source /opt/ros/humble/setup.bash
Clone the repository to your workspace:
cd <ros2-workspace>/src
git clone https://github.com/IntelligentRoboticsLabs/kobuki.git
Prepare your thirparty repos:
sudo apt update
sudo apt install python3-vcstool python3-pip python3-rosdep python3-colcon-common-extensions -y
cd <ros2-workspace>/src/
vcs import < kobuki/thirdparty.repos
Please make sure that this last command has not failed. If this happens, run it again.
sudo apt install libusb-1.0-0-dev libftdi1-dev libuvc-dev
When you connect a piece of hardware to your pc, it assigns /dev/ttyUSB*
to it. This will not have the necessary read/write permissions, so we will not be able to use it correctly. The solution is to set up some udev rules that creates a symlink with another name (example: /dev/ttyUSB0
-> /dev/kobuki
) and grants it the necessary permissions.
cd <ros2-workspace>
sudo cp src/ThirdParty/ros_astra_camera/astra_camera/scripts/56-orbbec-usb.rules /etc/udev/rules.d/
sudo cp src/ThirdParty/rplidar_ros/scripts/rplidar.rules /etc/udev/rules.d/
sudo cp src/ThirdParty/kobuki_ros/60-kobuki.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger
Some cameras need a calibration file where they indicate, for example, their resolution, name, etc...
mkdir -p ~/.ros/camera_info
cp <ros2-workspace>/src/ThirdParty/openni2_camera/openni2_camera/rgb_PS1080_PrimeSense.yaml ~/.ros/camera_info
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install
If your terminal has crashed or closed while compiling, please try compiling your packages as follows
colcon build --symlink-install --parallel-workers 1
or do so by selecting the package that failedcolcon build --symlink-install --parallel-workers 1 --packages-select <package>
Also, if you want to prevent it from recompiling that package, add a
COLCON_IGNORE
inside the package
source /usr/share/gazebo/setup.bash
source <ros2-workspace>/install/setup.bash
It is recommended to add these two lines inside your .bashrc
to avoid having to run it every time you open a new shell
You can launch the simulator as follows:
ros2 launch kobuki simulation.launch.py
Or you can add the path of your world to the world parameter like this:
ros2 launch kobuki simulation.launch.py world:=install/aws_robomaker_small_warehouse_world/share/aws_robomaker_small_warehouse_world/worlds/small_warehouse/small_warehouse.world
If you have a low performance, close the Gazebo's client. Check gzclient process, and kill it:
kill -9 `pgrep -f gzclient`
Run the kobuki drivers:
ros2 launch kobuki kobuki.launch.py
If you want to use a lidar or camera, you have to set the following parameters to True:
ros2 launch kobuki kobuki.launch.py lidar:=True
ros2 launch kobuki kobuki.launch.py lidar_s2:=True
ros2 launch kobuki kobuki.launch.py xtion:=True
ros2 launch kobuki kobuki.launch.py astra:=True
You can use Nav2 using robot with this launcher:
ros2 launch kobuki navigation.launch.py map:=<path-to-map>
or this other command if you need to navigate in the simulator
ros2 launch kobuki navigation_sim.launch.py
If you want to use another map, you have to put the route in the map parameter
This is a project made by the Intelligent Robotics Lab, a research group from the Universidad Rey Juan Carlos. Copyright © 2024.
Maintainers: