Skip to content

Latest commit

 

History

History
178 lines (124 loc) · 5.26 KB

README.md

File metadata and controls

178 lines (124 loc) · 5.26 KB

ROSbot XL ROS

ROS2 packages for ROSbot XL

ROS packages

rosbot_xl

Metapackage that contains dependencies to other repositories. It is also used to define whether simulation dependencies should be used.

rosbot_xl_bringup

Package that contains launch, which starts all base functionalities. Also configs for robot_localization and laser_filters are defined there.

rosbot_xl_description

URDF model used for both simulation and as a source of transforms on physical robot. It was written to be compatible with ROS Industrial and preconfigured for ROS2 control.

Available models:

Model Description
rosbot_xl Final configuration of rosbot_xl with ability to attach external hardware.
rosbot_xl_base Base of rosbot prepared to be included into preexisting configuration. Meant to be compatible with concept of ROS Industrial ability for manipulators to have interchangeable end effectors.

rosbot_xl_gazebo

Launch files for Ignition Gazebo working with ROS2 control.

rosbot_xl_controller

ROS2 hardware controller for ROSbot XL. Inputs and outputs data from ROS2 control and forwards it via ROS topic to be read by microros.

ROS API

Available in ROS_API.md

Usage on hardware

To run the software on real ROSbot XL, also communication with Digital Board will be necessary. First update your firmware to make sure that you use the latest version, then run the micro-ROS agent. For detailed instructions refer to the rosbot_xl_firmware repository.

Prepare environment

  1. Install colcon, vsc and rosdep
sudo apt-get update
sudo apt-get install -y python3-colcon-common-extensions python3-vcstool python3-rosdep
  1. 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. Building
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

rosdep init
rosdep update --rosdistro $ROS_DISTRO
rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
colcon build

Note

Before starting the software on the robot please make sure that you're using the latest firmware and run the micro-ROS agent as described in the Usage on hardware step.

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

Build and run Gazebo simulation

  1. Building
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

rosdep init
rosdep update --rosdistro $ROS_DISTRO
rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
colcon build
  1. Running
source install/setup.bash
ros2 launch rosbot_xl_gazebo simulation.launch.py

Testing package

pre-commit

pre-commit configuration prepares plenty of tests helping for developing and contributing. Usage:

# install pre-commit
pip install pre-commit

# initialize pre-commit workspace
pre-commit install

# manually run tests
pre-commit run -a

# update revision
pre-commit autoupdate

After initialization pre-commit configuration will applied on every commit.

Industrial CI

colcon test

Note

Command colcon test does not build the code. Remember to build your code after changes.

If tests finish with errors print logs:

colcon test-result --verbose

Format python code with Black

cd src/
black rosbot*

Testing package

Industrial CI

colcon test

Note

Command colcon test does not build the code. Remember to build your code after changes.

If tests finish with errors print logs:

colcon test-result --verbose

Format python code with Black

cd src/
black rosbot*

Demos

For further usage examples check out our other repositories: