Skip to content

About

robotics-autonomy is a collection of ready-to-install modules for autonomous ROS 2 robots, together with an installer that assembles the modules you choose into a working colcon workspace.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

42 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

robotics-autonomy

robotics-autonomy is a collection of ready-to-install modules for autonomous ROS 2 robots, with an installer that assembles the modules you choose into a working workspace.

How it works

catalog/  ──►  install robot <robot>  ──►  workspace            ──►  launch robot <robot>
modules        installs and builds         sources and build        starts the robot
               the robot's modules

install and launch are commands of the robotics_autonomy_manager.

  • The modules are kept in a catalog: robots, reusable parts and shared parameters.
  • You name a robot. The installer brings in the modules that robot needs and builds them.
  • Then you start the robot, real or in a simulated world.
  • New robots and parts are added to the catalog as new modules.

Supported robots

The list grows with the catalog. robotics_autonomy_manager list shows your checkout.

Robots

Robot What it is Simulated world Runs on
loopback_sim robot that exists only in simulation
(Nav2, Nav2 loopback simulator)
built in robot or computer
ugv_rover Waveshare UGV Rover
(Nav2, SLAM, LiDAR, laser odometry)
N/A robot
ugv_rover sim:=true the UGV Rover in a simulated world ugv_rover_gz robot or computer
ugv_rover_gz Gazebo world of the UGV Rover ✓ computer
b3rb_cp NXP MR-B3RB with CogniPilot
(Nav2, SLAM)
N/A N/A
b3rb_cp sim:=true the MR-B3RB in a simulated world b3rb_cp_gz robot or computer
b3rb_cp_gz Gazebo world of the MR-B3RB ✓ computer

Simulated world: N/A = the real robot, a name = needs that world, ✓ = is a simulated world, built in = brings its own simulator.

Simulated worlds

Simulated world For robot What it simulates Simulator Runs on
ugv_rover_gz ugv_rover world, robot body, LiDAR, wheels Gazebo computer
b3rb_cp_gz b3rb_cp world, robot body, LiDAR, wheels (no autopilot) Gazebo computer

Environments

An environment is a place the simulated robots run in: a component that holds the world (for Gazebo) and the map (for Nav2) of the same place.

Environment Used by As
env_maze_5x5 loopback_sim map (the default)
ugv_rover_gz world (the default)
b3rb_cp_gz world, with the arguments below

b3rb_cp_gz runs in the CogniPilot world basic_map by default. To run it in the maze, give the world as a path without .sdf and its name in Gazebo:

scripts/robotics_autonomy_manager launch robot b3rb_cp_gz world:=$PWD/catalog/components/env_maze_5x5/worlds/maze_5x5 world_name:=maze_5x5 x:=-2 y:=0

The start x and y must be free space in the world. loopback_sim takes another map with map:=<yaml file>.

Supported platforms

Device Supported Used for
robot NavQ95 (NXP i.MX 95), Ubuntu 24.04 the robot and its nodes
computer a PC with Ubuntu 24.04 simulated worlds, RViz

Quick start

The commands are the same for every robot. Check the prerequisites first. The examples name robots of Supported robots.

Get the repository

On every device that installs a robot:

git clone <repository url> ~/robotics_autonomy_ws
cd ~/robotics_autonomy_ws

A device that cannot reach the repository gets a copy from one that can:

scp -r ~/robotics_autonomy_ws <user>@<device>:

Install and start a robot

# What can be installed
scripts/robotics_autonomy_manager list

# Install a robot and everything it requires
scripts/robotics_autonomy_manager install robot <robot>     # e.g. ugv_rover

# Start it
scripts/robotics_autonomy_manager launch robot <robot>      # e.g. ugv_rover

More:

  • launch arguments follow as name:=value, e.g. sim:=true
  • all commands and options: robotics_autonomy_manager -h
  • the version: robotics_autonomy_manager -V

Run a robot in simulation

With sim:=true the robot runs in a simulated world, which provides its sensors, motors and surroundings:

  • it is a module of its own, installed and started like a robot
  • it runs on a computer, or on the robot itself
  • start it first
# On a computer: the simulated world
scripts/robotics_autonomy_manager install robot <simulated world>   # e.g. ugv_rover_gz
scripts/robotics_autonomy_manager launch robot <simulated world>

