I have a ros2 project which is running in one system(with ros2 humble) perfectly but i am getting error on other system(with ros2 foxy). I need to run it on 2nd system as my first system dosen't has a graphics card and I am trying to train a Reinforcement learning model.
The full source code with steps to execute are available at: https://github.com/nice-user1/ros2_acker
NOTE: The code might not produce error in you system. I think i got error because i ran this code on a pc in which i have recently installed ros2.
NOTE: In the launch file, I have changed:
ackermann_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["asc"],
)
TO
ackermann_spawner = Node(
package="controller_manager",
executable="spawner.py",
arguments=["asc"],
)
the ".py" difference which is required to run the bot in foxy."
I am getting the following error when trying to launch a 4 wheel robot with ackeman steering controller.
[gzserver-4] [ERROR] [1707452057.685204860] [controller_manager]: Loader for controller 'asc' not found.
[ERROR] [spawner.py-7]: process has died [pid 11896, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py asc --ros-args'].
Terminal Output:
ros2 launch race_it rsp.launch.py
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [11876]
[INFO] [joint_state_publisher-2]: process started with pid [11878]
[INFO] [rviz2-3]: process started with pid [11880]
[INFO] [gzserver-4]: process started with pid [11882]
[INFO] [gzclient -5]: process started with pid [11884]
[INFO] [spawn_entity.py-6]: process started with pid [11888]
[INFO] [spawner.py-7]: process started with pid [11896]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link chassis_link had 4 children
[robot_state_publisher-1] Link front_left_hinge had 1 children
[robot_state_publisher-1] Link front_left_link had 0 children
[robot_state_publisher-1] Link front_right_hinge had 1 children
[robot_state_publisher-1] Link front_right_link had 0 children
[robot_state_publisher-1] Link rear_left_link had 0 children
[robot_state_publisher-1] Link rear_right_link had 0 children
[robot_state_publisher-1] [INFO] [1707452055.941781873] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1707452055.941842196] [robot_state_publisher]: got segment chassis_link
[robot_state_publisher-1] [INFO] [1707452055.941848866] [robot_state_publisher]: got segment front_left_hinge
[robot_state_publisher-1] [INFO] [1707452055.941852469] [robot_state_publisher]: got segment front_left_link
[robot_state_publisher-1] [INFO] [1707452055.941855559] [robot_state_publisher]: got segment front_right_hinge
[robot_state_publisher-1] [INFO] [1707452055.941858690] [robot_state_publisher]: got segment front_right_link
[robot_state_publisher-1] [INFO] [1707452055.941861669] [robot_state_publisher]: got segment rear_left_link
[robot_state_publisher-1] [INFO] [1707452055.941864743] [robot_state_publisher]: got segment rear_right_link
[spawner.py-7] [INFO] [1707452056.077780697] [spawner_asc]: Waiting for /controller_manager services
[spawn_entity.py-6] [INFO] [1707452056.264494914] [spawn_entity]: Spawn Entity started
[spawn_entity.py-6] [INFO] [1707452056.265402694] [spawn_entity]: Loading entity published on topic robot_description
[spawn_entity.py-6] [INFO] [1707452056.267455715] [spawn_entity]: Waiting for entity xml on robot_description
[joint_state_publisher-2] [INFO] [1707452056.328889187] [joint_state_publisher]: Waiting for robot_description to be published on the robot_description topic...
[spawn_entity.py-6] [INFO] [1707452056.351479418] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-6] [INFO] [1707452056.351703468] [spawn_entity]: Waiting for service /spawn_entity
[rviz2-3] [INFO] [1707452056.502326668] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-3] [INFO] [1707452056.502462903] [rviz2]: OpenGl version: 4.6 (GLSL 4.6)
[rviz2-3] [INFO] [1707452056.541439091] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-3] Parsing robot urdf xml string.
[spawn_entity.py-6] [INFO] [1707452057.354769010] [spawn_entity]: Calling service /spawn_entity
[gzserver-4] Warning [parser_urdf.cc:1130] multiple inconsistent <name> exists due to fixed joint reduction overwriting previous value [Gazebo/Blue] with [Gazebo/Green].
[gzserver-4] Warning [parser_urdf.cc:1130] multiple inconsistent <name> exists due to fixed joint reduction overwriting previous value [Gazebo/Blue] with [Gazebo/Red].
[gzserver-4] Warning [parser_urdf.cc:1130] multiple inconsistent <name> exists due to fixed joint reduction overwriting previous value [Gazebo/Blue] with [Gazebo/Green].
[gzserver-4] Warning [parser_urdf.cc:1130] multiple inconsistent <name> exists due to fixed joint reduction overwriting previous value [Gazebo/Blue] with [Gazebo/Red].
[spawn_entity.py-6] [INFO] [1707452057.373071391] [spawn_entity]: Spawn status: Successfully sent factory message to Gazebo.
[INFO] [spawn_entity.py-6]: process has finished cleanly [pid 11888]
[gzserver-4] [INFO] [1707452057.472799835] [gazebo_ros2_control]: Loading gazebo_ros2_control plugin
[gzserver-4] [INFO] [1707452057.474547679] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in namespace: /
[gzserver-4] [INFO] [1707452057.474712194] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in ros 2 node: gazebo_ros2_control
[gzserver-4] [INFO] [1707452057.474744288] [gazebo_ros2_control]: Loading parameter files /home/pratham/Desktop/Pratham/misc/ros2_acker/install/race_it/share/race_it/config/controller/my_controllers.yaml
[gzserver-4] [INFO] [1707452057.476062252] [gazebo_ros2_control]: connected to service!! robot_state_publisher
[gzserver-4] [INFO] [1707452057.476430900] [gazebo_ros2_control]: Recieved urdf from param server, parsing...
[gzserver-4] [INFO] [1707452057.482758994] [gazebo_ros2_control]: Loading joint: front_left_hinge_joint
[gzserver-4] [INFO] [1707452057.482793501] [gazebo_ros2_control]: State:
[gzserver-4] [INFO] [1707452057.482801424] [gazebo_ros2_control]: position
[gzserver-4] [INFO] [1707452057.482821224] [gazebo_ros2_control]: Command:
[gzserver-4] [INFO] [1707452057.482827754] [gazebo_ros2_control]: position
[gzserver-4] [INFO] [1707452057.482846866] [gazebo_ros2_control]: Loading joint: front_right_hinge_joint
[gzserver-4] [INFO] [1707452057.482853506] [gazebo_ros2_control]: State:
[gzserver-4] [INFO] [1707452057.482857999] [gazebo_ros2_control]: position
[gzserver-4] [INFO] [1707452057.482862852] [gazebo_ros2_control]: Command:
[gzserver-4] [INFO] [1707452057.482867314] [gazebo_ros2_control]: position
[gzserver-4] [INFO] [1707452057.482873115] [gazebo_ros2_control]: Loading joint: rear_left_joint
[gzserver-4] [INFO] [1707452057.482877907] [gazebo_ros2_control]: State:
[gzserver-4] [INFO] [1707452057.482882814] [gazebo_ros2_control]: velocity
[gzserver-4] [INFO] [1707452057.482887665] [gazebo_ros2_control]: Command:
[gzserver-4] [INFO] [1707452057.482892149] [gazebo_ros2_control]: velocity
[gzserver-4] [INFO] [1707452057.482897501] [gazebo_ros2_control]: Loading joint: rear_right_joint
[gzserver-4] [INFO] [1707452057.482902196] [gazebo_ros2_control]: State:
[gzserver-4] [INFO] [1707452057.482906606] [gazebo_ros2_control]: velocity
[gzserver-4] [INFO] [1707452057.482911016] [gazebo_ros2_control]: Command:
[gzserver-4] [INFO] [1707452057.482915236] [gazebo_ros2_control]: velocity
[gzserver-4] [INFO] [1707452057.483025053] [gazebo_ros2_control]: Loading controller_manager
[gzserver-4] [WARN] [1707452057.488805408] [gazebo_ros2_control]: Desired controller update period (0.0333333 s) is slower than the gazebo simulation period (0.001 s).
[gzserver-4] [INFO] [1707452057.488882867] [gazebo_ros2_control]: Loaded gazebo_ros2_control.
[gzserver-4] [INFO] [1707452057.685163156] [controller_manager]: Loading controller 'asc'
[gzserver-4] [ERROR] [1707452057.685204860] [controller_manager]: Loader for controller 'asc' not found.
[gzserver-4] [INFO] [1707452057.685212517] [controller_manager]: Available classes:
[gzserver-4] [INFO] [1707452057.685221409] [controller_manager]: controller_manager/test_controller
[gzserver-4] [INFO] [1707452057.685225693] [controller_manager]: controller_manager/test_controller_failed_init
[gzserver-4] [INFO] [1707452057.685229383] [controller_manager]: controller_manager/test_controller_with_interfaces
[gzserver-4] [INFO] [1707452057.685233156] [controller_manager]: diff_drive_controller/DiffDriveController
[gzserver-4] [INFO] [1707452057.685236984] [controller_manager]: effort_controllers/JointGroupEffortController
[gzserver-4] [INFO] [1707452057.685240652] [controller_manager]: force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster
[gzserver-4] [INFO] [1707452057.685244516] [controller_manager]: forward_command_controller/ForwardCommandController
[gzserver-4] [INFO] [1707452057.685248123] [controller_manager]: imu_sensor_broadcaster/IMUSensorBroadcaster
[gzserver-4] [INFO] [1707452057.685251681] [controller_manager]: joint_state_broadcaster/JointStateBroadcaster
[gzserver-4] [INFO] [1707452057.685255145] [controller_manager]: joint_state_controller/JointStateController
[gzserver-4] [INFO] [1707452057.685258594] [controller_manager]: joint_trajectory_controller/JointTrajectoryController
[gzserver-4] [INFO] [1707452057.685262045] [controller_manager]: position_controllers/JointGroupPositionController
[gzserver-4] [INFO] [1707452057.685265702] [controller_manager]: tricycle_controller/TricycleController
[gzserver-4] [INFO] [1707452057.685269334] [controller_manager]: velocity_controllers/JointGroupVelocityController
[ERROR] [spawner.py-7]: process has died [pid 11896, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py asc --ros-args'].
Most likely it would be some issues related to some ros2 packages not being installed which i am unable to figure out.
Thanks