ROS2 controller manager migration from foxy to humble: controller manager not available
This question is related to the following one: https://answers.ros.org/question/4127...
The described answer is not working in my case.
Edit 2:
Short version for everyone trying:
git clone https://git.fh-aachen.de/mascor-public/leo_simulator
git clone https://git.fh-aachen.de/mascor-public/leo-common-ros2
build it and run
ros2 launch leo_gazebo leo_gazebo.launch.py
This will end in the error "controller manager not available".
Long version:
Here is my launch file:
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration, Command
from launch_ros.actions import Node, PushRosNamespace
def generate_launch_description():
pkg_share = get_package_share_directory("leo_gazebo")
leo_description_share = get_package_share_directory("leo_description")
return LaunchDescription(
[
DeclareLaunchArgument(
name="model",
default_value=[leo_description_share, "/urdf/leo_sim.urdf.xacro"],
description="Absolute path to robot urdf.xacro file",
),
DeclareLaunchArgument(
name="fixed",
default_value="false",
description='Set to "true" to spawn the robot fixed to the world',
),
DeclareLaunchArgument(
name="robot_ns", default_value="/", description="Namespace of the robot"
),
DeclareLaunchArgument(
name="model_name",
default_value="leo",
description="The name of the spawned model in Gazebo",
),
PushRosNamespace(LaunchConfiguration("robot_ns")),
Node(
name="robot_state_publisher",
package="robot_state_publisher",
executable="robot_state_publisher",
parameters=[
{
"robot_description": Command(
[
"xacro ",
LaunchConfiguration("model"),
" fixed:=",
LaunchConfiguration("fixed"),
]
)
}
],
),
Node(
name="spawn_entity",
package="gazebo_ros",
executable="spawn_entity.py",
# fmt: off
arguments=[
"-topic", "robot_description",
"-entity", LaunchConfiguration("model_name"),
],
# fmt: on
),
Node(
name="joint_state_broadcaster_spawner",
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
),
Node(
name="diff_drive_controller_spawner",
package="controller_manager",
executable="spawner",
arguments=["diff_drive_controller", "--controller-manager", "/controller_manager"],
),
]
)
And this is the error log after launching it:
[INFO] [launch]: All log files can be found below /home/patrick/.ros/log/2023-03-09-12-12-04-729782-dell-10526
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [gzserver-1]: process started with pid [10528]
[INFO] [gzclient-2]: process started with pid [10530]
[INFO] [robot_state_publisher-3]: process started with pid [10532]
[INFO] [spawn_entity.py-4]: process started with pid [10534]
[INFO] [spawner-5]: process started with pid [10536]
[INFO] [spawner-6]: process started with pid [10538]
[robot_state_publisher-3] [INFO] [1678360327.041513962] [robot_state_publisher]: got segment antenna_link
[robot_state_publisher-3] [INFO] [1678360327.041788561] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-3] [INFO] [1678360327.041826152] [robot_state_publisher]: got segment base_link
[robot_state_publisher-3] [INFO] [1678360327.041848917] [robot_state_publisher]: got segment camera_frame
[robot_state_publisher-3] [INFO] [1678360327.041869751] [robot_state_publisher]: got segment camera_optical_frame
[robot_state_publisher-3] [INFO] [1678360327.041891126] [robot_state_publisher]: got segment imu_frame
[robot_state_publisher-3] [INFO] [1678360327.041911788] [robot_state_publisher]: got segment rocker_L_link
[robot_state_publisher-3] [INFO] [1678360327.041932055] [robot_state_publisher]: got segment rocker_R_link
[robot_state_publisher-3] [INFO] [1678360327.041951416] [robot_state_publisher]: got segment wheel_FL_link
[robot_state_publisher-3] [INFO] [1678360327.041971515] [robot_state_publisher]: got segment wheel_FR_link
[robot_state_publisher-3] [INFO] [1678360327.041991344] [robot_state_publisher]: got segment wheel_RL_link
[robot_state_publisher-3] [INFO] [1678360327.042011296] [robot_state_publisher]: got segment wheel_RR_link
[spawn_entity.py-4] [INFO] [1678360327.554963416] [spawn_entity]: Spawn Entity started
[spawn_entity.py-4] [INFO] [1678360327.555265999] [spawn_entity]: Loading entity published on topic robot_description
[spawn_entity.py-4] /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-4] warnings.warn(
[spawn_entity.py-4] [INFO] [1678360327.561197332] [spawn_entity]: Waiting for entity xml on robot_description
[spawn_entity.py-4] [INFO] [1678360327.573506918] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-4] [INFO] [1678360327.573778448] [spawn_entity]: Waiting for service /spawn_entity
[spawner-6] [INFO] [1678360329.436630319] [diff_drive_controller_spawner]: Waiting for '/controller_manager' node to exist
[spawner-5] [INFO] [1678360329.444134048] [joint_state_broadcaster_spawner]: Waiting for '/controller_manager' node to exist ...
Can you please, upload your leo_sim.urdf.xacro file also.
Thanks for posting the question over here.
Thanks for following up :)
See my edit 1.
Can you upload the full package to GitHub and share the link?
Thanks
Sure. Well... It's not GitHub, but this should work.
I currently don't have access to the sources of the description, but you can install them using
package 'leo_description' not found
Can you add this also
weird. It is working for me.
But here you go:
I am launching
ros2 launch leo_gazebo leo_gazebo.launch.py
btw