# On a robot: the robot, simulated
scripts/robotics_autonomy_manager install robot <robot>             # e.g. ugv_rover
scripts/robotics_autonomy_manager launch robot <robot> sim:=true

A robot with a built-in simulator needs no simulated world. Which world belongs to which robot: Supported robots.

View and command the robot with RViz

RViz is the window to every robot:

  • What: shows the map, costmaps, scan, planned path and robot model; sends start poses and goals.
  • File: one view serves every navigation robot, kept in the navigation config: catalog/configs/navigation/tool/rviz/navigation.rviz.
  • Where: any device on the same network, usually a computer, with the same middleware and ROS_DOMAIN_ID as the robot.
  • Needs: ROS 2 Jazzy with rviz2 and the file above.
sudo apt install ros-jazzy-rviz2
source /opt/ros/jazzy/setup.bash
rviz2 -d ~/robotics_autonomy_ws/catalog/configs/navigation/tool/rviz/navigation.rviz
  • Robot model: optional. RViz draws it only when the robot or its simulated world is installed on the same device; then source ~/robotics_autonomy_ws/install/setup.bash instead. Without it, only the robot model is missing.

Hardware setup

Only for robots that run real, on their hardware.

ugv_rover

The Waveshare UGV Rover kit comes with its own compute board. Here the NavQ95 takes its place: it runs the robot and talks to the ESP32 driver board of the chassis, which drives the motors.

  • Compute board: NavQ95, used instead of the compute board of the kit
  • ESP32 firmware: the stock Waveshare firmware, as delivered; no flashing needed

Connect the NavQ95 to the robot through a USB hub:

From To Cable Port on the NavQ95
NavQ95 J12 USB hub USB
USB hub USB to TTL adapter → LD19 LiDAR USB /dev/ttyACM0
USB hub ESP32 driver board USB /dev/ttyUSB0
┌───────────────┐     ┌─────────┐     ┌──────────────────────────────────────────┐
│ NavQ95        │     │ USB hub │     │ Waveshare UGV Rover                      │
│ Compute Board │     │         │     │                                          │
│               │     │         │USB  │    ┌────────────┐       ┌──────────────┐ │
│ /dev/ttyACM0  │     │         │◄────┼───►│ USB to TTL │◄─────►│ LD19 LiDAR   │ │
│               │USB  │         │     │    └────────────┘       └──────────────┘ │
│           J12 │◄───►│         │     │                                          │
│               │     │         │USB  │    ┌────────────────────┐    ┌─────────┐ │
│ /dev/ttyUSB0  │     │         │◄────┼───►│ ESP32 driver board │◄──►│ motors  │ │
│               │     │         │     │    └─────────▲──────────┘    └─────────┘ │
│               │     │         │     │              ╳ not used                  │
│               │     │         │     │    ┌─────────▼───────────────┐           │
│               │     │         │     │    │ UGV Rover Compute Board │           │
│               │     │         │     │    └─────────────────────────┘           │
└───────────────┘     └─────────┘     └──────────────────────────────────────────┘
  • Turn on the main power switch of the chassis: without it the ESP32 answers but the motors do not move.
  • Check that both ports exist:
ls /dev/ttyUSB0 /dev/ttyACM0
  • If the NavQ95 names the ports differently:
    • for every start: set them in the ports section of catalog/robots/ugv_rover/launch/navigation_config_robot.yaml and install again
    • for one start: add ugv_port:=/dev/ttyXXX lidar_port:=/dev/ttyYYY to the launch command

Add a new robot

Add a robot that is not in the catalog yet:

  • create a new module from a template
  • edit its files: the description, the parameters and a launch file with its nodes
  • install it like any other robot; the rest comes from the modules it requires
# 1  Create the module; <domain> is for example navigation
scripts/robotics_autonomy_manager new robot <robot> <domain>

# 2  Edit what the command lists, in catalog/robots/<robot>/:
#    recipe.yaml, the parameters, the description and the launch file

# 3  Install and start it like any other robot
scripts/robotics_autonomy_manager install robot <robot>

A component and a domain config are created the same way:

scripts/robotics_autonomy_manager new component <name> <source_type>   # apt, git or local
scripts/robotics_autonomy_manager new config <domain>

Prerequisites

  • Ubuntu 24.04 with ROS 2 Jazzy installed (ros-base is enough). Only Jazzy is supported.
  • git, colcon, rosdep and apt, and sudo unless you are root
  • Supported middleware: rmw_fastrtps_cpp (Fast DDS)
  • Free disk space: enough for the apt packages and the workspace of a robot. A full disk stops the install halfway; see Known issues.
  • rosdep initialized, once per device (the installer checks this and prints the commands):
sudo rosdep init
rosdep update

Documentation

  • NXP Robotics SDK documentation, section Autonomy: overview, concepts, getting started, how to add a robot
  • Concepts and Details, below: terms, repository and workspace, catalog layout, recipe fields, examples, patches and hooks, naming
  • robotics_autonomy_manager -h: all commands and options

Concepts

Catalog

  • The folder catalog/ of this repository.
  • It describes everything the installer can install, as modules.
  • It only describes: nothing is built or installed until you ask for a robot or a component.

Module

One folder of the catalog, one installable thing. Its recipe, recipe.yaml, says where the content comes from and which modules it requires. Three types:

  • config: the parameters shared by all robots of a domain
  • component: a reusable part, e.g. a planner, a sensor driver or an odometry node
  • robot: everything specific to one robot: description, parameters, drivers, launch files. It names the configs and components it requires. A simulated world is a robot module too.

Sources

Where a module takes its content from:

  • apt: a ROS package of the ROS apt repository of the system
  • git: a ROS package of a git repository, fixed to one commit, patched if needed
  • local: files kept in the folder of the module

Domain

A field of autonomy, e.g. navigation.

  • Its config module holds the parameters all robots of the domain share.
  • It holds nothing a robot may choose differently, and it has no requires.
  • A robot lists the configs of its domains and every component it uses (controller, planner, sensor driver), so its recipe shows all it installs.
  • A robot overrides what is specific to it.

Real and simulated

A robot is installed once and runs real or simulated. Its launch file has the argument sim:

  • sim:=false (default): the hardware nodes start (sensor drivers, motor driver).
  • sim:=true: they are left out; every node follows the simulation clock (use_sim_time).

In simulation, something takes the place of the real sensors, motors and surroundings: it produces the sensor data and the clock, and takes the commands. Two kinds:

  • Built-in simulator: the robot starts it itself, on its own device. The robot exists only in simulation.
  • Simulated world: a robot module of its own, named _. It holds the world, the robot body, sensors, actuators and, if any, the firmware of the robot. It talks to the robot over ROS 2 topics, on the same or another device, with the same middleware and ROS_DOMAIN_ID.

An environment is a component of its own, named env_<place>_<size>. It holds the world of a place (for Gazebo) and its map (for Nav2) together, so that both describe the same place, and every robot or simulated world that needs the place lists it in its requires. env_maze_5x5 is used by ugv_rover_gz (the world) and by loopback_sim (the map).

Why a separate module:

  • Each device installs only its side: the robot does not install the simulator, the simulator device does not install the drivers of the real robot.
  • The simulator is a choice of the world, not of the robot: one robot can have worlds of different simulators, each a module of its own.

Workspace

This repository after you cloned it (or copied a clone). The installer builds in it; its structure is in Details.


Details

Repository and workspace

The workspace is this repository after you cloned it (or copied a clone). Part of it is kept in the repository, the rest is generated by the installer:

robotics_autonomy_ws/
├── catalog/        the modules
├── scripts/        the manager
├── README.md, LICENSE
│
├── src/            generated: the sources colcon builds, one folder per module
├── build/          generated: colcon intermediate files
├── install/        generated: the result; install/setup.bash makes it usable
└── log/            generated: colcon build logs

The installer fills src/ with the modules the chosen robot requires: local files are copied and third-party repositories are fetched at their pinned commit with the patches applied. Git ignores the generated folders, and a fresh clone does not have them.

Treat src/ as a copy and do not edit it. The installer stops when it finds local changes (the option -f discards them), and a new run writes the sources again. A change belongs in the catalog: a file of a module, or a patch of a git source.

Layout

catalog/
├── configs/                     one module per domain
├── components/                  one module per reusable part
└── robots/                      one module per robot

A folder that starts with an underscore (template*) is a template, not a module: it is not listed and cannot be installed. The new command creates a module from it: it copies the template, replaces the names inside the files and in the file names, and prepares the files for you to edit.

