GithubHelp home page GithubHelp logo

minhuicen / turtlebot3_behavior_demos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sea-bass/turtlebot3_behavior_demos

0.0 0.0 0.0 1.48 MB

Example repository for autonomous behaviors using TurtleBot3, as well as Docker + Make workflows in ROS based projects.

License: MIT License

Makefile 6.10% Shell 2.33% CMake 17.96% Python 47.11% C++ 26.49%

turtlebot3_behavior_demos's Introduction

TurtleBot3 Behavior Demos

In this repository, we demonstrate autonomous behavior with a simulated ROBOTIS TurtleBot3 using Ubuntu 20.04 and ROS Noetic.

The autonomy in these examples are designed using behavior trees. For more information, refer to this blog post or the Behavior Trees in Robotics and AI textbook.

This also serves as an example for Docker + Make workflows in ROS based projects. For more information, refer to this blog post.

By Sebastian Castro, 2021


Setup

First, install Docker using the official install guide.

To run Docker containers with graphics and GPU support, you will also need the NVIDIA Container Toolkit.

To use GUI based tools (e.g., RViz, Gazebo) inside Docker, there is additional setup required. The simplest way is to run the command below each time you log into your machine, but there is a more detailed walkthrough of options in the ROS Wiki.

xhost + local:docker

Technically, you should be able to bypass Docker, directly clone this package to a Catkin workspace, and build it provided you have the necessary dependencies. As long as you can run the examples in the TurtleBot3 manual, you should be in good shape.

First, clone this repository and go into the top-level folder:

git clone https://github.com/sea-bass/turtlebot3_behavior_demos.git
cd turtlebot3_behavior_demos

Build the base and overlay Docker images. This will take a while and requires approximately 4 GB of disk space.

make build

Basic Usage

We use make to automate building, as shown above, but also for various useful entry points into the Docker container once it has been built. All make commands below should be run from your host machine, and not from inside the container.

To enter a Terminal in the overlay container:

make term

If you have an NVIDIA GPU and want to give your container access to the devices, add the following argument (this is true for all targets):

make term USE_GPU=true

You can verify that display in Docker works by starting a basic Gazebo simulation included in the standard TurtleBot3 packages:

make sim

Behavior Trees Demo

In this example, the robot navigates around known locations with the goal of finding a block of a specified color (red, green, or blue). Object detection is done using simple thresholding in the HSV color space with calibrated values.

To start the demo world, run the following command:

make demo-world

Behavior Trees in Python

To start the Python based demo, which uses py_trees:

make demo-behavior

You can also include arguments:

make demo-behavior TARGET_COLOR=green BT_TYPE=queue USE_GPU=true

Note that the behavior tree viewer (rqt_py_trees) does not select topics automatically. To view the tree, you should use the drop-down list to select the /autonomy_node/log/tree topic.

After starting the commands above (plus doing some waiting and window rearranging), you should see the following. The labeled images will appear once the robot reaches a target location.

Example demo screenshot

Behavior Trees in C++

To start the C++ demo, which uses BehaviorTrees.CPP:

make demo-behavior-cpp

You can also include arguments:

make demo-behavior-cpp TARGET_COLOR=green BT_TYPE=queue USE_GPU=true

Note that the behavior tree viewer (Groot) requires you to click the "Connect" button to display the active tree.

After starting the commands above (plus doing some waiting and window rearranging), you should see the following. The labeled images will appear once the robot reaches a target location.

Example demo screenshot

turtlebot3_behavior_demos's People

Contributors

sea-bass avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.