GithubHelp home page GithubHelp logo

sea-bass / turtlebot3_behavior_demos Goto Github PK

View Code? Open in Web Editor NEW
267.0 8.0 52.0 3.54 MB

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

License: MIT License

Shell 2.48% CMake 4.14% Python 56.62% C++ 30.90% Dockerfile 5.86%
ros docker turtlebot3

turtlebot3_behavior_demos's Introduction

TurtleBot3 Behavior Demos

In this repository, we demonstrate autonomous behavior with a simulated ROBOTIS TurtleBot3 using Ubuntu 22.04 and ROS 2 Humble.

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 workflows in ROS based projects. For more information, refer to this blog post.

If you want to use ROS 1, check out the old version of this example from the noetic branch of this repository.

By Sebastian Castro, 2021-2024


Setup

Docker Setup (Recommended)

First, install Docker and Docker Compose using the official install guide.

To run Docker containers with NVIDIA GPU support, you can optionally install the NVIDIA Container Toolkit.

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 Docker images. This will take a while and requires approximately 5 GB of disk space.

docker compose build

Local Setup

If you do not want to use Docker, you can directly clone this package to a Colcon 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, make a Colcon workspace and clone this repo there:

mkdir -p turtlebot3_ws/src
cd turtlebot3_ws/src
git clone https://github.com/sea-bass/turtlebot3_behavior_demos.git

Clone the external dependencies:

sudo apt-get install python3-vcstool
vcs import < turtlebot3_behavior_demos/dependencies.repos

Set up any additional dependencies using rosdep:

sudo apt update && rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y

Ensure you have the necessary Python packages for these examples:

pip3 install matplotlib transforms3d

Then, build the workspace.

cd turtlebot3_ws
colcon build

NOTE: For best results, we recommend that you change your ROS Middleware (RMW) implementation to Cyclone DDS by following these instructions.


Basic Usage

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

To enter a Terminal in the overlay container:

docker compose run overlay bash

Once inside the container, you can verify that display in Docker works by starting a basic Gazebo simulation included in the standard TurtleBot3 packages:

ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py

Alternatively, you can use the pre-existing sim service to do this in a single line:

docker compose up sim

If you want to develop using Docker, you can also launch a dev container using:

# Start the dev container
docker compose up dev

# Open as many interactive shells as you want to the container
docker compose exec -it dev bash

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:

docker compose up demo-world

Behavior Trees in Python

To start the Python based demo, which uses py_trees:

docker compose up demo-behavior-py

You can also change the following environment variables to set arguments for the launch files, or by modifying the defaults in the .env file:

TARGET_COLOR=green BT_TYPE=queue ENABLE_VISION=true docker compose up demo-behavior-py

Note that the behavior tree viewer (py_trees_ros_viewer) should automatically discover the ROS node containing the behavior tree and visualize it.

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++

If you want to use BehaviorTree.CPP and Groot2 for visualization, download Groot2 from the website. To be consistent with the repository, download the AppImage and save it to your $HOME folder.

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

docker compose up demo-behavior-cpp

You can also change the following environment variables to set arguments for the launch files, or by modifying the defaults in the .env file:

TARGET_COLOR=green BT_TYPE=queue ENABLE_VISION=true docker compose up demo-behavior-cpp

This example uses the behavior tree viewer (Groot2).

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.

NOTE: You will need the PRO version of Groot2 to view live behavior tree updates. If you are a student or involved in academic work, you can get a free license to try this out. Refer to the Groot2 website for more information.

Example demo screenshot

turtlebot3_behavior_demos's People

Contributors

bektaskemal avatar sea-bass avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

turtlebot3_behavior_demos's Issues

`make sim` fails to render

Hi, everything till make term USE_GPU=true worked. make sim gives the following error message:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  151 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  38
  Current serial number in output stream:  37
[ INFO] [1622302771.457205900]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1622302771.458421671]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  151 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  38
  Current serial number in output stream:  37

System description: Ubuntu 20.04 with Nvidia GTX1650
Neofetch output here

Doubts about LookForObject::onHalted()

I am confused about when and how this onHalted() method will be called.
In BT source code the comment said that "callback to execute if the action was aborted by another node." But how can I implement that?I mean how can I abort a running statefulActionNode using another custom node? Thanks!

Help -- Local Setup

Hi everyone!

I am trying to run the demo based on the cpp library on my machine but I am missing something. I am running ros humble on ubu 22.04.

hereafter the steps I did:

  1. I installed and tested the turtlebot package as suggested in the instructions.
  2. I followed the instructions to build this demo in a local machine.
  3. I downloaded the Groot2 app image, placed in the home folder, renamed it as Groot2.AppImage (the file you download is slightly different) and I gave it execution permission.
  4. In a shell I set TURTLEBOT3_MODEL=waffle_pi and launched tb3_demo_world.launch.py
  5. In a shell I launched tb3_demo_beahvior_cpp.launch.py
  6. In rviz I set manually the initial 2d pose estimation.

The following snapshots show what I got

Screenshot from 2023-04-19 21-52-32
Screenshot from 2023-04-19 21-52-54
Screenshot from 2023-04-19 21-53-26

I can't understand what I am missing to place the three objects and start the behavior.

Thank you very much fort your time and consideration!

Groot2 curl link not valid

The curl link to Groot2 seems to be outdated. I'm getting the following response instead of the actual app image:

<Error>
  <Code>AccessDenied</Code>
  <Message>Access Denied</Message>
  <RequestId>F57GABXWYMH91Y8Q</RequestId>
  <HostId>L0+37M9FRcBsFLlaX6rACPdnFMnzAk933lMTJ4A9veWgoMlUahTeoFpLwoBycgEdvXkfu4ov3Ug=</HostId>
</Error>

`make build` fails

Hi, the error message is as follows:

Sending build context to Docker daemon  2.907MB
Step 1/15 : FROM nvidia_ros:latest
pull access denied for nvidia_ros, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
make: *** [Makefile:48: build-base] Error 1

Is nvidia_ros not a standard DockerHub image? It would be great if you could prepend those steps in the instructions.
Kudos to the corresponding blog post though! I learnt a lot from that

Decorator node inconsistency issue

Thanks for the great set of examples! They're super helpful. I'm looking to use py_trees for my setup and I'm following the examples that you've given, especially with the go to locations decorator node.

Let us say I have a fallback node : OR that can either do action 1 or action 2. Action1 is a searchAndGoto node that has your decorator node. It is a sequence that first searches for a location, and goes to that location, inside a decorator node that performs this until it is successful. Action2 is just another action (that always succeeds, let's say). As per this setup, I would like the fallback node to complete Action1, i.e. exhaust all the locations, and then try action2 only if action1 fails. Here's the associated code snippet:

`

    sel = py_trees.composites.Selector(name = "or", memory=True)
    seq = py_trees.composites.Sequence(name="search", memory=True)
    dec = py_trees.decorators.OneShot(
        name='root', child=seq, policy=py_trees.common.OneShotPolicy.ON_SUCCESSFUL_COMPLETION
    )
    tree = py_trees_ros.trees.BehaviourTree(sel, record_rosbag=False)

    tree.setup(timeout = 15.0)
    sel.add_child(dec)
    sel.add_child(GoToPose(
            name = "action2"
        ))

    seq.add_children([
        GetFVFromQueue(
            name = "get FV", blackboard_key="loc_list", fv='loc'
        ),
        GoToPose(
            name = "gotopose"
        )
    ])

`

Here's the output for the same.

('Go to loc choice is : ', 2)
[ INFO] get FV               : Terminated with status Status.SUCCESS

{o} or [*]
   -^- root [*]
       {-} search [*]
           --> get FV [✓]
           --> gotopose [*]
   --> action2

Blackboard Activity Stream

{o} or [*]
   -^- root [*]
       {-} search [*]
           --> get FV
           --> gotopose [*]
   --> action2

Blackboard Activity Stream

{o} or [*]
   -^- root [✕]
       {-} search [✕]
           --> get FV
           --> gotopose [✕]
   --> action2 [*]

Blackboard Activity Stream
[ INFO] get FV               : Terminated with status Status.INVALID

{o} or [*]
   -^- root
       {-} search
           --> get FV
           --> gotopose
   --> action2 [*]

Blackboard Activity Stream

{o} or [✓]
   -^- root
       {-} search
           --> get FV
           --> gotopose
   --> action2 [✓]

As you can see here, as soon as action1 (gotopose) fails for the first location, it fires action2. I would like for it to be stuck in action1 until the queue is empty. What's the best way to implement this?

Thanks

Why not use the Nav2 framework?

It looks like you've implemented behavior trees as your main goal manager, which is remarkably similar conceptually to what Nav2 does (as your blog post mentions). Why did you set up your simulation using BTs natively instead of integrating directly with the Nav2 framework? Is there a particular feature lacking in Nav2 that you needed for your demonstration?

Problem with wrapper

Hi @sea-bass!
Thanks for your repo. It's being very useful to me in order to start learning BTs on ROS2.
When testing this definition of the constructor GetLocationFromQueue

GetLocationFromQueue(
        const std::string& name, const BT::NodeConfiguration& config,
        rclcpp::Node::SharedPtr node_ptr);

I get the error

$HOME/turtlebot3_ws/install/behaviortree_cpp_v3/include/behaviortree_cpp_v3/bt_factory.h:338:45: error: static assertion failed: [registerNode]: the registered class must have at least one of these two constructors: (const std::string&, const NodeConfiguration&) or (const std::string&).

Is it due to the behaviortreecpp lib version in ROS2 galactic package?
Thanks in advance

Switch to Docker Compose

The Makefile workflow to abstract away the long docker run commands with lots of arguments is cute, but is not really standard.

Making this issue to track converting the repo to using Docker Compose instead.

gazebo start fails

Hi @sea-bass,
I'm getting this errors when trying to start Gazebo by using your docker deployment over an Ubuntu 22.04 VM.
Do you know what could be the problem?
Thanks in advance

`turtlebot3_behavior_demos-sim-1 | [spawn_entity.py-4] [ERROR] [1675336457.271874064] [spawn_entity]: Spawn service failed. Exiting.

turtlebot3_behavior_demos-sim-1 | [ERROR] [spawn_entity.py-4]: process has died [pid 75, exit code 1, cmd '/opt/ros/humble/lib/gazebo_ros/spawn_entity.py -entity waffle_pi -file /turtlebot3_ws/install/turtlebot3_gazebo/share/turtlebot3_gazebo/models/turtlebot3_waffle_pi/model.sdf -x -2.0 -y -0.5 -z 0.01 --ros-args'].

turtlebot3_behavior_demos-sim-1 | [gzserver-1] ALSA lib confmisc.c:855:(parse_card) cannot find card '0'

turtlebot3_behavior_demos-sim-1 | [gzserver-1] ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory

turtlebot3_behavior_demos-sim-1 | [gzserver-1] ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings

turtlebot3_behavior_demos-sim-1 | [gzserver-1] ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory

turtlebot3_behavior_demos-sim-1 | [gzserver-1] ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name

turtlebot3_behavior_demos-sim-1 | [gzserver-1] ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

turtlebot3_behavior_demos-sim-1 | [gzserver-1] ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory

turtlebot3_behavior_demos-sim-1 | [gzserver-1] ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default

turtlebot3_behavior_demos-sim-1 | [gzserver-1] AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory`

Blackboard, complex object instead of single values?

Let's say I want to implement a class representing a real robot. This class subscribes to sensor data, communicate with hardware and keeps sensor data, overall status current task and so on as attributes. It also provides methods to set actuators.

Is it possible to share this class across blackboard variable instead of pushing every Attribute as a single variable to blackboard?

Thanks for All your time explain robotic stuff to community. Me as a hobbyists robotics ebgineer, I learned so much about robots.

gazebo 11 and Ubuntu 22.04

Hi @sea-bass
Thanks for your updates to the repo. This question is not about it, nevertheless, maybe you can help me.
When trying to run gazebo 11 over Ubuntu 22.04 on a VM I get the errors:

` gazebo --verbose
Gazebo multi-robot simulator, version 11.10.2
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
Gazebo multi-robot simulator, version 11.10.2
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 10.0.2.15
[Msg] Loading world file [/usr/share/gazebo-11/worlds/empty.world]
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 10.0.2.15
[Wrn] [Server.cc:579] Waited 1seconds for namespaces.
[Wrn] [Server.cc:579] Waited 1seconds for namespaces.
[Wrn] [Server.cc:579] Waited 1seconds for namespaces.
[Wrn] [Server.cc:579] Waited 1seconds for namespaces.
[Wrn] [Server.cc:579] Waited 1seconds for namespaces.
[Wrn] [Server.cc:579] Waited 1seconds for namespaces.
[Wrn] [Server.cc:579] Waited 1seconds for namespaces.
[Wrn] [Server.cc:579] Waited 1seconds for namespaces.
[Wrn] [Server.cc:579] Waited 1seconds for namespaces.
[Wrn] [Server.cc:579] Waited 1seconds for namespaces.
[Err] [Server.cc:584] Waited 11 seconds for namespaces. Giving up.
[Err] [Node.cc:118] No namespaces found
`

I've tried to solve it by disabling Wayland on Ubuntu 22.04 or following the tutorials described in this post (https://answers.ros.org/question/408333/gazebo-ros2-humble-on-ubuntu-2204/?answer=408353#post-id-408353) with no luck.. Did you experience a similar error on your Docker deployment?
Thanks in advance!

What is the publisher port in Groot?

Hi,
I followed the tutorial. I didn't use docker.I run roslaunch tb3_worlds tb3_demo_world.launch without problem.
After running the roslaunch tb3_autonomy tb3_demo_behavior_cpp.launch the Groot editor opens but I'm not able to make a connection between ROS and Groot.
it seems I need a publisher port number. the default is not working.
I'm using Ubuntu focal, ros noetic.
thanks for your support.

Questions: BT run by a FSM/HSM: how to leave BT properly ?

Hello sir!

I read with pleasure your article https://robohub.org/introduction-to-behavior-trees I greatly appreciate how a BT can be depicted by an FSM. I have two questions and a small remark:

  • I'm starting with the minimal remark:

fsm

Since the state machine time is discretized, several events can happen at the same time. Here BatteryKO event and success. To know which state to go, we have to make choice (guards) mutually exclusive: for example success and battery ok for going to closeGrip state. This seems obvious to veterans, but this does not hurt to tell it explicitly for beginners in your article.

  • Here my first question:

bt

in FSM/HSM what is your suggestion for implementing code leaving/interrupting the BehaviorTree wrorkflow when i.e. the battery KO event is triggered and switching to the next FSM state ? I hope not to be wrong whe saying you have not implemented a basic example HSM with BT. If we made things not correctly, the BT state will still be in the RUNNING state of the current node. We have to reset states of the tree correctly. What do you suggest from your experience ?

What I'm thinking is update_behavior_tree() called by the state nominal activity in pseudocode (there are lot of libs with a more modern way separating the logic of transition from the business code, i.e. https://github.com/erikzenker/hsm):

void NominalState::step()
{ 
   status = update_behavior_tree() ;
   if (status == FAILURE)
   {
       // leave the state
       next_state = GoToFailureState;
   }
   else if (status == SUCCESS)
   {
       // leave the state
       next_state = GoToSuccessState;
   }
   else
   {
      // stay in the same state
   }
}

BT::NodeStatus update_behavior_tree()
{
   // Tick the behavior tree.
   BT::NodeStatus tree_status = tree_.tickOnce();
   if (tree_status == BT::NodeStatus::RUNNING) {
         return tree_status;
   }
   ...

The implementation with the battery would be:

void NominalState::step()
{ 
   if (battery KO)
   {
       // reset the tree ?
       tree_.haltTree(); 
       // leave the state
       next_state = GoToChargeState;
   }
   else
   {
       status = update_behavior_tree() ;
       if (status == FAILURE)
       {
          // leave the state
          next_state = GoToFailureState;
       }
       else if (status == SUCCESS)
       {
          // leave the state
          next_state = GoToSuccessState;
       }
       else
       {
          // stay in the same state
       }
   }
}
  • My second question:

Have you tried BT with Petri net (GRAFCET aka SFC) instead of HSM ? Running several BT in concurrency ?

Thank you in advance !

EDIT: I realized that FSM libs (boost MSM/boost statecharts/tinyfsm ...) does not offer a tick() method to perform some state activity (activity = long term action). The only action are triggered by transitions. So I cannot call BT::TickOnce(). So finally, it's not so easy to mix BT with FSM. I made a basic FSM with switch case and BT::haltTree(); has to be called.

TypeError: setup() got an unexpected keyword argument 'node'

Hello,
I've encountered an error below.
I've modified a line in autonomy_node.py line 112 and successfully run the demo.
tree.setup(timeout=15.0, node=self) -> tree.setup(timeout=15.0)

[autonomy_node.py-1] Traceback (most recent call last):
[autonomy_node.py-1] File "/home/ubuntu/host/share/bt_ws/install/tb3_autonomy/lib/tb3_autonomy/autonomy_node.py", line 133, in
[autonomy_node.py-1] behavior = AutonomyBehavior()
[autonomy_node.py-1] File "/home/ubuntu/host/share/bt_ws/install/tb3_autonomy/lib/tb3_autonomy/autonomy_node.py", line 53, in init
[autonomy_node.py-1] self.create_behavior_tree(self.tree_type)
[autonomy_node.py-1] File "/home/ubuntu/host/share/bt_ws/install/tb3_autonomy/lib/tb3_autonomy/autonomy_node.py", line 64, in create_behavior_tree
[autonomy_node.py-1] self.tree = self.create_queue_tree()
[autonomy_node.py-1] File "/home/ubuntu/host/share/bt_ws/install/tb3_autonomy/lib/tb3_autonomy/autonomy_node.py", line 112, in create_queue_tree
[autonomy_node.py-1] tree.setup(timeout=15.0, node=self)
[autonomy_node.py-1] TypeError: setup() got an unexpected keyword argument 'node'

docker compose build failed when running to vcs import < dependencies.repos

@sea-bass Hi,as the title described,the build process failed when running to vcs import < dependencies.repos:
image
I don't know if it is due to the network setup on my host machine because I use clash for windows to proxy my network,but the error still occurs after I set the --build-arg http_proxy and --build-arg https_proxy to my host proxy configuration:
image
so I want ask you if there any solution and I'd appreciate it if you could give me some advice!

KeyError: 'location_file'

Hi,
When I run make demo-behavior, I see KeyError: 'location_file'.
In autonomy_node.py, looks like we are loading "location_file" ros parameter. However, I see that it's only being loaded in tb3_world.launch. I think that's probably reason why

Colcon build failing due to permissions

Hello,

Thanks for detailed guide and example repo! I've created a slightly modified version of your docker setup but I've encountered a colcon build issue related to permissions that I was hoping you might have some insight to.

After successfully running docker-compose up and entering the development container, I can't seem to run colcon build. When running this, colcon build returns the following error:
PermissionError: [Errno 13] Permission denied: 'log/build_2023-11-27_23-16-18'

As part of my debugging, I tried changing the permissions in the Dockerfile from 0440 to 0777 here:

RUN groupadd --gid $GID $USERNAME \
 && useradd --uid ${GID} --gid ${UID} --create-home ${USERNAME} \
 && echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} \
 && chmod 0440 /etc/sudoers.d/${USERNAME} \
 && mkdir -p /home/${USERNAME} \
 && chown -R ${UID}:${GID} /home/${USERNAME}

but this did not seem to make a difference.

One solution I've found is to remove the colcon build artifacts from the volume mount in the docker-compose.yaml file:

 volumes:
      # Mount the source code
      - ./tb3_autonomy:/overlay_ws/src/tb3_autonomy:rw
      - ./tb3_worlds:/overlay_ws/src/tb3_worlds:rw
      # Mount colcon build artifacts for faster rebuilds
      - ./.colcon/build/:/overlay_ws/build/:rw
      - ./.colcon/install/:/overlay_ws/install/:rw
      - ./.colcon/log/:/overlay_ws/log/:rw

So the issue seems to stem from the creation of the .colcon folder during the docker build. Do you have any insight into how to remedy this while keeping the .colcon artifacts as bind mounts?

Thanks again!

Not spawned in Gazebo and visualized in RViz

Always appreciate your kind reply.

Following your recent commit version, I've been retrying to set up this repository by Docker.

Thankfully, the installation doesn't matter due to your last revision, but there are some troubles in the running process.

The below steps are what I've done according to the Readme file in the GitHub repo.

**1. The First Terminal: docker compose up demo-world

  1. The second Terminal: docker compose up demo-behavior-py**

Then, I found messages as shown in the below-captured images.

Screenshot from 2023-04-26 18-45-05
Screenshot from 2023-04-26 18-45-25
Screenshot from 2023-04-26 18-45-50
Screenshot from 2023-04-26 18-45-55

First, there is nothing special in the 1st images.

However, I could find the errors and highlight them in the 2nd and 3rd images.

Also, in the last images, the robot model wasn't spawned, and messages about the service waiting were repeated again and again.

How could I fix these troubles?

Docker setup failed

I was just following down this, https://github.com/sea-bass/turtlebot3_behavior_demos

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

  2. cd turtlebot3_behavior_demos

  3. docker compose build

However, at 3, I found the problem that the build failed with the below comments.

The detailed error can be found in the attached image files.


ERROR [overlay 5/6] RUN source /turtlebot3_ws/install/setup.bash && colcon build --symlink-install

....

/overlay_ws/src/tb3_autonomy/src/autonomy_node.cpp:12:10: fatal error: behaviortree_cpp/loggers/bt_zmq_publisher.h: No such file or directory

FYI:

20230412_164414

groot installation fails, post-patch

There appears to be some errors in the source code for the groot package.

I tried:

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

sudo -E make build

Stack trace below:

Starting >>> groot
[0.503s] WARNING:colcon.colcon_ros.task.ament_python.build:Package 'py_trees' doesn't explicitly install a marker in the package index (colcon-ros currently does it implicitly but that fallback will be removed in the future)
[0.504s] WARNING:colcon.colcon_ros.task.ament_python.build:Package 'py_trees' doesn't explicitly install the 'package.xml' file (colcon-ros currently does it implicitly but that fallback will be removed in the future)
[0.671s] WARNING:colcon.colcon_ros.task.ament_python.build:Package 'py_trees_js' doesn't explicitly install a marker in the package index (colcon-ros currently does it implicitly but that fallback will be removed in the future)
Finished <<< turtlebot3_description [1.04s]
Finished <<< turtlebot3_cartographer [1.20s]
Finished <<< turtlebot3_navigation2 [1.26s]
Finished <<< turtlebot3_teleop [1.26s]
Finished <<< py_trees [1.38s]
Finished <<< py_trees_js [1.43s]
Finished <<< dynamixel_sdk [1.55s]
Finished <<< dynamixel_sdk_custom_interfaces [7.74s]
Starting >>> dynamixel_sdk_examples
--- stderr: groot
/turtlebot3_ws/src/groot/QtNodeEditor/src/NodeState.cpp: In member function ‘QtNodes::NodeState::ConnectionPtrSet QtNodes::NodeState::connections(QtNodes::PortType, QtNodes::PortIndex) const’:
/turtlebot3_ws/src/groot/QtNodeEditor/src/NodeState.cpp:51:34: warning: comparison of integer expressions of different signedness: ‘QtNodes::PortIndex’ {aka ‘int’} and ‘std::vector<std::unordered_map<QUuid, QtNodes::Connection*> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   51 |   if( portIndex < 0 || portIndex >= connections.size() )
      |                        ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/turtlebot3_ws/src/groot/bt_editor/XML_utilities.cpp: In function ‘bool VerifyXML(QDomDocument&, const std::vector<QString>&, std::vector<QString>&)’:
/turtlebot3_ws/src/groot/bt_editor/XML_utilities.cpp:199:33: error: invalid initialization of reference of type ‘const std::unordered_map<std::__cxx11::basic_string<char>, BT::NodeType>&’ from expression of type ‘std::set<std::__cxx11::basic_string<char> >’
  199 |         BT::VerifyXML(xml_text, registered_nodes); // may throw
      |                                 ^~~~~~~~~~~~~~~~
In file included from /turtlebot3_ws/src/groot/bt_editor/XML_utilities.cpp:5:
/opt/ros/galactic/include/behaviortree_cpp_v3/xml_parsing.h:42:65: note: in passing argument 2 of ‘void BT::VerifyXML(const string&, const std::unordered_map<std::__cxx11::basic_string<char>, BT::NodeType>&)’
   42 |                const std::unordered_map<std::string, NodeType>& registered_nodes);
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/behavior_tree_editor.dir/build.make:251: CMakeFiles/behavior_tree_editor.dir/bt_editor/XML_utilities.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/turtlebot3_ws/src/groot/bt_editor/sidepanel_monitor.cpp: In member function ‘void SidepanelMonitor::on_timer()’:
/turtlebot3_ws/src/groot/bt_editor/sidepanel_monitor.cpp:61:42: warning: ‘bool zmq::detail::socket_base::recv(zmq::message_t*, int)’ is deprecated: from 4.3.1, use recv taking a reference to message_t and recv_flags [-Wdeprecated-declarations]
   61 |         while(  _zmq_subscriber.recv(&msg) )
      |                                          ^
In file included from /turtlebot3_ws/src/groot/bt_editor/sidepanel_monitor.h:5,
                 from /turtlebot3_ws/src/groot/bt_editor/sidepanel_monitor.cpp:1:
/usr/include/zmq.hpp:1407:10: note: declared here
 1407 |     bool recv(message_t *msg_, int flags_ = 0)
      |          ^~~~
/turtlebot3_ws/src/groot/bt_editor/sidepanel_monitor.cpp: In member function ‘bool SidepanelMonitor::getTreeFromServer()’:
/turtlebot3_ws/src/groot/bt_editor/sidepanel_monitor.cpp:149:32: warning: ‘bool zmq::detail::socket_base::send(zmq::message_t&, int)’ is deprecated: from 4.3.1, use send taking message_t and send_flags [-Wdeprecated-declarations]
  149 |         zmq_client.send(request);
      |                                ^
In file included from /turtlebot3_ws/src/groot/bt_editor/sidepanel_monitor.h:5,
                 from /turtlebot3_ws/src/groot/bt_editor/sidepanel_monitor.cpp:1:
/usr/include/zmq.hpp:1326:10: note: declared here
 1326 |     bool send(message_t &msg_,
      |          ^~~~
/turtlebot3_ws/src/groot/bt_editor/sidepanel_monitor.cpp:151:47: warning: ‘bool zmq::detail::socket_base::recv(zmq::message_t*, int)’ is deprecated: from 4.3.1, use recv taking a reference to message_t and recv_flags [-Wdeprecated-declarations]
  151 |         bool received = zmq_client.recv(&reply);
      |                                               ^
In file included from /turtlebot3_ws/src/groot/bt_editor/sidepanel_monitor.h:5,
                 from /turtlebot3_ws/src/groot/bt_editor/sidepanel_monitor.cpp:1:
/usr/include/zmq.hpp:1407:10: note: declared here
 1407 |     bool recv(message_t *msg_, int flags_ = 0)
      |          ^~~~
make[1]: *** [CMakeFiles/Makefile2:158: CMakeFiles/behavior_tree_editor.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed   <<< groot [11.0s, exited with code 2]

Am I doing anything wrong?

docker compose build isn't working

I am getting these errors messages after doing a docker compose build.

BLIRKSPR MINGW64 ~/dockerimage/turtlebot3_behavior_demos/docker (main)
$ docker compose up overlay
Container turtlebot3_behavior_demos-overlay-1 Creating
Container turtlebot3_behavior_demos-overlay-1 Created
Attaching to turtlebot3_behavior_demos-overlay-1
turtlebot3_behavior_demos-overlay-1 | exec /entrypoint.sh: no such file or directory
turtlebot3_behavior_demos-overlay-1 exited with code 1

BLIRKSPR MINGW64 ~/dockerimage/turtlebot3_behavior_demos/docker (main)
$ docker compose up sim
Container turtlebot3_behavior_demos-sim-1 Creating
Container turtlebot3_behavior_demos-sim-1 Created
Attaching to turtlebot3_behavior_demos-sim-1
turtlebot3_behavior_demos-sim-1 | exec /entrypoint.sh: no such file or directory
turtlebot3_behavior_demos-sim-1 exited with code 1

BLIRKSPR MINGW64 ~/dockerimage/turtlebot3_behavior_demos/docker (main)
$ docker compose up dev
Container turtlebot3_behavior_demos-dev-1 Creating
Container turtlebot3_behavior_demos-dev-1 Created
Attaching to turtlebot3_behavior_demos-dev-1
turtlebot3_behavior_demos-dev-1 | exec /entrypoint.sh: no such file or directory
turtlebot3_behavior_demos-dev-1 exited with code 1

It looks like everything built okay when the docker compose build command was issued.

Output file attached.
dockerbuildissue.txt

`make build` fails

Following the instructions, when I run sudo make build, I am greeted by the error unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /docker: no such file or directory.

I fixed this by removing ${PWD} from the docker file paths in the MakeFile, however I am curious to know the cause of this issue, when no one else seems to have encountered it. Forgive my noobiness if it is obvious.

Arviz not starting

Hello,

I have followed the tutorial and build compose the image without errors.

However when it comes to starting the demo with:

docker run -it 
--net=host 
--ipc=host --privileged     
--env="DISPLAY"     
--env="QT_X11_NO_MITSHM=1"    
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw"     
--volume="${XAUTHORITY}:/root/.Xauthority"     
turtlebot3_behavior:overlay     
bash -c "ros2 launch tb3_worlds tb3_demo_world.launch.py"

However, after starting, I get the following logs:

Sourced ROS 2 humble
Sourced TurtleBot3 base workspace
Sourced autonomy overlay workspace
[INFO] [launch]: All log files can be found below /root/.ros/log/2023-11-06-11-36-02-703563-linuxkit-525400123456-1
[INFO] [launch]: Default logging verbosity is set to INFO
urdf_file_name : turtlebot3_waffle_pi.urdf
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/map_server' in container '/nav2_container'
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/amcl' in container '/nav2_container'
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/lifecycle_manager_localization' in container '/nav2_container'
[INFO] [component_container_isolated-1]: process started with pid [81]
[INFO] [rviz2-2]: process started with pid [83]
[INFO] [set_init_amcl_pose.py-3]: process started with pid [85]
[INFO] [block_spawner.py-4]: process started with pid [96]
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/controller_server' in container '/nav2_container'
[component_container_isolated-1] [INFO] [1699270564.589522094] [nav2_container]: Load Library: /opt/ros/humble/lib/libsmoother_server_core.so
[rviz2-2] qt.qpa.xcb: could not connect to display :0
[rviz2-2] qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
[rviz2-2] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
[rviz2-2] 
[rviz2-2] Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
[rviz2-2] 
[ERROR] [rviz2-2]: process has died [pid 83, exit code -6, cmd '/opt/ros/humble/lib/rviz2/rviz2 -d /opt/ros/humble/share/nav2_bringup/rviz/nav2_default_view.rviz --ros-args -r __node:=rviz2 --params-file /tmp/launch_params_35ptztgr'].
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/smoother_server' in container '/nav2_container'
[component_container_isolated-1] [INFO] [1699270564.681155207] [nav2_container]: Found class: rclcpp_components::NodeFactoryTemplate<nav2_smoother::SmootherServer>
[component_container_isolated-1] [INFO] [1699270564.681217487] [nav2_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate<nav2_smoother::SmootherServer>
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/planner_server' in container '/nav2_container'
[component_container_isolated-1] [INFO] [1699270564.692015141] [smoother_server]: 
[component_container_isolated-1] 	smoother_server lifecycle node launched. 
[component_container_isolated-1] 	Waiting on external lifecycle transitions to activate
[component_container_isolated-1] 	See https://design.ros2.org/articles/node_lifecycle.html for more information.
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/behavior_server' in container '/nav2_container'
[component_container_isolated-1] [INFO] [1699270564.723832588] [smoother_server]: Creating smoother server
[component_container_isolated-1] [INFO] [1699270564.726342507] [nav2_container]: Load Library: /opt/ros/humble/lib/libplanner_server_core.so
[component_container_isolated-1] [INFO] [1699270564.730772311] [nav2_container]: Found class: rclcpp_components::NodeFactoryTemplate<nav2_planner::PlannerServer>
[component_container_isolated-1] [INFO] [1699270564.731518522] [nav2_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate<nav2_planner::PlannerServer>
[component_container_isolated-1] [INFO] [1699270564.747300373] [planner_server]: 
[component_container_isolated-1] 	planner_server lifecycle node launched. 
[component_container_isolated-1] 	Waiting on external lifecycle transitions to activate
[component_container_isolated-1] 	See https://design.ros2.org/articles/node_lifecycle.html for more information.
[component_container_isolated-1] [INFO] [1699270564.754033932] [planner_server]: Creating
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/bt_navigator' in container '/nav2_container'
[component_container_isolated-1] [INFO] [1699270564.771050046] [global_costmap.global_costmap]: 
[component_container_isolated-1] 	global_costmap lifecycle node launched. 
[component_container_isolated-1] 	Waiting on external lifecycle transitions to activate
[component_container_isolated-1] 	See https://design.ros2.org/articles/node_lifecycle.html for more information.
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/waypoint_follower' in container '/nav2_container'
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/velocity_smoother' in container '/nav2_container'
[component_container_isolated-1] [INFO] [1699270564.830444378] [global_costmap.global_costmap]: Creating Costmap
[component_container_isolated-1] [INFO] [1699270564.835475536] [nav2_container]: Load Library: /opt/ros/humble/lib/libbehavior_server_core.so
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/lifecycle_manager_navigation' in container '/nav2_container'
[component_container_isolated-1] [INFO] [1699270564.914520243] [nav2_container]: Found class: rclcpp_components::NodeFactoryTemplate<behavior_server::BehaviorServer>
[component_container_isolated-1] [INFO] [1699270564.915364294] [nav2_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate<behavior_server::BehaviorServer>
[component_container_isolated-1] [INFO] [1699270564.931767105] [behavior_server]: 
[component_container_isolated-1] 	behavior_server lifecycle node launched. 
[component_container_isolated-1] 	Waiting on external lifecycle transitions to activate
[component_container_isolated-1] 	See https://design.ros2.org/articles/node_lifecycle.html for more information.
[component_container_isolated-1] [INFO] [1699270564.948279440] [nav2_container]: Load Library: /opt/ros/humble/lib/libbt_navigator_core.so
[component_container_isolated-1] [INFO] [1699270564.964455919] [nav2_container]: Found class: rclcpp_components::NodeFactoryTemplate<nav2_bt_navigator::BtNavigator>
[component_container_isolated-1] [INFO] [1699270564.964496931] [nav2_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate<nav2_bt_navigator::BtNavigator>
[component_container_isolated-1] [INFO] [1699270564.984876556] [bt_navigator]: 
[component_container_isolated-1] 	bt_navigator lifecycle node launched. 
[component_container_isolated-1] 	Waiting on external lifecycle transitions to activate
[component_container_isolated-1] 	See https://design.ros2.org/articles/node_lifecycle.html for more information.
[component_container_isolated-1] [INFO] [1699270564.985261458] [bt_navigator]: Creating
[component_container_isolated-1] [INFO] [1699270564.988231644] [nav2_container]: Load Library: /opt/ros/humble/lib/libwaypoint_follower_core.so
[component_container_isolated-1] [INFO] [1699270565.000536339] [nav2_container]: Found class: rclcpp_components::NodeFactoryTemplate<nav2_waypoint_follower::WaypointFollower>
[component_container_isolated-1] [INFO] [1699270565.001758140] [nav2_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate<nav2_waypoint_follower::WaypointFollower>
[component_container_isolated-1] [INFO] [1699270565.014129795] [waypoint_follower]: 
[component_container_isolated-1] 	waypoint_follower lifecycle node launched. 
[component_container_isolated-1] 	Waiting on external lifecycle transitions to activate
[component_container_isolated-1] 	See https://design.ros2.org/articles/node_lifecycle.html for more information.
[component_container_isolated-1] [INFO] [1699270565.019811677] [waypoint_follower]: Creating
[component_container_isolated-1] [INFO] [1699270565.021681348] [nav2_container]: Load Library: /opt/ros/humble/lib/libvelocity_smoother_core.so
[component_container_isolated-1] [INFO] [1699270565.024957684] [nav2_container]: Found class: rclcpp_components::NodeFactoryTemplate<nav2_velocity_smoother::VelocitySmoother>
[component_container_isolated-1] [INFO] [1699270565.025002518] [nav2_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate<nav2_velocity_smoother::VelocitySmoother>
[component_container_isolated-1] [INFO] [1699270565.039229945] [velocity_smoother]: 
[component_container_isolated-1] 	velocity_smoother lifecycle node launched. 
[component_container_isolated-1] 	Waiting on external lifecycle transitions to activate
[component_container_isolated-1] 	See https://design.ros2.org/articles/node_lifecycle.html for more information.
[component_container_isolated-1] [INFO] [1699270565.042096657] [nav2_container]: Load Library: /opt/ros/humble/lib/libnav2_lifecycle_manager_core.so
[component_container_isolated-1] [INFO] [1699270565.047635153] [nav2_container]: Found class: rclcpp_components::NodeFactoryTemplate<nav2_lifecycle_manager::LifecycleManager>
[component_container_isolated-1] [INFO] [1699270565.047700536] [nav2_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate<nav2_lifecycle_manager::LifecycleManager>
[component_container_isolated-1] [INFO] [1699270565.058571649] [lifecycle_manager_navigation]: Creating
[set_init_amcl_pose.py-3] [INFO] [1699270565.061367319] [init_pose_publisher]: Setting initial AMCL pose to [x: 0.0, y: 0.0, theta: 0.0] ...
[component_container_isolated-1] [INFO] [1699270565.065598010] [lifecycle_manager_navigation]: Creating and initializing lifecycle service clients
[component_container_isolated-1] [INFO] [1699270565.072287677] [lifecycle_manager_navigation]: Starting managed nodes bringup...
[component_container_isolated-1] [INFO] [1699270565.072380923] [lifecycle_manager_navigation]: Configuring controller_server
[component_container_isolated-1] [ERROR] [1699270565.076129614] [lifecycle_manager_navigation]: Failed to change state for node: controller_server
[component_container_isolated-1] [ERROR] [1699270565.076231787] [lifecycle_manager_navigation]: Failed to bring up all requested nodes. Aborting bringup.
[block_spawner.py-4] [INFO] [1699270565.147462197] [block_spawner]: Started block spawner service
[block_spawner.py-4] /opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/node.py:441: UserWarning: when declaring parameter named 'location_file', declaring a parameter only providing its name is deprecated. You have to either:
[block_spawner.py-4] 	- Pass a name and a default value different to "PARAMETER NOT SET" (and optionally a descriptor).
[block_spawner.py-4] 	- Pass a name and a parameter type.
[block_spawner.py-4] 	- Pass a name and a descriptor with `dynamic_typing=True
[block_spawner.py-4]   warnings.warn(
[block_spawner.py-4] [INFO] [1699270565.149069012] [block_spawner]: Using location file: /overlay_ws/install/tb3_worlds/share/tb3_worlds/maps/sim_house_locations.yaml
urdf_file_name : turtlebot3_waffle_pi.urdf
urdf_file_name : turtlebot3_waffle_pi.urdf
[INFO] [gzserver-5]: process started with pid [128]
[INFO] [gzclient-6]: process started with pid [130]
[INFO] [robot_state_publisher-7]: process started with pid [132]
[INFO] [spawn_entity.py-8]: process started with pid [134]
[robot_state_publisher-7] [INFO] [1699270568.481032482] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-7] [INFO] [1699270568.481124930] [robot_state_publisher]: got segment base_link
[robot_state_publisher-7] [INFO] [1699270568.481138890] [robot_state_publisher]: got segment base_scan
[robot_state_publisher-7] [INFO] [1699270568.481148175] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-7] [INFO] [1699270568.481157539] [robot_state_publisher]: got segment camera_rgb_frame
[robot_state_publisher-7] [INFO] [1699270568.481166852] [robot_state_publisher]: got segment camera_rgb_optical_frame
[robot_state_publisher-7] [INFO] [1699270568.481176356] [robot_state_publisher]: got segment caster_back_left_link
[robot_state_publisher-7] [INFO] [1699270568.481185545] [robot_state_publisher]: got segment caster_back_right_link
[robot_state_publisher-7] [INFO] [1699270568.481194703] [robot_state_publisher]: got segment imu_link
[robot_state_publisher-7] [INFO] [1699270568.481204244] [robot_state_publisher]: got segment wheel_left_link
[robot_state_publisher-7] [INFO] [1699270568.481213374] [robot_state_publisher]: got segment wheel_right_link
[spawn_entity.py-8] [INFO] [1699270568.769418089] [spawn_entity]: Spawn Entity started
[spawn_entity.py-8] [INFO] [1699270568.769761546] [spawn_entity]: Loading entity XML from file /opt/ros/humble/share/turtlebot3_gazebo/models/turtlebot3_waffle_pi/model.sdf
[spawn_entity.py-8] [INFO] [1699270568.771811601] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-8] [INFO] [1699270568.772135578] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-8] [INFO] [1699270568.776644157] [spawn_entity]: Calling service /spawn_entity
[spawn_entity.py-8] [INFO] [1699270568.800383094] [spawn_entity]: Spawn status: Entity [waffle_pi] already exists.
[spawn_entity.py-8] [ERROR] [1699270568.801019105] [spawn_entity]: Spawn service failed. Exiting.
[ERROR] [spawn_entity.py-8]: process has died [pid 134, exit code 1, cmd '/opt/ros/humble/lib/gazebo_ros/spawn_entity.py -entity waffle_pi -file /opt/ros/humble/share/turtlebot3_gazebo/models/turtlebot3_waffle_pi/model.sdf -x 0.0 -y 0.0 -z 0.01 --ros-args'].
[ERROR] [gzserver-5]: process has died [pid 128, exit code 255, cmd 'gzserver /overlay_ws/install/tb3_worlds/share/tb3_worlds/worlds/sim_house.world -slibgazebo_ros_init.so -slibgazebo_ros_factory.so -slibgazebo_ros_force_system.so --ros-args --params-file /turtlebot3_ws/install/turtlebot3_navigation2/share/turtlebot3_navigation2/param/waffle_pi.yaml --'].
[ERROR] [gzclient-6]: process has died [pid 130, exit code -6, cmd 'gzclient'].

The most interesting part is:

[component_container_isolated-1] [INFO] [1699270564.589522094] [nav2_container]: Load Library: /opt/ros/humble/lib/libsmoother_server_core.so
[rviz2-2] qt.qpa.xcb: could not connect to display :0
[rviz2-2] qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
[rviz2-2] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this 
[rviz2-2] Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb. 

Is there something I have missed? is qt not targetting the right platform? If so, how to indicate it?

Thank you

groot build fails

Hi,
Thank you very much for your tutorial, however when I run make build groot fails to build. I get the following error.
I am using your docker environment in Ubuntu 20.04. What should I do ?
Thank you !

Starting >>> groot                                                             
Failed <<< groot                                 [ 0.4 seconds ]               
Abandoned <<< turtlebot3_slam                       [ Unrelated job failed ]   
Abandoned <<< turtlebot3                            [ Unrelated job failed ]   
Finished <<< turtlebot3_simulations                [ 1.0 seconds ]             
Finished <<< turtlebot3_navigation                 [ 1.1 seconds ]             
_______________________________________________________________________________
Errors << groot:cmake /turtlebot3_ws/logs/groot/build.cmake.000.log            
CMake Error at /turtlebot3_ws/src/groot/CMakeLists.txt:23 (find_package):
  By not providing "Findament_index_cpp.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "ament_index_cpp", but CMake did not find one.

  Could not find a package configuration file provided by "ament_index_cpp"
  with any of the following names:

    ament_index_cppConfig.cmake
    ament_index_cpp-config.cmake

  Add the installation prefix of "ament_index_cpp" to CMAKE_PREFIX_PATH or
  set "ament_index_cpp_DIR" to a directory containing one of the above files.
  If "ament_index_cpp" provides a separate development package or SDK, be
  sure it has been installed.


cd /turtlebot3_ws/build/groot; catkin build --get-env groot | catkin env -si  /usr/bin/cmake /turtlebot3_ws/src/groot --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/turtlebot3_ws/devel/.private/groot -DCMAKE_INSTALL_PREFIX=/turtlebot3_ws/install; cd -

...............................................................................
Failed << groot:cmake                            [ Exited with code 1 ]        
Finished <<< turtlebot3_example                    [ 2.7 seconds ]             
[build] Summary: 12 of 15 packages succeeded.                                  
[build] Ignored: None.                                                         
[build] Warnings: None.                                                        
[build] Abandoned: 2 packages were abandoned.                                  
[build] Failed: 1 packages failed.                                             
[build] Runtime: 21.1 seconds total.                                           
[build] Note: Workspace packages have changed, please re-source setup files to use them.
The command '/bin/bash -c cd /turtlebot3_ws  && source /opt/ros/noetic/setup.bash  && rosdep install -y --from-paths src --ignore-src  && catkin build -j4' returned a non-zero code: 1
make: *** [Makefile:48: build-base] Error 1

Docker on Mac OS: `ros2: ddsi_udp_create_conn: set IP_MULTICAST_IF failed: Unsupported`

When trying to run the demo world docker:

$ docker compose up demo-world
[+] Running 1/1
 ! demo-world Warning                                                                                                                                                                                                                     1.7s 
[+] Building 1592.7s (27/27) FINISHED                                                                                                                                                                                     docker:desktop-linux
 => [demo-world internal] load .dockerignore                                                                                                                                                                                              0.0s
 => => transferring context: 2B                                                                                                                                                                                                           0.0s
 => [demo-world internal] load build definition from Dockerfile                                                                                                                                                                           0.0s
 => => transferring dockerfile: 3.48kB                                                                                                                                                                                                    0.0s
 => [demo-world internal] load metadata for docker.io/osrf/ros:humble-desktop                                                                                                                                                             1.3s
 => [demo-world base  1/16] FROM docker.io/osrf/ros:humble-desktop@sha256:f425b15248cfc24080a9a25a5f34be6f0b5ae68c6bddca0d50385eced97c8603                                                                                                0.0s
 => [demo-world internal] load build context                                                                                                                                                                                              0.0s
 => => transferring context: 2.96kB                                                                                                                                                                                                       0.0s
 => CACHED [demo-world base  2/16] RUN apt-get update && apt-get install -y --no-install-recommends  git libcanberra-gtk-module libcanberra-gtk3-module fuse3 libfuse2 libqt5svg5-dev  python3-pip python3-opencv python3-tk python3-pyq  0.0s
 => CACHED [demo-world base  3/16] RUN pip3 install matplotlib transforms3d                                                                                                                                                               0.0s
 => CACHED [demo-world base  4/16] RUN apt-get update && apt-get install -y --no-install-recommends  ros-humble-rmw-cyclonedds-cpp                                                                                                        0.0s
 => CACHED [demo-world base  5/16] RUN mkdir -p /turtlebot3_ws/src                                                                                                                                                                        0.0s
 => CACHED [demo-world base  6/16] WORKDIR /turtlebot3_ws/src                                                                                                                                                                             0.0s
 => CACHED [demo-world base  7/16] COPY dependencies.repos .                                                                                                                                                                              0.0s
 => [demo-world base  8/16] RUN vcs import < dependencies.repos                                                                                                                                                                          30.9s
 => [demo-world base  9/16] WORKDIR /turtlebot3_ws                                                                                                                                                                                        0.0s 
 => [demo-world base 10/16] RUN source /opt/ros/humble/setup.bash  && apt-get update -y  && rosdep install --from-paths src --ignore-src --rosdistro humble -y  && colcon build --symlink-install                                      1312.4s 
 => [demo-world base 11/16] WORKDIR /root/                                                                                                                                                                                                0.0s 
 => [demo-world base 12/16] RUN curl -o Groot2.AppImage https://s3.us-west-1.amazonaws.com/download.behaviortree.dev/groot2_linux_installer/Groot2-v1.0.1-x86_64.AppImage  && chmod a+x Groot2.AppImage                                   9.1s 
 => [demo-world base 13/16] RUN mkdir /tmp/runtime-root                                                                                                                                                                                   0.2s 
 => [demo-world base 14/16] RUN chmod -R 0700 /tmp/runtime-root                                                                                                                                                                           0.3s 
 => [demo-world base 15/16] WORKDIR /turtlebot3_ws                                                                                                                                                                                        0.0s 
 => [demo-world base 16/16] COPY ./docker/entrypoint.sh /                                                                                                                                                                                 0.0s 
 => [demo-world overlay 1/6] RUN mkdir -p /overlay_ws/src                                                                                                                                                                                 0.2s
 => [demo-world overlay 2/6] WORKDIR /overlay_ws                                                                                                                                                                                          0.0s
 => [demo-world overlay 3/6] COPY ./tb3_autonomy/ ./src/tb3_autonomy/                                                                                                                                                                     0.0s
 => [demo-world overlay 4/6] COPY ./tb3_worlds/ ./src/tb3_worlds/                                                                                                                                                                         0.0s
 => [demo-world overlay 5/6] RUN source /turtlebot3_ws/install/setup.bash  && rosdep install --from-paths src --ignore-src --rosdistro humble -y  && colcon build --symlink-install                                                     233.3s
 => [demo-world overlay 6/6] COPY ./docker/entrypoint.sh /                                                                                                                                                                                0.0s
 => [demo-world] exporting to image                                                                                                                                                                                                       4.7s
 => => exporting layers                                                                                                                                                                                                                   4.7s
 => => writing image sha256:1c66e902c79d63ccbcc8092853a63000845f5835d0f25751a065595821363021                                                                                                                                              0.0s
 => => naming to docker.io/library/turtlebot3_behavior:overlay                                                                                                                                                                            0.0s
[+] Running 2/2
 ✔ Container turtlebot3_behavior_demos-demo-world-1                                                                                                          Created                                                                      0.1s 
 ! demo-world The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                                                              0.0s 
Attaching to turtlebot3_behavior_demos-demo-world-1
turtlebot3_behavior_demos-demo-world-1  | Sourced ROS 2 humble
turtlebot3_behavior_demos-demo-world-1  | Sourced TurtleBot3 base workspace
turtlebot3_behavior_demos-demo-world-1  | Sourced autonomy overlay workspace
turtlebot3_behavior_demos-demo-world-1  | [INFO] [launch]: All log files can be found below /root/.ros/log/2023-09-20-12-51-48-720885-docker-desktop-1
turtlebot3_behavior_demos-demo-world-1  | [INFO] [launch]: Default logging verbosity is set to INFO
turtlebot3_behavior_demos-demo-world-1  | urdf_file_name : turtlebot3_waffle_pi.urdf
turtlebot3_behavior_demos-demo-world-1  | 1695214318.882020 [0]       ros2: ddsi_udp_create_conn: set IP_MULTICAST_IF failed: Unsupported
turtlebot3_behavior_demos-demo-world-1  | [ERROR] [1695214318.885605462] [rmw_cyclonedds_cpp]: rmw_create_node: failed to create domain, error Error
turtlebot3_behavior_demos-demo-world-1  | 
turtlebot3_behavior_demos-demo-world-1  | >>> [rcutils|error_handling.c:108] rcutils_set_error_state()
turtlebot3_behavior_demos-demo-world-1  | This error state is being overwritten:
turtlebot3_behavior_demos-demo-world-1  | 
turtlebot3_behavior_demos-demo-world-1  |   'error not set, at ./src/rcl/node.c:263'
turtlebot3_behavior_demos-demo-world-1  | 
turtlebot3_behavior_demos-demo-world-1  | with this new error message:
turtlebot3_behavior_demos-demo-world-1  | 
turtlebot3_behavior_demos-demo-world-1  |   'rcl node's rmw handle is invalid, at ./src/rcl/node.c:415'
turtlebot3_behavior_demos-demo-world-1  | 
turtlebot3_behavior_demos-demo-world-1  | rcutils_reset_error() should be called after error handling to avoid this.
turtlebot3_behavior_demos-demo-world-1  | <<<
turtlebot3_behavior_demos-demo-world-1  | [ERROR] [1695214318.888839420] [rcl]: Failed to fini publisher for node: 1
turtlebot3_behavior_demos-demo-world-1  | [ERROR] [launch]: Caught exception in launch (see debug for traceback): error creating node: rcl node's rmw handle is invalid, at ./src/rcl/node.c:415
turtlebot3_behavior_demos-demo-world-1 exited with code 1

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.