Inside a module:

<module>/
├── recipe.yaml                   what to install and what the module requires
├── patches/NNNN-<topic>.patch    patches for a git source, applied in name order
├── hooks/<script>.sh             a script for a git source, run after its patches
└── ...                           every other file is installed as it is: package.xml,
                                  parameter files, launch files, a URDF

For a package of a local source, the installer writes the build file (CMakeLists.txt) from package.xml and the files next to it, unless the package has its own CMakeLists.txt or setup.py:

File in the package folder Installed to
launch files (.launch.py, .launch.xml, .launch.yaml) share/package/launch
parameter files (.yaml) share/package/config
robot descriptions (.urdf) share/package/urdf
the folders tool, maps and worlds share/package/tool, share/package/maps, share/package/worlds
shell functions (robotics_autonomy_*.sh) environment hooks, sourced with install/setup.bash

The package needs the build type ament_cmake in package.xml. A file that no rule matches is not installed, and the installer warns about it. A new kind of file is one more rule in ROS_INSTALL_RULES at the top of the installer.

The local files of a module sit in the same structure they get in the workspace. The folder catalog/robots/ugv_rover/launch is installed as src/robots/ugv_rover/launch.

Recipe fields

A recipe is a YAML file. The first line is a comment with the name of the module.

# <module name>
schema: 1                                  # the format version
sources:                                   # where the content comes from, at least one
  - type: apt
    package: <ROS package name>
    license: <SPDX identifier, or unknown>
  - type: git
    url: <repository url>
    version: <full commit hash>
    license: <SPDX identifier, or unknown>
    ref: <branch or tag>                   # optional, for readers
    patches: [<NNNN-topic.patch>]          # optional, files in patches/
    hook: <script.sh>                      # optional, a file in hooks/
    copy_paths:
      - {src: <folder in the repository>, dest: <folder in the workspace>}
  - type: local
    copy_paths:
      - {src: <folder in the module>, dest: <folder in the workspace>}
requires:                                  # optional, modules to install first
  - <type>/<name>
  - {module: <type>/<name>, package_dependency: false}   # installed, but not a dependency of a package

Notes on the fields:

  • apt: the ROS package name is mapped to the apt package names with rosdep.
  • requires: the recipe of a robot is the one list of what it needs; a config has none. The installer writes it into the package.xml files of the launch packages (see Dependencies in package.xml). A module marked package_dependency: false is installed by the installer and is not written there, for a tool that is delivered with the robot but that no launch file uses, for example a keyboard teleop. The marker is allowed on apt modules only.
  • license: the SPDX identifier when the source states one, otherwise unknown.
  • copy_paths: src is relative to the root of the git repository, or to the module folder for local files. A dot means all of it, except recipe.yaml, patches/ and hooks/. The dest is relative to the workspace and lies inside src/ in the folder of the module. A whole git repository (a dot) is cloned in place. A part of a repository is copied, together with the license files of the repository.
  • The launch package: a robot installs several ROS packages (its description, its driver, its launch package), and only one of them is started. It is named after the robot, robotics_autonomy__launch, so the recipe does not name it. The installer builds that package and everything it depends on, and launch starts it. The package holds the robot parameters and the launch files, which start the nodes of the robot; the nodes that exist only on real hardware start when sim is false. Configs and components have no launch package: nothing starts them.
  • A module can have several git sources, each with its own patches and hook.

Dependencies in package.xml

The recipe is the one place that lists what a robot or a config needs. A launch or config package of the catalog keeps its package.xml as usual: name, license, build tool and any dependency that is special to the package are written by hand. The dependencies that come from the recipe are generated between two marker lines:

<!-- BEGIN - DO NOT EDIT - generated from recipe -->
<exec_depend>slam_toolbox</exec_depend>
<!-- END - DO NOT EDIT - generated from recipe -->

The installer rewrites the lines between the markers on every run, after it has written the sources and before rosdep runs. The packages of a git or local module are found in the installed sources, and an apt module gives its ROS package name. rosdep then installs the apt packages that the files list, so the installer installs only what no package.xml lists. A package.xml without the markers is never changed. The installer stops, and names the file to edit, when a module needs the block and no package.xml in the right folder has the markers.

Examples

A component from apt, catalog/components/nav2_navfn_planner:

# nav2_navfn_planner
schema: 1
sources:
  - {type: apt, package: nav2_navfn_planner, license: Apache-2.0}

A component from git, catalog/components/synapse_ros. The commit is fixed and the whole repository is installed:

# synapse_ros
schema: 1
sources:
  - type: git
    url: https://github.com/CogniPilot/synapse_ros.git
    ref: main
    version: c2fed6be685340190564cf26addd98c0af8e2c08
    license: Apache-2.0
    copy_paths:
      - {src: ., dest: src/components/synapse_ros}

A robot, catalog/robots/ugv_rover. It combines a git source, of which two folders are used (the robot description and the driver), with local files (the parameters and the launch files of the robot). It requires the configs of its domains and every component it uses:

# ugv_rover
schema: 1
sources:
  - type: git
    url: https://github.com/waveshareteam/ugv_ws.git
    ref: ros2-humble-develop
    version: 2680d2d543b35f26f304874c3f6c0d68af11d2e2
    license: Apache-2.0
    patches:
      - 0001-ugv-port-env.patch
      - 0002-bringup-package-deps.patch
      - 0003-description-no-rviz-deps.patch
    copy_paths:
      - {src: src/ugv_main/ugv_description, dest: src/robots/ugv_rover/description}
      - {src: src/ugv_main/ugv_bringup, dest: src/robots/ugv_rover/driver}
  - type: local
    copy_paths:
      - {src: launch, dest: src/robots/ugv_rover/launch}
requires:
  - configs/navigation
  - components/ldlidar_stl_ros2
  - components/nav2_minimal_bundle
  - components/nav2_navfn_planner
  - components/nav2_regulated_pure_pursuit_controller
  - components/rf2o_laser_odometry
  - components/robot_state_publisher
  - components/slam_toolbox
  - {module: components/teleop_twist_keyboard, package_dependency: false}

Patches and hooks

A patch is a unified diff (git diff format) against the pinned commit. The installer starts from a clean tree on every run and applies the patches in name order. It stops and names the patch if one does not apply. A patch file that no source lists is not applied, and the installer warns.

A hook is a bash script that runs inside the patched tree with the options -euo pipefail. It can read these variables: WS (the workspace folder), MODULE (type/name), SRC_DIR (the patched tree) and ROS_DISTRO. A hook must be safe to run again, must not use the network and must not write outside the patched tree. Use a patch when you can; use a hook when a patch cannot express the change.

Naming

Names of modules, ROS packages, parameter files, launch files and shell functions follow patterns, so that you can tell from a name what it belongs to. The subject of a name is a domain or a robot. ROS packages and shell functions are global, so their names start with robotics_autonomy_; files inside a package do not.

what                           pattern                                           example
config module                  <domain>                                          navigation
component, single package      <upstream package name>                           slam_toolbox
component, bundle              <project>_<selection>_bundle                      nav2_minimal_bundle
component, environment         env_<place>_<size>                                env_maze_5x5
robot module                   <robot>                                           ugv_rover
simulated world of a robot     <robot>_<simulator>                               ugv_rover_gz
ROS package, config module     robotics_autonomy_<domain>_config                 robotics_autonomy_navigation_config
ROS package, robot             robotics_autonomy_<robot>_<role>                  robotics_autonomy_ugv_rover_launch
parameter file, config module  <domain>_config_<group>.yaml                      navigation_config_nav2.yaml
parameter file, robot          <domain>_config_robot.yaml                        navigation_config_robot.yaml
launch file, robot             <task>.launch.py                                  navigation.launch.py
shell function                 robotics_autonomy_<subject>_<object>_<action>     robotics_autonomy_navigation_goal_cancel

The names of files inside a robot module never contain the robot name; only the module folder and the package names do. That is why new can create a module from a template without renaming files by hand.


Known issues

  • Disk full during the install (apt or dpkg errors, "No space left on device"):
    • Check: df -h /
    • If the root partition does not use the whole disk, grow it.
    • Then repair and run the install again:
sudo dpkg --configure -a
sudo apt-get install -f
scripts/robotics_autonomy_manager install robot <robot>

About

robotics-autonomy is a collection of ready-to-install modules for autonomous ROS 2 robots, together with an installer that assembles the modules you choose into a working colcon workspace.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages