Skip to content

Repository files navigation

robot_turtlebot3

This repository contains the complete ROS 2 workspace for TurtleBot 3 robots, including sensor drivers.

Build Status Dependencies Build Date

New users experimenting with physical robots should read section Using Docker for Development on Physical Robots.

Installation

Follow the steps below to install this repository:

  1. Clone the git repository. Be sure to include the --recurse option.

    git clone --recurse git@github.com:NU-IDEAS-Lab/robot_turtlebot3.git
  2. Source ROS 2.

    source /opt/ros/humble/setup.bash
  3. Build the workspace.

    cd ./robot_turtlebot3/
    colcon build
  4. Source the newly-built workspace.

    source ./install/setup.bash

The TurtleBot 3 software should now be ready for use by other ROS 2 packages. You may wish to source the robot_turtlebot3 workspace automatically so that it does not need to be re-sourced in every new terminal.

Docker Installation & Usage

Docker may be used for easy deployment of the robot software.

To manually build:

docker build --platform=linux/arm64 -t robot:arm64 -f robot.dockerfile .

To pull pre-built image automatically from the container repository:

docker pull ghcr.io/nu-ideas-lab/robot_turtlebot3:latest

To run the built Docker container:

docker run --privileged --net=host -v /dev:/dev --rm -it ghcr.io/nu-ideas-lab/robot_turtlebot3:latest /bin/bash

Automatic Deployment for Physical Robots

The robot_configuration repository may be used for automatic deployment of Docker images to the robots. Follow the instructions at that repository to set up, and then run the following command from your computer:

ansible-playbook -i ./inventory/ ./deploy-software.yml -l YOUR_ROBOT_NAME

The latest robot production (robot) and development (robot_dev) containers will then be deployed to the robot.

Using Docker for Development on Physical Robots

This is a very basic workflow. Please feel free to modify/improve it.

  1. Clone the repository onto your development computer.

  2. Copy the repository to the /home/ideas/robot_turtlebot3 folder on the robot. See the VS Code Development Workflow section below for an automatic way to do this.

  3. We recommend to kill any currently-running Docker containers on the robot:

    docker kill robot robot_dev
  4. Start the Docker container. If you used the Automatic Deployment for Physical Robots, run the following:

    docker start -i robot_dev

    If not, you may achieve the same effect manually:

    docker run --privileged --net=host -v /dev:/dev -v ./robot_turtlebot3:/opt/robot_dev --rm -it ghcr.io/nu-ideas-lab/robot_turtlebot3:latest /bin/bash

    Both commands should be equivalent, though the first is slightly easier to remember.

  5. Inside the Docker container, change to the /opt/robot_dev directory:

    cd /opt/robot_dev
  6. Build the robot software:

    colcon build

    Certain packages are skipped when building on the robot (such as STVL) because the Raspberry Pi will run out of memory. See colcon_defaults.yaml for more details.

  7. Source the newly-built robot software:

    source /opt/robot_dev/install/setup.bash
  8. Run the robot software:

    ros2 launch robot_turtlebot3 robot.launch.yaml

VS Code Development Workflow

We provide a VS Code workspace configuration which greatly simplifies development on physical platforms. Using the recommended SFTP extension, one can easily upload changes to the physical robots.

First, select the robot to which you wish to upload by pressing Ctrl+Shift+P and running the SFTP: Set Profile command. You should see a list of robots. Select the one you are using.

If you have never uploaded code to the robot before, or are unsure of the robot state, right-click on the robot_turtlebot3 folder in VS Code's left-hand pane and select Sync Local -> Remote.

After the initial synchronization, files will be uploaded automatically to the robot when you save them.

About

This repository holds the ROS 2 base workspace for TurtleBot 3 platforms.

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages