ros-controls / ros2_control

Generic and simple controls framework for ROS 2
https://control.ros.org
Apache License 2.0
471 stars 289 forks source link

Controller manager cannot load ackermann_steering_controller (ROS2 Humble, Gazebo Ignition: Fortress) #1055

Closed aleksandrsizmailovs closed 1 year ago

aleksandrsizmailovs commented 1 year ago

Description. While loading ackermann_steering_controller, controller manager throws an error claiming that it cannot find "ackermann_steering_controller" controller class.

Definition of ros2 control in urdf: `

$(find hunter2_control)/config/hunter2_controller.yaml

`

Here is the hunter2_controller.yaml file:

`controller_manager: ros__parameters:

update_rate: 50
use_sim_time: true

joint_state_controller:
  type: joint_state_broadcaster/JointStateBroadcaster

ackermann_steering_controller:
  type: ackermann_steering_controller/AckermannSteeringController

ackermann_steering_controller: ros__parameters:

reference_timeout: 2.0
front_steering: true
open_loop: false
velocity_rolling_window_size: 10
position_feedback: true
use_stamped_vel: true
rear_wheels_names: [right_rear_joint, left_rear_joint]
front_wheels_names: [front_steer_right_joint, front_steer_left_joint]

wheelbase: 0.65
front_wheel_track: 0.605
rear_wheel_track: 0.605
front_wheels_radius: 0.33
rear_wheels_radius: 0.33

joint_state_controller: ros__parameters: type: joint_state_controller/JointStateController`

Based on the output in the terminal (below), the "ackermann_steering_controller" controller class is not available. Thus, the question is should I load it somehow differently, or the implementation of the controller class is going to be in the future?

[ruby $(which ign) gazebo-1] [INFO] [1686900694.269824006] [resource_manager]: Initialize hardware 'IgnitionSystem' [ruby $(which ign) gazebo-1] [WARN] [1686900694.269843363] [gz_ros2_control]: On init... [ruby $(which ign) gazebo-1] [INFO] [1686900694.270145451] [resource_manager]: Successful initialization of hardware 'IgnitionSystem' [ruby $(which ign) gazebo-1] [INFO] [1686900694.270247837] [resource_manager]: 'configure' hardware 'IgnitionSystem' [ruby $(which ign) gazebo-1] [INFO] [1686900694.270258397] [gz_ros2_control]: System Successfully configured!

[ruby $(which ign) gazebo-1] [INFO] [1686900694.270282323] [resource_manager]: 'activate' hardware 'IgnitionSystem'

[ruby $(which ign) gazebo-1] [INFO] [1686900694.270304114] [gz_ros2_control]: Loading controller_manager [ruby $(which ign) gazebo-1] [GUI] [Wrn] [Application.cc:797] [QT] file::/EntityTree/EntityTree.qml:148:7: QML ToolButton: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead. [ruby $(which ign) gazebo-1] [GUI] [Wrn] [Application.cc:797] [QT] file::/EntityTree/EntityTree.qml:148:7: QML ToolButton: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead. [ruby $(which ign) gazebo-1] [GUI] [Wrn] [Application.cc:797] [QT] file::/WorldStats/WorldStats.qml:53:3: QML RowLayout: Binding loop detected for property "x" [ruby $(which ign) gazebo-1] [GUI] [Wrn] [Application.cc:797] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:52:3: QML RenderWindowOverlay: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead. [ruby $(which ign) gazebo-1] [GUI] [Wrn] [Application.cc:797] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:67:3: QML EntityContextMenu: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead. [ruby $(which ign) gazebo-1] [GUI] [Wrn] [Application.cc:797] [QT] file::/Gazebo/GazeboDrawer.qml:147:3: QML Dialog: Binding loop detected for property "implicitHeight" [ruby $(which ign) gazebo-1] [INFO] [1686900694.421363201] [controller_manager]: Loading controller 'joint_state_controller' [ruby $(which ign) gazebo-1] [INFO] [1686900694.431534054] [controller_manager]: Setting use_sim_time=True for joint_state_controller to match controller manager (see ros2_control#325 for details) [ruby $(which ign) gazebo-1] [INFO] [1686900694.431900836] [controller_manager]: Loading controller 'ackermann_steering_controller' [ruby $(which ign) gazebo-1] [ERROR] [1686900694.431920633] [controller_manager]: Loader for controller 'ackermann_steering_controller' (type 'ackermann_steering_controller/AckermannSteeringController') not found. [ruby $(which ign) gazebo-1] [INFO] [1686900694.431928619] [controller_manager]: Available classes:

[spawner-6] [INFO] [1686900694.432749489] [spawner_joint_state_controller]: Loaded joint_state_controller [spawner-7] [FATAL] [1686900694.432914405] [spawner_ackermann_steering_controller]: Failed loading controller ackermann_steering_controller [ruby $(which ign) gazebo-1] [INFO] [1686900694.434377345] [controller_manager]: Configuring controller 'joint_state_controller' [ruby $(which ign) gazebo-1] [INFO] [1686900694.434645969] [joint_state_controller]: 'joints' or 'interfaces' parameter is empty. All available state interfaces will be published [ERROR] [spawner-7]: process has died [pid 6200, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner ackermann_steering_controller -c /controller_manager --ros-args']. [ruby $(which ign) gazebo-1] [Wrn] [Component.hh:144] Trying to serialize component with data type [N3sdf3v125WorldE], which doesn't have operator<<. Component will not be serialized. [ruby $(which ign) gazebo-1] [WARN] [1686900694.718882612] [gz_ros2_control]: Desired controller update period (0.02 s) is slower than the gazebo simulation period (0.001 s). [spawner-6] [INFO] [1686900694.760488570] [spawner_joint_state_controller]: Configured and activated joint_state_controller [ERROR] [ros2_control_node-5]: process has died [pid 6196, exit code -6, cmd '/opt/ros/humble/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_holybwuj --params-file /home/aleksandrs/ros2_ws/install/hunter2_control/share/hunter2_control/config/hunter2_controller.yaml']. [INFO] [spawner-6]: process has finished cleanly [pid 6198]

P.S. It is my first time writing an issue on github... Also, I do not understand why the code fields are displayed so badly.

saikishor commented 1 year ago

Hello @S4Shimis!

Seems like you are missing to install the ackermann_steering_controller. You can install it by sudo apt-get install ros-humble-ackermann-steering-controller

bmagyar commented 1 year ago

You can also always run ros2 control list_controller_types to get the currently available controllers in your system.

bmagyar commented 1 year ago

Feel free to reopen the issue if the problem persists.