{"id":13762105,"url":"https://github.com/sea-bass/turtlebot3_behavior_demos","last_synced_at":"2025-05-16T05:05:31.574Z","repository":{"id":37262823,"uuid":"358596780","full_name":"sea-bass/turtlebot3_behavior_demos","owner":"sea-bass","description":"Example repository for autonomous behaviors using TurtleBot robots and behavior trees, as well as Docker workflows in ROS based projects.","archived":false,"fork":false,"pushed_at":"2025-05-06T01:02:57.000Z","size":4610,"stargazers_count":353,"open_issues_count":6,"forks_count":71,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-06T02:20:09.898Z","etag":null,"topics":["docker","ros","turtlebot3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sea-bass.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-04-16T12:46:19.000Z","updated_at":"2025-05-06T01:03:00.000Z","dependencies_parsed_at":"2022-07-14T04:00:37.750Z","dependency_job_id":"7dcf3776-a84d-4bec-92b2-664e0611b787","html_url":"https://github.com/sea-bass/turtlebot3_behavior_demos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sea-bass%2Fturtlebot3_behavior_demos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sea-bass%2Fturtlebot3_behavior_demos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sea-bass%2Fturtlebot3_behavior_demos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sea-bass%2Fturtlebot3_behavior_demos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sea-bass","download_url":"https://codeload.github.com/sea-bass/turtlebot3_behavior_demos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471061,"owners_count":22076585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","ros","turtlebot3"],"created_at":"2024-08-03T14:00:34.822Z","updated_at":"2025-05-16T05:05:26.558Z","avatar_url":"https://github.com/sea-bass.png","language":"Python","funding_links":[],"categories":["Demos"],"sub_categories":["Application-Specific Packages"],"readme":"# TurtleBot Behavior Demos\nIn this repository, we demonstrate autonomous behavior with a simulated [ROBOTIS TurtleBot3](https://emanual.robotis.com/docs/en/platform/turtlebot3/overview/#overview) or [Clearpath TurtleBot 4](https://clearpathrobotics.com/turtlebot-4/) using Ubuntu 24.04 and ROS 2 Jazzy.\n\nThe autonomy in these examples are designed using **behavior trees**.\nFor more information, refer to [this blog post](https://roboticseabass.com/2021/05/08/introduction-to-behavior-trees/) or the [Behavior Trees in Robotics and AI textbook](https://arxiv.org/abs/1709.00084).\n\nThis also serves as an example for Docker workflows in ROS based projects.\nFor more information, refer to [this blog post](https://roboticseabass.com/2023/07/09/updated-guide-docker-and-ros2/).\n\nFor older versions:\n\n* If you want to use ROS 1, check out the [`noetic`](https://github.com/sea-bass/turtlebot3_behavior_demos/tree/noetic) branch of this repository.\n* If you want to use ROS 2 Humble, check out the [`humble`](https://github.com/sea-bass/turtlebot3_behavior_demos/tree/noetic) branch of this repository.\n\nBy Sebastian Castro, 2021-2025\n\nOther key contributors:\n* [Kemal Bektaş](https://github.com/bektaskemal) -- Upgrade to BehaviorTree.CPP v4.\n* [ElSayed ElSheikh](https://github.com/elsayedelsheikh) -- Upgrade to new Gazebo.\n\n---\n\n## Setup\n\n### Docker Setup (Recommended)\nFirst, install Docker and Docker Compose using [the official install guide](https://docs.docker.com/engine/install/ubuntu/).\n\nTo run Docker containers with NVIDIA GPU support, you can optionally install the [NVIDIA Container Toolkit](https://github.com/NVIDIA/nvidia-docker).\n\n\nFirst, clone this repository and go into the top-level folder:\n\n```\ngit clone https://github.com/sea-bass/turtlebot3_behavior_demos.git\ncd turtlebot3_behavior_demos\n```\n\nBuild the Docker images.\nThis will take a while and requires approximately 5 GB of disk space.\n\n```\ndocker compose build\n```\n\n### Local Setup\n\nIf you do not want to use Docker, you can directly clone this package to a ROS 2 workspace and build it provided you have the necessary dependencies.\nAs long as you can run the examples in the [Nav2 Minimal TurtleBot Simulation repo](https://github.com/ros-navigation/nav2_minimal_turtlebot_simulation), you should be in good shape.\n\nFirst, make a ROS 2 workspace and clone this repo there:\n\n```\nmkdir -p turtlebot_ws/src\ncd turtlebot_ws/src\ngit clone https://github.com/sea-bass/turtlebot3_behavior_demos.git\n```\n\nClone the external dependencies:\n\n```\nsudo apt-get install python3-vcstool\nvcs import \u003c turtlebot3_behavior_demos/dependencies.repos\n```\n\nSet up any additional dependencies using rosdep:\n\n```\nsudo apt update \u0026\u0026 rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y\n```\n\nEnsure you have the necessary Python packages for these examples:\n\n```\npip3 install matplotlib transforms3d\n```\n\nThen, build the workspace.\n\n```\ncd turtlebot_ws\ncolcon build\n```\n\nNOTE: For best results, we recommend that you change your ROS Middleware (RMW) implementation to Cyclone DDS by following [these instructions](https://docs.ros.org/en/jazzy/Installation/DDS-Implementations/Working-with-Eclipse-CycloneDDS.html).\n\n---\n\n## Basic Usage\n\nWe use [Docker Compose](https://docs.docker.com/compose/) to automate building, as shown above, but also for various useful entry points into the Docker container once it has been built.\n**All `docker compose` commands below should be run from your host machine, and not from inside the container**.\n\nTo enter a Terminal in the overlay container:\n\n```\ndocker compose run overlay bash\n```\n\nOnce inside the container, you can verify that display in Docker works by starting a Gazebo simulation with Nav2 support:\n\n```\nros2 launch tb_worlds tb_demo_world.launch.py\n```\n\nAlternatively, you can use the pre-existing `sim` service to do this in a single line:\n\n```\ndocker compose up demo-world\n```\n\nIf you want to develop using Docker, you can also launch a dev container using:\n\n```\n# Start the dev container\ndocker compose up dev\n\n# Open as many interactive shells as you want to the container\ndocker compose exec -it dev bash\n```\n\n---\n\n## Behavior Trees Demo\n\nIn this example, the robot navigates around known locations with the goal of finding a block of a specified color (red, green, or blue).\nObject detection is done using simple thresholding in the [HSV color space](https://en.wikipedia.org/wiki/HSL_and_HSV) with calibrated values.\n\nTo start the demo world, run the following command:\n\n```\ndocker compose up demo-world\n```\n\n### Behavior Trees in Python\n\nTo start the Python based demo, which uses [`py_trees`](https://py-trees.readthedocs.io/en/devel/):\n\n```\ndocker compose up demo-behavior-py\n```\n\nYou can also change the following environment variables to set arguments for the launch files, or by modifying the defaults in the `.env` file:\n\n```\nTARGET_COLOR=green BT_TYPE=queue ENABLE_VISION=true TURTLEBOT_MODEL=4 docker compose up demo-behavior-py\n```\n\nNote that the behavior tree viewer ([`py_trees_ros_viewer`](https://github.com/splintered-reality/py_trees_ros_viewer)) should automatically discover the ROS node containing the behavior tree and visualize it.\n\nAfter starting the commands above (plus doing some waiting and window rearranging), you should see the following.\nThe labeled images will appear once the robot reaches a target location.\n\n![Example demo screenshot](./media/demo_screenshot_python.png)\n\n### Behavior Trees in C++\n\nIf you want to use BehaviorTree.CPP and Groot2 for visualization, [download Groot2 from the website](https://www.behaviortree.dev/groot/).\nTo be consistent with the repository, download the AppImage and save it to your `$HOME` folder.\n\nTo start the C++ demo, which uses [`BehaviorTree.CPP`](https://www.behaviortree.dev/):\n\n```\ndocker compose up demo-behavior-cpp\n```\n\nYou can also change the following environment variables to set arguments for the launch files, or by modifying the defaults in the `.env` file:\n\n```\nTARGET_COLOR=green BT_TYPE=queue ENABLE_VISION=true TURTLEBOT_MODEL=4 docker compose up demo-behavior-cpp\n```\n\nThis example uses the behavior tree viewer ([`Groot2`](https://github.com/BehaviorTree/Groot2)).\n\nAfter starting the commands above (plus doing some waiting and window rearranging), you should see the following.\nThe labeled images will appear once the robot reaches a target location.\n\nNOTE: You will need the PRO version of Groot2 to view live behavior tree updates.\nIf you are a student or involved in academic work, you can get a free license to try this out.\nRefer to [the Groot2 website](https://www.behaviortree.dev/groot/) for more information.\n\n![Example demo screenshot](./media/demo_screenshot_cpp.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsea-bass%2Fturtlebot3_behavior_demos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsea-bass%2Fturtlebot3_behavior_demos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsea-bass%2Fturtlebot3_behavior_demos/lists"}