Getting Started

CAN Bus Setup

Enable the gs_usb driver in the Linux kernel.

$ sudo modprobe gs_usb

Install Linux CAN utilities.

$ sudo apt-get install -yq can-utils

Bringup CAN.

$ sudo ip link set can0 up type can bitrate 500000

Test your connection with the base. This command should output a stream of incoming CAN messages from the TR1200.

$ candump can0

Instead of manually bringing up the can0 interface every time the control computer turns on or whenever the CAN to USB converter is plugged in, you can use systemd-networkd to automatically bring up CAN interfaces. To do this, simply create the following file at /etc/systemd/network/80-can.network.

[Match]
Name=can*

[CAN]
BitRate=500K

Credit to this post on Ask Ubuntu.

ROS 2 Interface Setup

ROS 2 Interface Installation

Attention

The TR1200 ROS 2 packages are only supported on x86_64 and aarch64 machines running native Linux Ubuntu 22.04.

Install ROS 2 Humble via its debian packages following this guide on the ROS documentation site. Make sure to also install the development tools packages including rosdep.

Clone the tr1200_ros packages into your ROS 2 workspace.

$ mkdir -p ~/tr1200_ws/src
$ cd ~/tr1200_ws/src
$ git clone https://github.com/Interbotix/tr1200_ros.git

Install dependencies.

$ cd ~/tr1200_ws
$ rosdep install --from-paths src --ignore-src -r -y

Build the workspace.

$ cd ~/tr1200_ws
$ colcon build

ROS 2 Interface Control Usage

Launch the interface bringup.

$ source /opt/ros/humble/setup.bash
$ source ~/tr1200_ws/install/setup.bash
$ ros2 launch tr1200_control control.launch.py

Warning

Running the commands below will cause the robot to move forward at a rate of 0.1 m/s for three seconds. This command can be interrupted by pressing Ctrl + C. Be ready to take over control using the RC or press the e-stop if anything goes wrong.

Give the robot velocity commands in another terminal

$ source /opt/ros/humble/setup.bash
$ ros2 topic pub --rate 10 --times 30  /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.1}}"

ROS 2 Interface Teleop

Install the teleop_twist_keyboard package and xterm if not already installed on your system.

$ sudo apt-get install -yqq ros-humble-teleop-twist-keyboard xterm

Launch the interface bringup as described in ROS 2 Interface Control Usage.

Warning

Running the commands below will cause the robot to move forward and spin at defaults of 0.5 m/s and 1.0 rad/s until the velocity commands time out. You can send a zero velocity command to the robot at any time by pressing Space or k. Be ready to take over control using the RC or press the e-stop if anything goes wrong.

In a new terminal, launch the teleop node.

$ source /opt/ros/humble/setup.bash
$ source ~/tr1200_ws/install/setup.bash
$ ros2 launch tr1200_teleop keyop.launch.py

Follow the instructions on the terminal to control the robot using the keyboard.