ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROS2 controller manager migration from foxy to humble: controller manager not available

asked 2023-03-09 06:08:41 -0600

RodBelaFarin gravatar image

updated 2023-03-10 06:18:33 -0600

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 ...
(more)
edit retag flag offensive close merge delete

Comments

Can you please, upload your leo_sim.urdf.xacro file also.

Thanks for posting the question over here.

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2023-03-09 06:13:10 -0600 )edit

Thanks for following up :)

See my edit 1.

RodBelaFarin gravatar image RodBelaFarin  ( 2023-03-09 06:31:23 -0600 )edit

Can you upload the full package to GitHub and share the link?

Thanks

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2023-03-10 01:41:18 -0600 )edit

Sure. Well... It's not GitHub, but this should work.

git clone https://git.fh-aachen.de/mascor-public/leo_simulator

I currently don't have access to the sources of the description, but you can install them using

apt install ros-humble-leo-description
RodBelaFarin gravatar image RodBelaFarin  ( 2023-03-10 04:19:48 -0600 )edit

package 'leo_description' not found

Can you add this also

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2023-03-10 04:30:29 -0600 )edit

weird. It is working for me.

But here you go:

git clone https://git.fh-aachen.de/mascor-public/leo-common-ros2
RodBelaFarin gravatar image RodBelaFarin  ( 2023-03-10 04:39:28 -0600 )edit

I am launching ros2 launch leo_gazebo leo_gazebo.launch.py btw

RodBelaFarin gravatar image RodBelaFarin  ( 2023-03-10 04:42:20 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-04-21 09:52:48 -0600

Have you found a solution to this issue? Because I'm currently facing the same problem

edit flag offensive delete link more

Comments

Same, I tried using my package on humble instead of foxy and started this error, now my robots wont spawn in gazebo

i1Cps gravatar image i1Cps  ( 2023-06-14 22:08:21 -0600 )edit

Hey, did you find any solution to this?

suche gravatar image suche  ( 2023-06-16 08:59:38 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2023-03-09 06:08:41 -0600

Seen: 3,036 times

Last updated: Mar 10 '23