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

UR Kinematics malfunctions if URDF base link is different #389

Open
atyshka opened this issue Oct 26, 2018 · 9 comments
Open

UR Kinematics malfunctions if URDF base link is different #389

atyshka opened this issue Oct 26, 2018 · 9 comments

Comments

@atyshka
Copy link

atyshka commented Oct 26, 2018

I have a UR10 on a mobile base and I've created a new URDF with the UR atop my robot. In the SRDF I have base_footprint (the root of this urdf) specified as a virtual joint. I wouldn't mind planning in the UR base frame, but that's not an option as MoveIt only works if it's planning in the URDF base frame. Here's the problem: when I attempt to plan to the cursor location, the kinematics plugin plans to the cursor location in the base_link frame instead of the base_link frame. I thought I did something wrong with my moveit config but sure enough, everything works fine if I use the KDL plugin. Since it seems this plugin is frame-unaware, is there something in the plugin code I need to change to get this to function properly? See the videos below:

Correct behavior in KDL:
kdl
In UR Kinematics:
peek 2018-10-26 16-13

@atyshka
Copy link
Author

atyshka commented Oct 26, 2018

UPDATE: After digging through the code, I found this in ur_moveit_plugin.cpp:

bool URKinematicsPlugin::initialize(const std::string &robot_description, const std::string& group_name, const std::string& base_frame, const std::string& tip_frame, double search_discretization) { ROS_INFO("Kinematics base frame %s", base_frame); setValues(robot_description, group_name, base_frame, tip_frame, search_discretization); ... more stuff ... }

If I change the code to call setValues with my "base_footprint" frame instead of the frame passed in initialize(), I get correct behavior. It would seem the issue is that initialize is called with the wrong base frame. But how can that be if the KDL Plugin works fine?

@atyshka
Copy link
Author

atyshka commented Oct 30, 2018

@kphawkins When you wrote this plugin, you clearly intended for base frames other than the UR to be used. I noticed around line 608 in ur_moveit_plugin that you have some transform code. Can you provide some insight on how you configured your srdf with this to get a working result?

@shaun-edwards
Copy link
Member

Related: moveit/moveit#1014

In short, KDL is able to handle other frames, but that's not supposed to happen. There is some discussion related to this in the PR I reference above.

@atyshka
Copy link
Author

atyshka commented Oct 30, 2018

@shaun-edwards I did check out that pr. What do you mean by KDL is able to handle other frames, but that’s not supposed to happen? There should be a way to get this to work on a mobile base. I don’t mind if I can only plan in the UR link frames, it’s just that somehow the frames are getting mixed up in Rviz. The original KDL packaged with moveit handles the mobile base just fine, it’s something with UR KinematicsPlugin that doesn’t work right.

@shaun-edwards
Copy link
Member

See the discussion here: moveit/moveit#1014 (comment)

@atyshka
Copy link
Author

atyshka commented Oct 30, 2018

@shaun-edwards In that post @gavanderhoorn argues that in general the IK/FK shouldn’t be expected to handle other frames than it was designed for. I get that. My problem is with the fact that UR KinematicsPlugin claims to be able to do this. The lines around 608 in ur_moveit_plugin are specifically in there to handle extra stuff in the URDF. The first post in the PR actually mentions this “shim layer” in ur kinematics.

@kphawkins
Copy link
Contributor

kphawkins commented Oct 31, 2018 via email

@atyshka
Copy link
Author

atyshka commented Oct 31, 2018

@kphawkins thanks for the info. Here is my SRDF. I have one group that includes everything from the base of my mobile base to the tip of the UR10 and another that includes gripper stuff. Please note that I have remapped the ur10 base link from base_link to ur10_base_link, and base link is now the base of my whole robot. I’ve changed all references in ur_kinematics to ur10_base_link too. Theoretically this is exactly the same as your “excel” planning group.

@UmutUz
Copy link

UmutUz commented May 4, 2021

@atyshka did you ever find a fix for that?

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

No branches or pull requests

4 participants