-
Notifications
You must be signed in to change notification settings - Fork 525
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
Use kinematics plugin instead of inverse Jacobian for servo IK #1434
Conversation
961e5f0
to
376fcb4
Compare
Codecov Report
@@ Coverage Diff @@
## main #1434 +/- ##
==========================================
+ Coverage 50.87% 50.88% +0.02%
==========================================
Files 381 381
Lines 31740 31778 +38
==========================================
+ Hits 16143 16168 +25
- Misses 15597 15610 +13
Continue to review full report at Codecov.
|
376fcb4
to
8babf96
Compare
…lt to inverse Jacobian if an IK plugin is not present or doesn't support the group. Update servo_example launch file to use MoveItConfigsBuilder
55bc1ca
to
3720e92
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put more detail in the PR description of how to test this with/without bio_ik?
I put a print statement in servo_calcs
and I see that it's finding a kinematics plugin, but I'm not really sure where it found that plugin from or how to configure it ;)
If bio_ik is going to be available in MoveIt2 by default, then I think it should become the default in Servo and we can simplify this a lot.
@AndyZe I've added more to the description showing how to change the kinematics plugin. |
3720e92
to
e478dc0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for these very nitpicky changes. LGTM after this.
…king_test to check for closeness of hand transform instead of joint positions, as IK solutions can vary based on IK solver
e478dc0
to
d03d200
Compare
Found a bug in how rotations are applied while doing some singularity avoidance testing, we should hold off on merging for now. |
…rotation about origin
7bb054b
to
0938bca
Compare
@AndyZe I've fixed an issue where rotations were always being applied in the same frame--would you mind taking a second look at the recent changes (lines 613-633)? |
Eigen::AngleAxisd(delta_x[5], Eigen::Vector3d::UnitZ()); | ||
tf_rot_delta.rotate(q); | ||
|
||
// Poses passed to IK solvers are assumed to be in the tip link (EE) reference frame |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these comments ought to be more generic. It's not necessarily the tip link reference frame, but rather whatever the IK reference frame is set to, right?
Otherwise the feature of switching from World to EE frame as the user's frame of reference (mentioned in the tutorial) would not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it really should be more generic -- but it's actually more than just the comment. Really, we shouldn't just blindly use tf_moveit_to_ee_frame_
, but rather a transform from what the IK solver knows as the base frame -> what the IK solver knows as the tip frame (which is likely the same as what servo knows as moveit -> ee frame, but not necessarily).
Switching of the reference frame for the incoming twist commands is already handled above in the same function, so either way it should work for any incoming frame of reference.
See the latest commit for my solution to this
Description
This changes servo to utilize a kinematics plugin if one is defined. If one is not present or doesn't support the group, default to inverse Jacobian
Also updated servo_example launch file to use MoveItConfigsBuilder.
To test, the current moveit_servo tutorial can be used as is. The modification of the servo_example launch file in this repository also includes a reference to kinematics.yaml for the servo node.
The kinematics plugin used by the servo node is defined via ROS parameters, which may be loaded from a yaml file. If using
MoveItConfigsBuilder
in your servo launch file (as is done inservo_example.launch.py
in this PR), you can pass the necessary parameters as such:In the above example, the
kinematics.yaml
file is taken from themoveit_resources
repository in the workspace, specificallymoveit_resources/panda_moveit_config/config/kinematics.yaml
. By default, this yaml file defines the KDL plugin to be used. To usebio_ik
as the solver, first clone theros2
branch of the repository into your workspace. Then edit the above yaml file to contain the following:The timeout parameter is ignored for servo, as it uses a fraction of the publish period instead.
The actual ROS parameter names that get passed by loading the yaml file are of the form
robot_description_kinematics.<group_name>.<param_name>
, e.g.robot_description_kinematics.panda_arm.kinematics_solver
Checklist