lbr-stack / lbr_fri_ros2_stack

ROS 1/2 integration for KUKA LBR IIWA 7/14 and Med 7/14
https://lbr-stack.readthedocs.io/en/latest/lbr_fri_ros2_stack/lbr_fri_ros2_stack/doc/lbr_fri_ros2_stack.html
Apache License 2.0
139 stars 39 forks source link

Simulation Controller Manager not available #207

Closed ZixuanLiu-Justin closed 1 day ago

ZixuanLiu-Justin commented 1 week ago

Hi,

I was trying to run the Gazebo simulation. All I did was simply build the lbr_fri_ros2_stack following the README. When I tried to run the command:

ros2 launch lbr_bringup gazebo.launch.py model:=med7

I got the following information:

[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [static_transform_publisher-1]: process started with pid [6254]
[INFO] [robot_state_publisher-2]: process started with pid [6256]
[INFO] [gzserver-3]: process started with pid [6258]
[INFO] [gzclient-4]: process started with pid [6260]
[INFO] [spawn_entity.py-5]: process started with pid [6262]
[INFO] [spawner-6]: process started with pid [6264]
[INFO] [spawner-7]: process started with pid [6266]
[static_transform_publisher-1] [INFO] [1727102340.126604628] [static_transform_publisher_OW0wQrWhNq9I0b3t]: Spinning until stopped - publishing transform
[static_transform_publisher-1] translation: ('0.000000', '0.000000', '0.000000')
[static_transform_publisher-1] rotation: ('0.000000', '0.000000', '0.000000', '1.000000')
[static_transform_publisher-1] from 'world' to 'lbr/world'
[robot_state_publisher-2] [INFO] [1727102340.318619760] [lbr.robot_state_publisher]: got segment link_0
[robot_state_publisher-2] [INFO] [1727102340.318826493] [lbr.robot_state_publisher]: got segment link_1
[robot_state_publisher-2] [INFO] [1727102340.318855407] [lbr.robot_state_publisher]: got segment link_2
[robot_state_publisher-2] [INFO] [1727102340.318876294] [lbr.robot_state_publisher]: got segment link_3
[robot_state_publisher-2] [INFO] [1727102340.318893118] [lbr.robot_state_publisher]: got segment link_4
[robot_state_publisher-2] [INFO] [1727102340.318908570] [lbr.robot_state_publisher]: got segment link_5
[robot_state_publisher-2] [INFO] [1727102340.318923070] [lbr.robot_state_publisher]: got segment link_6
[robot_state_publisher-2] [INFO] [1727102340.318936236] [lbr.robot_state_publisher]: got segment link_7
[robot_state_publisher-2] [INFO] [1727102340.318950050] [lbr.robot_state_publisher]: got segment link_ee
[robot_state_publisher-2] [INFO] [1727102340.318967504] [lbr.robot_state_publisher]: got segment world
[spawn_entity.py-5] [INFO] [1727102341.364526461] [lbr.spawn_entity]: Spawn Entity started
[spawn_entity.py-5] [INFO] [1727102341.365267419] [lbr.spawn_entity]: Loading entity published on topic robot_description
[spawn_entity.py-5] /opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/qos.py:307: UserWarning: DurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL is deprecated. Use DurabilityPolicy.TRANSIENT_LOCAL instead.
[spawn_entity.py-5]   warnings.warn(
[spawn_entity.py-5] [INFO] [1727102341.368554986] [lbr.spawn_entity]: Waiting for entity xml on robot_description
[spawner-6] [INFO] [1727102343.057804502] [lbr.spawner_joint_state_broadcaster]: Waiting for '/lbr/controller_manager' node to exist
[spawner-7] [INFO] [1727102343.194270736] [lbr.spawner_joint_trajectory_controller]: Waiting for '/lbr/controller_manager' node to exist
[spawner-6] [INFO] [1727102345.089074095] [lbr.spawner_joint_state_broadcaster]: Waiting for '/lbr/controller_manager' node to exist
[spawner-7] [INFO] [1727102345.229995776] [lbr.spawner_joint_trajectory_controller]: Waiting for '/lbr/controller_manager' node to exist
[spawner-6] [INFO] [1727102347.117158120] [lbr.spawner_joint_state_broadcaster]: Waiting for '/lbr/controller_manager' node to exist
[spawner-7] [INFO] [1727102347.261977962] [lbr.spawner_joint_trajectory_controller]: Waiting for '/lbr/controller_manager' node to exist
[spawner-6] [INFO] [1727102349.140503838] [lbr.spawner_joint_state_broadcaster]: Waiting for '/lbr/controller_manager' node to exist
[spawner-7] [INFO] [1727102349.291946605] [lbr.spawner_joint_trajectory_controller]: Waiting for '/lbr/controller_manager' node to exist
[spawner-6] [ERROR] [1727102350.976043997] [lbr.spawner_joint_state_broadcaster]: Controller manager not available
[ERROR] [spawner-6]: process has died [pid 6264, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_state_broadcaster --controller-manager controller_manager --ros-args -r __ns:=/lbr'].
[spawner-7] [ERROR] [1727102351.315496115] [lbr.spawner_joint_trajectory_controller]: Controller manager not available
[ERROR] [spawner-7]: process has died [pid 6266, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_trajectory_controller --controller-manager controller_manager --ros-args -r __ns:=/lbr'].

It says the Controller manager not available, and the Gazebo does not show the robot. Any sugguestions on this? Thanks

mhubii commented 1 week ago

hi @ZixuanLiu-Justin somehow this issue sometimes occurs on freshly installed systems on first launch. Can you try simply re-launching?

ZixuanLiu-Justin commented 1 week ago

hi @ZixuanLiu-Justin somehow this issue sometimes occurs on freshly installed systems on first launch. Can you try simply re-launching?

Hi, so I tried to reboot my computer and colcon rebuild the repo, tried to re-launch it, the problem was still here. But one thing is that the computer I used to run is old, could this be a potential problem?

mhubii commented 1 week ago

no worries, from the error message it is hard to tell what the issue is. Which version of Ubuntu and which ROS version are you using?

Did you make sure to install all dependencies?

rosdep install --from-paths src -i -r -y

Another alternative is to run this inside a Docker container https://lbr-stack.readthedocs.io/en/latest/lbr_fri_ros2_stack/docker/doc/docker.html

Your last solution is to run a mock setup (no physics simulation, but maybe this will help you test some simple things)

ros2 launch lbr_bringup mock.launch.py model:=med7
ros2 launch lbr_bringup move_group.launch.py model:=med7 rviz:=true
hiqb217 commented 3 days ago

I had a similar issue pop up on a new-ish Ubuntu 22.04 install on the latest Humble branch.

It was working a bit sporadically, and then completely stopped working after I did a wildcard install of gazebo packages for ros-humble with: apt install ros-humble-gazebo-*

What helped me was to launch Gazebo in verbose mode, I changed this line: https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/71bf3f8957697b31fb887106c5dbe02074d9a9ea/lbr_bringup/launch/gazebo.launch.py#L40

My modified line is: ld.add_action(GazeboMixin.include_gazebo(launch_arguments={'verbose': 'true'}.items()))

The debug output was pretty useful, it was struggling to find the standard empty world that Gazebo uses and it pointed out some errors to me saying I should run: source usr/share/gazebo-11/setup.bash

Not entirely sure if something I installed has messed with setting environmental variables, but in any case it does seem to work with the project now so thought I'd post in case launching Gazebo in verbose mode helps you out too!

ZixuanLiu-Justin commented 1 day ago

Thank you for your information @hiqb217. After several attempts last week, I just gave up and used the docker instead. It seems the team @mhubii have just merged gazebo ignition to the main branch, so I was able to clone the new repo with ignition, and it works fine for me, at least for the demo. I really appreciate this as I am more familiar with the ignition :).

mhubii commented 16 hours ago

sounds great, thank you for briefly confirming @ZixuanLiu-Justin