fmrico / book_ros2

550 stars 112 forks source link

error running ros2 launch br2_tiago sim.launch.py #4

Closed AdrianCobo closed 2 years ago

AdrianCobo commented 2 years ago

Type of bug

Issue Description

ros2 launch br2_tiago sim.launch.py not working

A) Typo/Error Description

Waiting for '/controller_manager' node to exist joy_teleop has stopped unexpectedly

Screenshot

Screenshot from 2022-10-02 10-15-09 Screenshot from 2022-10-02 10-15-31 Screenshot from 2022-10-02 10-15-24

how to reproduce

Steps to reproduce the behavior:

  1. run in a terminal: ros2 launch br2_tiago sim.launch.py

Desktop :

fmrico commented 2 years ago

Yes, you are right, @AdrianCobo. The simulated robot is not as stable as I wish, even less in Humble. Sometimes you must try 1-3 times until it is correctly started. The controllers sometimes crash, and you must restart. Usually, I test if it has started correctly using the teleoperator. It works better with Foxy (the version for which I wrote the book).

Let's see if the PAL people improve the stability. Otherwise, I will consider preparing another robot, but getting one with a neck fully working is difficult.

I hope you can get it working with little effort.

Francisco

AdrianCobo commented 2 years ago

Okay, thanks.

AdrianCobo commented 2 years ago

I solved the problem with the help of pal robotics github team.

Github issue

I hope it works for you too!

fmrico commented 2 years ago

Great!!

May you share the fix here to help any other reader?

Thanks!!

AdrianCobo commented 2 years ago

yeh sure.

1) add in the file: ~/bookros2_ws/src/book_ros2/third_parties.repos: ThirdParty/tiago_navigation: type: git url: https://github.com/pal-robotics/tiago_navigation.git version: humble-devel ThirdParty/tiago_moveit_config: type: git url: https://github.com/pal-robotics/tiago_moveit_config.git version: humble-devel 2) in ~/bookros2_ws/src ($ means shell input) $ vcs import . < book_ros2/third_parties.repos 3) in ~/bookros2_ws $ rosdep install --from-paths src --ignore-src -r -y 4) in ~/bookros2_ws colcon build --symlink-install 5)change to Cyclone DDS. With the Fast-DDS they are having some issues $ export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp $ apt-get install -y ros-humble-rmw-cyclonedds-cpp 6)install packages $ apt-get install ros-humble-gazebo-ros2-control or $ apt-get install ros-humble-gazebo-ros2-control-* <---recommended 7) Close the shell or reboot the pc(recommended) 8) ros2 launch br2_tiago sim.launch.py world_name:=factory still do not work for me so i execute: $ ros2 launch tiago_gazebo tiago_gazebo.launch.py world_name:=factory 9) ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r cmd_vel:=key_vel do not work for me neither so i execute this command in order to move the robot: $ ros2 topic pub -r 10 /mobile_base_controller/cmd_vel_unstamped geometry_msgs/Twist "linear: {x: 0.3}"

I know that this solution are not perfect but the pal robotics github team confirmed me that they are working on this issues and will get a solution soon.

I hope this work for you too and if you have any question about this solution, I will try to answer.

If you want to see the issue that I opened on the pal-robotics github: github issue

Zephyr69 commented 2 years ago

I have a different issue with br2_tiago. The simulation launches every time, but publishing Twist messages to /key_vel or any other /*_vel node does not make the bot move. The nodes do receive the messages.

It's on ubuntu 20.04, ros2 Foxy.

AdrianCobo commented 2 years ago

Try: ros2 topic pub -r 10 /mobile_base_controller/cmd_vel_unstamped geometry_msgs/Twist "linear: {x: 0.3}"

Zephyr69 commented 2 years ago

Try: ros2 topic pub -r 10 /mobile_base_controller/cmd_vel_unstamped geometry_msgs/Twist "linear: {x: 0.3}"

It didn't work. The errors when launching the simulation are:

[spawner.py-6] [ERROR] [1666754984.840645708] [spawner_joint_state_broadcaster]: Controller manager not available [spawn_entity.py-4] [INFO] [1666754984.922411513] [spawn_entity]: Calling service /spawn_entity [spawner.py-5] [ERROR] [1666754984.977820889] [spawner_mobile_base_controller]: Controller manager not available [ERROR] [spawner.py-6]: process has died [pid 80275, exit code 1, cmd '/home/jetson/bookros2_ws/install/controller_manager/lib/controller_manager/spawner.py joint_state_broadcaster --controller-manager controller_manager --controller-type joint_state_broadcaster/JointStateBroadcaster --param-file /home/jetson/bookros2_ws/install/tiago_controller_configuration/share/tiago_controller_configuration/config/joint_state_broadcaster.yaml --ros-args']. [ERROR] [spawner.py-5]: process has died [pid 80273, exit code 1, cmd '/home/jetson/bookros2_ws/install/controller_manager/lib/controller_manager/spawner.py mobile_base_controller --controller-manager controller_manager --controller-type diff_drive_controller/DiffDriveController --param-file /home/jetson/bookros2_ws/install/tiago_controller_configuration/share/tiago_controller_configuration/config/mobile_base_controller.yaml --ros-args']. [spawner.py-7] [ERROR] [1666754985.425048296] [spawner_torso_controller]: Controller manager not available [ERROR] [spawner.py-7]: process has died [pid 80280, exit code 1, cmd '/home/jetson/bookros2_ws/install/controller_manager/lib/controller_manager/spawner.py torso_controller --controller-manager controller_manager --controller-type joint_trajectory_controller/JointTrajectoryController --param-file /home/jetson/bookros2_ws/install/tiago_controller_configuration/share/tiago_controller_configuration/config/torso_controller.yaml --ros-args']. [spawner.py-8] [ERROR] [1666754985.950180989] [spawner_head_controller]: Controller manager not available [ERROR] [spawner.py-8]: process has died [pid 80290, exit code 1, cmd '/home/jetson/bookros2_ws/install/controller_manager/lib/controller_manager/spawner.py head_controller --controller-manager controller_manager --controller-type joint_trajectory_controller/JointTrajectoryController --param-file /home/jetson/bookros2_ws/install/tiago_controller_configuration/share/tiago_controller_configuration/config/head_controller.yaml --ros-args'].

Then I tried all the steps you mentioned in the post above, and the result is the same.

Zephyr69 commented 2 years ago

Try: ros2 topic pub -r 10 /mobile_base_controller/cmd_vel_unstamped geometry_msgs/Twist "linear: {x: 0.3}"

I think my issue with foxy simulation is jetson-specific; I went through the process on a desktop VM and everything works (including ros2 launch br2_tiago sim.launch.py). Thanks for the help!