Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update joint_trjectory controller with mimic joint support #411

Open
wants to merge 1 commit into
base: kinetic-devel
Choose a base branch
from

Conversation

k-okada
Copy link
Contributor

@k-okada k-okada commented Mar 23, 2019

@mintar I have tested your mimic_joint_gazebo_tutorial and it works fine for the small example, but when I tried to apply that plugins to a more complex model, for example, humanoid hand model, it did not work well. I thank this because when we calculate

value = multiplier * other_joint_value + offset.

where the mimic joint plugin uses other_joint_value as current Position of the joint in gazebo simulation, but I think we have to use current Desired(Commanded) Position in the controller, because the current position in gazebo simulation oscillates and that makes mimic joint unstable.

Here is my workaround for supporting mimic joint in joint trajectory controller and it works well on your tutorial code. How do you think?

see https://github.com/k-okada/mimic_joint_gazebo_tutorial.git for example

gripper_controller:
  type: position_controllers/JointTrajectoryController
  joints:
    - right_finger_joint
  mimic_joints:
    - left_finger_joint
  gains:
    right_finger_joint: {p: 20.0, i: 0.1, d: 0.2}
    left_finger_joint: {p: 20.0, i: 0.1, d: 0.2}

we added mimic_joints tag for the list of the mimic joint, and you have to add gains section. Mimic joint params (muliplier/offset) is taken from urdf model

see https://github.com/k-okada/mimic_joint_gazebo_tutorial.git for example

```
gripper_controller:
  type: position_controllers/JointTrajectoryController
  joints:
    - right_finger_joint
  mimic_joints:
    - left_finger_joint
  gains:
    right_finger_joint: {p: 20.0, i: 0.1, d: 0.2}
    left_finger_joint: {p: 20.0, i: 0.1, d: 0.2}
```
we added `mimic_joints` tag for the list of the mimic joint, and you have to add gains section. Mimic joint params (muliplier/offset) is taken from urdf model
k-okada added a commit to gundam-global-challenge/gundam_robot that referenced this pull request Mar 23, 2019
@mintar
Copy link

mintar commented Mar 25, 2019

+1

I think your analysis is spot on. I have also observed this instability with even slightly more complex models in Gazebo, such as the Robotiq 2 Finger Gripper. The instability is even bigger when there are external forces, such as trying to grasp an object.

Most of the mimic joints in that model could be replaced by properly modeling the parallel kinematics as a kinematic loop in SDF, but there needs stil to be one mimic joint (to ensure that the right and left fingers move in sync). I haven't tested this PR, but it sounds like it could enable us to get rid of the mimic joint plugin entirely.

@mathias-luedtke
Copy link
Contributor

IMHO mimic joints should not be controlled actively.
Instead, mimic joints should be handled in RobotHW, e.g. with transmission support.
This has the advantage that it would work for all controllers.

k-okada added a commit to gundam-global-challenge/gundam_robot that referenced this pull request Apr 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants