ZebraDevs / robot_controllers

Robot control infrastructure
92 stars 79 forks source link

How to control the value of "gripper_finger_joint" using "robot_controllers::FollowJointTrajectoryController" #79

Closed s-kidera closed 2 years ago

s-kidera commented 2 years ago

Hi, I'm trying to add "gripper_finger_joint" to "robot_controllers::FollowJointTrajectoryController" and control it at the same time as the other joints, but it fails.

The JointHandlePtr is obtained with https://github.com/fetchrobotics/robot_controllers/blob/ros1/robot_controllers/src/follow_joint_trajectory.cpp#L100-L106 and each joint is controlled using this value. This control includes getPosition, setPosition, and so on.

So I tried to get the value of "gripper_finger_joint" by adding the following two lines to https://github.com/fetchrobotics/fetch_robots/blob/melodic-devel/fetch_bringup/config/default_controllers.yaml#L22-L33.

As a result, the value of j in "JointHandlePtr j = manager_->getJointHandle(jointnames[i])" became zero, and JointHandlePtr could not be obtained. If it is "gripper_finger_joint", will it be implemented differently from other joints? Does this implementation usually work?

Thanks in advance.

mikeferguson commented 2 years ago

I think this is probably not possible at this time - you'll note there is a separate ROS driver for the gripper and so the gripper finger joints are not accessible in the main driver:

https://github.com/fetchrobotics/fetch_robots/blob/melodic-devel/fetch_bringup/launch/fetch.launch#L28-L40

It might be possible to reach out to the folks at Fetch directly via their service program and see if they have any possible workarounds.

s-kidera commented 2 years ago

Thanks for the feedback. I understand that this implementation doesn't work.

https://github.com/fetchrobotics/fetch_robots/blob/melodic-devel/fetch_bringup/config/default_controllers.yaml does not have a definition for "gripper_driver". Is it possible to control "gripper_finger_joint" like any other joint by defining "gripper_driver" additionally? Is there an example of the settings?

mikeferguson commented 2 years ago

I'm going to guess that the gripper_driver doesn't use robot_controllers - it just hard codes the action interface - but I wrote it so many years ago (and it's closed source at Fetch), that I just don't know. I think you'll have to open a support ticket with the folks at Fetch.

s-kidera commented 2 years ago

Thank you for the information. I will consider how to avoid using the gripper_driver directly.