ros2_controllers icon indicating copy to clipboard operation
ros2_controllers copied to clipboard

cannot make JointGroupVelocityController work

Open muttistefano opened this issue 2 years ago • 2 comments

Hi all, i'm using ros2_controllers on rolling to control a robot with the velocity interface.

My controllers config looks like this :

forward_velocity_controller:
      type: velocity_controllers/JointGroupVelocityController

forward_velocity_controller:
  ros__parameters:
    joints:
      - shoulder_pan_joint
      - shoulder_lift_joint
      - elbow_joint
      - wrist_1_joint
      - wrist_2_joint
      - wrist_3_joint
      # interface_name: velocity

when I show the hardware interfaces with the CLI command, it shows:

command interfaces
	elbow_joint/position [available] [unclaimed]
	elbow_joint/velocity [available] [claimed]
	shoulder_lift_joint/position [available] [unclaimed]
	shoulder_lift_joint/velocity [available] [claimed]
	shoulder_pan_joint/position [available] [unclaimed]
	shoulder_pan_joint/velocity [available] [claimed]
	wrist_1_joint/position [available] [unclaimed]
	wrist_1_joint/velocity [available] [claimed]
	wrist_2_joint/position [available] [unclaimed]
	wrist_2_joint/velocity [available] [claimed]
	wrist_3_joint/position [available] [unclaimed]
	wrist_3_joint/velocity [available] [claimed]

The controller picks up the commands published on "/forward_velocity_controller/commands", I checked by printing them in the forwardcommandcontroller Update call. After the controller receives the commands, they are not passed down to the hardware interface. I also tested the hardware interface extensively, and I never receive commands from the controller. Am I doing something wrong?

muttistefano avatar Feb 28 '23 14:02 muttistefano

Running the controller manager with level debug, shows this:

Deduced interface prefix 'shoulder_pan_joint' - searching for the controller with the same name.
[ros2_control_node-1] [DEBUG] [1677662455.266703502] [ControllerManager::utils]: Required command interface 'shoulder_pan_joint/velocity' with prefix 'shoulder_pan_joint' is not reference interface.
[ros2_control_node-1] [DEBUG] [1677662455.266711384] [ControllerManager::utils]: Deduced interface prefix 'shoulder_lift_joint' - searching for the controller with the same name.
[ros2_control_node-1] [DEBUG] [1677662455.266718056] [ControllerManager::utils]: Required command interface 'shoulder_lift_joint/velocity' with prefix 'shoulder_lift_joint' is not reference interface.
[ros2_control_node-1] [DEBUG] [1677662455.266725295] [ControllerManager::utils]: Deduced interface prefix 'elbow_joint' - searching for the controller with the same name.
[ros2_control_node-1] [DEBUG] [1677662455.266731897] [ControllerManager::utils]: Required command interface 'elbow_joint/velocity' with prefix 'elbow_joint' is not reference interface.
[ros2_control_node-1] [DEBUG] [1677662455.266739593] [ControllerManager::utils]: Deduced interface prefix 'wrist_1_joint' - searching for the controller with the same name.
[ros2_control_node-1] [DEBUG] [1677662455.266746390] [ControllerManager::utils]: Required command interface 'wrist_1_joint/velocity' with prefix 'wrist_1_joint' is not reference interface.
[ros2_control_node-1] [DEBUG] [1677662455.266753378] [ControllerManager::utils]: Deduced interface prefix 'wrist_2_joint' - searching for the controller with the same name.
[ros2_control_node-1] [DEBUG] [1677662455.266759739] [ControllerManager::utils]: Required command interface 'wrist_2_joint/velocity' with prefix 'wrist_2_joint' is not reference interface.
[ros2_control_node-1] [DEBUG] [1677662455.266766476] [ControllerManager::utils]: Deduced interface prefix 'wrist_3_joint' - searching for the controller with the same name.
[ros2_control_node-1] [DEBUG] [1677662455.266772893] [ControllerManager::utils]: Required command interface 'wrist_3_joint/velocity' with prefix 'wrist_3_joint' is not reference interface.

I cannot tell if it's related. Thanks

muttistefano avatar Mar 01 '23 09:03 muttistefano

You interfaces are claimed. Therefore, they are passed. (I am quite certain because having a bug there would influence all the tests and users we have).

Which version, hardware interface are you using. What other relevant details you can provide?

destogl avatar Mar 07 '23 16:03 destogl