currently I am working on visualizing a drone in Gazebo. My base is the sjtu_drone. I am trying to control the propellers of my drone with ros2_control but when i start the ros2 controller manager the terminal says "Controller manager not available" after checking the node list. It appears a node named "simple_drone/controller_manager". How can I fix the issue that the controller manager starts in simple_drone?
Error in Terminal:
[gzserver-4] [INFO] [1710412893.630305338] [simple_drone.controller_manager]: Loading controller 'joint_state_broadcaster'
[gzserver-4] [INFO] [1710412893.662219724] [simple_drone.controller_manager]: Configuring controller 'joint_state_broadcaster'
[gzserver-4] [INFO] [1710412893.662911110] [simple_drone.joint_state_broadcaster]: 'joints' or 'interfaces' parameter is empty. All available state interfaces will be published
[gzserver-4] [INFO] [1710412893.840692078] [simple_drone.controller_manager]: Loading controller 'rotor_controller'
[gzserver-4] [INFO] [1710412894.056333002] [simple_drone.controller_manager]: Configuring controller 'rotor_controller'
[gzserver-4] [ERROR] [1710412894.056406458] [simple_drone.rotor_controller]: 'joints' parameter was empty
[gzserver-4] [WARN] [1710412894.056439109] [simple_drone.rotor_controller]: Error occurred while doing error handling.
[gzserver-4] [ERROR] [1710412894.056459593] [simple_drone.controller_manager]: After configuring, controller 'rotor_controller' is in state 'unconfigured' , expected inactive.
My Controller yaml-File:
simple_drone/controller_manager:
ros__parameters:
update_rate: 10
use_sim_time: true
rotor_controller:
type: velocity_controllers/JointGroupVelocityController
joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster
rotor_controller:
ros__parameters:
joints:
- rotation1
- rotation2
- rotation3
- rotation4
My controller.launch.py
def generate_launch_description():
robot_description = ParameterValue(
Command(
[
"xacro ",
os.path.join(get_package_share_directory("drone_description"), "urdf", "drone.urdf.xacro")
]
),
value_type=str
)
robot_state_publisher = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
parameters=[{"robot_description": robot_description}]
)
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=[
"joint_state_broadcaster",
"--controller-manager",
"simple_drone/controller_manager"
]
)
rotor_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=[
"rotor_controller",
"--controller-manager",
"simple_drone/controller_manager"
]
)
return LaunchDescription([
robot_state_publisher,
joint_state_broadcaster_spawner,
rotor_controller_spawner
])
My URDF.xacro: (only the transmission tag and gazebo tag)
<xacro:macro name="rotor1_transmission">
<transmission name="rotation1_tran">
<plugin>transmission_interface/SimpleTransmission</plugin>
<actuator name="rotation1_motor" role="actuator1"/>
<joint name="rotation1" role="joint1">
<mechanical_reduction>1.0</mechanical_reduction>
</joint>
</transmission>
</xacro:macro>
<xacro:macro name="rotor2_transmission">
<transmission name="rotation2_tran">
<plugin>transmission_interface/SimpleTransmission</plugin>
<actuator name="rotation2_motor" role="actuator2"/>
<joint name="rotation2" role="joint2">
<mechanical_reduction>1.0</mechanical_reduction>
</joint>
</transmission>
</xacro:macro>
...
<gazebo>
<plugin name="gazebo_ros2_control" filename="libgazebo_ros2_control.so">
<robot_param>robot_description</robot_param>
<robot_param_node>robot_state_publisher</robot_param_node>
<parameters>$(find drone_bringup)/config/rotor_controller.yaml</parameters>
</plugin>
</gazebo>
```
--debug
and also pin the output ofros2 topic list
, it will be easier to solve the problem. $\endgroup$