a2s-institute / youbot_simulation

Packages to run the KUKA youBot in the Gazebo simulation with ROS
23 stars 42 forks source link

Fix addClaimedResources #11

Closed mintar closed 5 years ago

mintar commented 6 years ago

Without this commit, the controller didn't properly set the hardware_interface name, so the claimed resource management didn't work. Also, it overwrote the values of the previous hw interfaces (effort + position) with the last one (velocity). Out of luck, no resources were claimed for the effort and position interfaces though.

Before:

$ rosservice call /controller_manager/list_controllers
controller:
  -
    name: "joint_state_controller"
    state: "running"
    type: "joint_state_controller/JointStateController"
    claimed_resources:
      -
        hardware_interface: "hardware_interface::JointStateInterface"
        resources: []
  -
    name: "base_controller"
    state: "running"
    type: "steered_wheel_base_controller/SteeredWheelBaseController"
    claimed_resources:
      -
        hardware_interface: ''
        resources: [caster_joint_bl, caster_joint_br, caster_joint_fl, caster_joint_fr, wheel_joint_bl,
  wheel_joint_br, wheel_joint_fl, wheel_joint_fr]
  -
    name: "arm_1/gripper_controller"
    state: "running"
    type: "effort_controllers/JointTrajectoryController"
    claimed_resources:
      -
        hardware_interface: "hardware_interface::EffortJointInterface"
        resources: [gripper_finger_joint_l, gripper_finger_joint_r]
  -
    name: "arm_1/arm_controller"
    state: "running"
    type: "effort_controllers/JointTrajectoryController"
    claimed_resources:
      -
        hardware_interface: "hardware_interface::EffortJointInterface"
        resources: [arm_joint_1, arm_joint_2, arm_joint_3, arm_joint_4, arm_joint_5]

After:

$ rosservice call /controller_manager/list_controllers
controller:
  [...]
  -
    name: "base_controller"
    state: "running"
    type: "steered_wheel_base_controller/SteeredWheelBaseController"
    claimed_resources:
      -
        hardware_interface: "hardware_interface::VelocityJointInterface"
        resources: [caster_joint_bl, caster_joint_br, caster_joint_fl, caster_joint_fr, wheel_joint_bl,
  wheel_joint_br, wheel_joint_fl, wheel_joint_fr]
  [...]
moriarty commented 5 years ago

SRTM.

@svenschneider, @sthoduka & @deebuls who's maintaining this repository now? I just opened up the PRs because I have some unpushed changes for Melodic. But it seems it was never bloomed into Kinetic either.

sthoduka commented 5 years ago

thanks @mintar