Skip to content

husarion/rosbot_ros

Repository files navigation

Rosbot ROS

ROS 2 packages for Husarion ROSbot series.

ROSbot

πŸ“š ROS API

Documentation is available in ROS_API.md.

πŸš€ Quick Start

βš™οΈ Prerequisites

  1. Install all necessary tools:

    sudo apt-get update
    sudo apt-get install -y python3-pip ros-dev-tools stm32flash
  2. Create a workspace folder and clone the rosbot_ros repository:

    mkdir -p ros2_ws
    cd ros2_ws
    git clone -b jazzy https://github.com/husarion/rosbot_ros src/rosbot_ros

πŸ€– Hardware

Building

export HUSARION_ROS_BUILD_TYPE=hardware

source /opt/ros/$ROS_DISTRO/setup.bash

vcs import src < src/rosbot_ros/rosbot/rosbot_hardware.repos
cp -r src/ros2_controllers/diff_drive_controller src/
cp -r src/ros2_controllers/imu_sensor_broadcaster src/
rm -rf src/ros2_controllers
rm -r src/rosbot_ros/rosbot_gazebo

sudo rosdep init
rosdep update --rosdistro $ROS_DISTRO
rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
colcon build --symlink-install --packages-up-to rosbot --cmake-args -DCMAKE_BUILD_TYPE=Release

Run the Robot

  1. Flash the firmware:

    sudo su
    source install/setup.bash
    ros2 run rosbot_utils flash_firmware
    exit

Note

To run the software on real ROSbots, communication with the CORE2 is required. Ensure the firmware is updated before running the micro-ROS agent. For detailed instructions, refer to the rosbot_ros2_firmware repository.

  1. Launch the robot:

    source install/setup.bash
    ros2 launch rosbot_bringup bringup.launch.py

πŸ–₯️ Simulation

Building

export HUSARION_ROS_BUILD_TYPE=simulation

source /opt/ros/$ROS_DISTRO/setup.bash

vcs import src < src/rosbot_ros/rosbot/rosbot_simulation.repos
cp -r src/ros2_controllers/diff_drive_controller src/
cp -r src/ros2_controllers/imu_sensor_broadcaster src/
rm -rf src/ros2_controllers

sudo rosdep init
rosdep update --rosdistro $ROS_DISTRO
rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
colcon build --symlink-install --packages-up-to rosbot --cmake-args -DCMAKE_BUILD_TYPE=Release

Run the Simulation

source install/setup.bash
ros2 launch rosbot_gazebo simulation.launch.py

Launch Arguments

Symbol Meaning
πŸ€– Available for physical robot
πŸ–₯️ Available in simulation
πŸ€– πŸ–₯️ Argument Description
Type: Default
βœ… βœ… namespace Namespace for all topics and tfs.
string: env(ROBOT_NAMESPACE)
βœ… ❌ mecanum Whether to use mecanum drive controller (otherwise diff drive controller is used).
bool: False
βœ… ❌ microros Automatically connect with hardware using microros.
bool: True
βœ… ❌ serial_baudrate Baud rate for serial communication .
string: 576000
βœ… ❌ serial_port Automatically connect with hardware using microros.
string: /dev/ttySERIAL
βœ… ❌ fastrtps_profiles Path to the Fast RTPS default profiles file for Micro-ROS agent for localhost only setup.
string: microros_localhost_only.xml
❌ βœ… gz_gui Run simulation with specific GUI layout.
string: teleop.config
❌ βœ… gz_headless_mode Run the simulation in headless mode. Useful when a GUI is not needed or to reduce the number of calculations.
bool: False
❌ βœ… gz_log_level Adjust the level of console output.
int: 1 (choices: 0, 1, 2, 3, 4)
❌ βœ… gz_world Absolute path to SDF world file.
string: husarion_world.sdf
❌ βœ… robots Spawning multiple robots at positions with yaw orientations e.g.robots:='robot1={x: 0.0, y: -1.0}; robot2={x: 1.0, y: -1.0};'
string: ''
❌ βœ… x Initial robot position in the global 'x' axis.
float: 0.0
❌ βœ… y Initial robot position in the global 'y' axis.
float: 2.0
❌ βœ… z Initial robot position in the global 'z' axis.
float: 0.0
❌ βœ… roll Initial robot 'roll' orientation.
float: 0.0
❌ βœ… pitch Initial robot 'pitch' orientation.
float: 0.0
❌ βœ… yaw Initial robot 'yaw' orientation.
float: 0.0

Tip

To read the arguments for individual packages, add the -s flag to the ros2 launch command (e.g. ros2 launch rosbot_bringup bringup.launch.py ​​-s)

πŸ•ΉοΈ Demo

Explore demos showcasing the capabilities of ROSbots:

πŸ“Ž Link πŸ“– Description
rosbot-telepresence Stream live video from Orbbec Astra to a PC and control the robot using teleop-twist-keyboard
rosbot-autonomy Enables simultaneous mapping and navigation, allowing the robot to move in unknown environments.