Skip to content

husarion/rosbot_xl_ros

ROSbot XL ROS

ROS2 packages for ROSbot XL

ROS API

You can find ROS API and detailed package description in ROS_API.md.

Prepare environment

  1. Install ros-dev-tools and stm32flash (stm32flash is not in the ros index and should be installed manually).

    sudo apt-get update
    sudo apt-get install -y ros-dev-tools stm32flash
  2. Create workspace folder and clone rosbot_xl_ros repository.

    mkdir -p ros2_ws/src
    cd ros2_ws
    git clone https://github.com/husarion/rosbot_xl_ros src/

Build and run on hardware

  1. Build the package

    export HUSARION_ROS_BUILD=hardware
    
    source /opt/ros/$ROS_DISTRO/setup.bash
    
    vcs import src < src/rosbot_xl/rosbot_xl_hardware.repos
    
    rm -r src/rosbot_xl_gazebo
    
    # Copy only diff_drive_controller and imu_sensor_broadcaster, waits for features from ros2-control
    cp -r src/ros2_controllers/diff_drive_controller src/
    cp -r src/ros2_controllers/imu_sensor_broadcaster src/
    rm -rf src/ros2_controllers
    
    rosdep init
    rosdep update --rosdistro $ROS_DISTRO
    rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
    colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
  2. Running

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

Important

Whenever the software version is changed, it is recommended to update the firmware version to ensure that the package version is compatible with the firmware version.

sudo su # Get admin permissions to flash firmware
source install/setup.bash
ros2 run rosbot_xl_utils flash_firmware
exit

Build and run Gazebo simulation

  1. Build the package

    export HUSARION_ROS_BUILD=simulation
    
    source /opt/ros/$ROS_DISTRO/setup.bash
    
    vcs import src < src/rosbot_xl/rosbot_xl_hardware.repos
    vcs import src < src/rosbot_xl/rosbot_xl_simulation.repos
    
    # Copy only diff_drive_controller and imu_sensor_broadcaster, waits for features from ros2-control
    cp -r src/ros2_controllers/diff_drive_controller src/
    cp -r src/ros2_controllers/imu_sensor_broadcaster src/
    rm -rf src/ros2_controllers
    
    rosdep init
    rosdep update --rosdistro $ROS_DISTRO
    rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
    colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
  2. Running

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

Demos

For further usage examples check out our other repositories: