AgileX UGV SDK — Universal CAN Platform SDK

Complete reference for the ugv_sdk C++ library and pyagxrobots Python bindings — a unified interface for all AgileX mobile platforms over CAN 2.0B at 500 kbps.

Library: ugv_sdk Python: pyagxrobots Interface: CAN 2.0B @ 500 kbps GitHub: agilexrobotics/ugv_sdk
C++ Python CAN Bus ROS2 All Platforms

1. Overview

The ugv_sdk is AgileX Robotics' open-source C++ library that provides a unified software interface to all AgileX mobile platforms over the CAN bus. Rather than platform-specific drivers, ugv_sdk abstracts the underlying CAN protocol into a consistent API — the same code that commands a SCOUT 2.0 also works unmodified on a BUNKER, TRACER, or RANGER.

The library supports two protocol versions: Protocol V1 (legacy) and Protocol V2 (current). All platforms produced from 2021 onward use Protocol V2. Protocol V1 support is retained for backward compatibility with older Scout, Scout Mini, Hunter 1.0, and Bunker units.

For Python users, the pyagxrobots package provides Python bindings for ugv_sdk via pip, allowing rapid prototyping and integration with navigation stacks written in Python without compiling the C++ library directly.

One SDK, all platforms. ugv_sdk is the single dependency shared by all AgileX ROS2 packages (scout_ros2, ranger_ros2, bunker_ros2, limo_ros2, etc.). Install it once, and all platform-specific ROS2 drivers will find it automatically.

2. Supported Platforms

The table below shows protocol version support, available interfaces, and current support status for each AgileX platform.

Robot Protocol V1 Protocol V2 UART CAN Status
Scout 2.0 Y Y N Y Active
Scout Mini (Skid) Y Y Y Active
Scout Mini (Omni) Y Y Y Active
Hunter 1.0 Y Y Y Active
Hunter 2.0 Y Y Active
Bunker Y Y Y Active
Tracer Y N Y Active
Ranger Mini 2.0 Y Y Active
Ranger Mini 3.0 Y Y Active
Ranger Y Y Active
Protocol V2 is recommended for all new development. Protocol V1 support exists for older hardware. If your platform ships with Protocol V2 (all units from 2021 onward), do not enable V1 — it may cause unexpected behaviour with newer firmware.

3. Installation

C++ Library

Build and install ugv_sdk from source. The library requires CMake 3.10+, a C++14-compatible compiler, and the SocketCAN development headers (libsocketcan-dev on Ubuntu).

# Install dependencies (Ubuntu 20.04 / 22.04)
sudo apt install build-essential cmake libsocketcan-dev

# Clone the repository
git clone https://github.com/agilexrobotics/ugv_sdk.git
cd ugv_sdk && mkdir build && cd build

# Build and install
cmake .. && make -j4
sudo make install

After installation, the headers are available at /usr/local/include/ugv_sdk/ and the library at /usr/local/lib/libugv_sdk.so. Link with -lugv_sdk in your CMakeLists.txt.

Python Binding (pyagxrobots)

For Python-first workflows, install the official Python binding via pip. No C++ compilation required.

pip install pyagxrobots
Python binding requires a working CAN interface. pyagxrobots communicates with the hardware over the same SocketCAN interface as the C++ library. Ensure can0 is up before calling any pyagxrobots API (see CAN Setup below).

4. CAN Bus Setup

All AgileX platforms use CAN 2.0B at 500 kbps. You will need a GS_USB-compatible USB-to-CAN adapter (e.g., CANable, Waveshare USB-CAN-A). Connect it to the robot's CAN port before running any of the commands below.

Bring up the CAN interface

# Load the GS_USB kernel module
sudo modprobe gs_usb

# Bring up can0 at 500 kbps
sudo ip link set can0 up type can bitrate 500000

# Verify the interface is up and running
ip link show can0

# Optional: dump raw CAN frames for diagnostics
candump can0

Persistent setup across reboots

Each platform's ROS2 package ships two shell scripts that handle persistence automatically:

# Run once after first hardware connection to configure the adapter
bash setup_can2usb.bash

# Run on each subsequent boot before launching any ROS2 node
bash bringup_can2usb.bash

Both scripts are located in the scripts/ directory of the platform-specific ROS2 package (e.g., scout_ros2/scripts/).

Tip: add bringup to your ~/.bashrc or a systemd service if you want the CAN interface to come up automatically on boot without running the script manually.

5. Protocol Details

ParameterValue
CAN standardCAN 2.0B (extended frame support)
Bitrate500 kbps
Byte orderMotorola (big-endian)
Timeout protection500 ms — platform stops if no command received
Minimum command rate10 Hz (recommended: 20–50 Hz)
Protocol versionsV1 (legacy), V2 (current, all 2021+ units)
500 ms safety timeout. If your control node crashes or stalls for more than 500 ms, the robot will stop automatically. This is intentional. Design your control loop to send commands at a minimum of 10 Hz. For teleoperation, 50 Hz is recommended for smooth motion.

6. ROS2 Usage

All AgileX platforms follow an identical ROS2 launch pattern. Replace <robot> with the platform name: scout, ranger, bunker, tracer, hunter, or limo.

Install the platform's ROS2 package

# Example for SCOUT — replace 'scout' with your platform
cd ~/ros2_ws/src
git clone https://github.com/agilexrobotics/scout_ros2.git
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install
source install/setup.bash

Launch the base driver

# Bring up the CAN interface first (if not already up)
bash ~/ros2_ws/src/scout_ros2/scripts/bringup_can2usb.bash

# Launch the robot base driver
ros2 launch scout_base scout_base.launch.py port_name:=can0

# In a second terminal — keyboard teleoperation
ros2 run teleop_twist_keyboard teleop_twist_keyboard

Velocity command topic

All platforms subscribe to /cmd_vel (type: geometry_msgs/msg/Twist) and publish odometry on /odom and robot status on /robot_state. The topic names and message types are consistent across all platforms.

# Check available topics after launching the driver
ros2 topic list

# Send a manual velocity command (0.3 m/s forward, 0 angular)
ros2 topic pub /cmd_vel geometry_msgs/msg/Twist \
  "{linear: {x: 0.3, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}"
nav2 compatible. All AgileX platform ROS2 packages are compatible with the ROS2 nav2 navigation stack out of the box. The base driver publishes /odom and broadcasts the odombase_link TF transform required by nav2.

7. Gazebo Simulation

AgileX provides a unified Gazebo simulation package for all UGV platforms at ugv_gazebo_sim. The simulation uses the same ROS2 topic interface as the real hardware, so code developed in simulation transfers to the physical robot without modification.

# Clone the Gazebo sim package
cd ~/ros2_ws/src
git clone https://github.com/agilexrobotics/ugv_gazebo_sim.git
cd ~/ros2_ws && colcon build --symlink-install
source install/setup.bash

# Launch SCOUT 2.0 in Gazebo (replace 'scout' with your platform)
ros2 launch scout_description scout_gazebo.launch.py
All AgileX platforms Browse the AgileX platform hub for per-product pages covering SCOUT, RANGER, BUNKER, TRACER, LIMO, and Piper.
Have a question? Ask the community or contact support with your platform model and the output of ip link show can0.

Ready to integrate an AgileX platform?

Register on the platform, connect your robot over CAN, and start collecting navigation or manipulation data.