Ask Your Question
0

URDF - IKfast joint mismatch

asked 2019-01-28 02:44:29 -0500

Will_robo gravatar image

Hello,

I am trying to setup IKfast on my robot, it all seems to go well until attempting to run demo.launch from the moveit_config package. When moveit! loads the IKfast kinematics solver there is a fatal error:

[FATAL] Joint numbers mismatch: URDF has 7 and IKFast has 6

My URDF has a mimic joint in it, I think this is the root of the problem. I am wondering if there is a work around? I have tried several variations of including the mimic joint in the moveit! planning group or not:

Here is what my IKfast set-up was :

~/harvester_7_axis/src/harvester_description/urdf$ openrave-robot.py
name                index parents      
---------------------------------------
world               0                  
base_link           1     world        
bed_link0           2     base_link    
carrage_link0       3     bed_link0    
gantry_link0        4     carrage_link0
gantry_link1        5     gantry_link0 
arm_link0           6     gantry_link1 
arm_link1           7     arm_link0    
arm_link2           8     arm_link1    
arm_link3           9     arm_link2    
arm_link4           10    arm_link3    
aa_tool_flange_link 11    arm_link4    
---------------------------------------
~/harvester_7_axis/src/harvester_description/urdf$ export BASE_LINK="0"
~/harvester_7_axis/src/harvester_description/urdf$ export EEF_LINK="10"

Here is the .dae joint info incase you want it:

~/harvester_7_axis/src/harvester_description/urdf$ openrave-robot.py "$MYROBOT_NAME".dae --info joints
name                 joint_index dof_index parent_link   child_link          mimic      
----------------------------------------------------------------------------------------
gantry_joint_0       0           0         carrage_link0 gantry_link0                   
gantry_joint_1       1           1         gantry_link0  gantry_link1                   
arm_joint_0          2           2         gantry_link1  arm_link0                      
arm_joint_2          3           3         arm_link1     arm_link2                      
arm_joint_3          4           4         arm_link2     arm_link3                      
arm_joint_4          5           5         arm_link3     arm_link4                      
fixed                -1          -1        world         base_link                      
bed_joint_0          -1          -1        base_link     bed_link0                      
carrage_joint_0      -1          -1        bed_link0     carrage_link0                  
arm_joint_1          -1          -1        arm_link0     arm_link1           arm_joint_0
aa_tool_flange_joint -1          -1        arm_link4     aa_tool_flange_link            
----------------------------------------------------------------------------------------
name                 joint_index dof_index parent_link   child_link          mimic

I used the following code to create the IKfast.cpp file:

export IKFAST_OUTPUT_PATH=`pwd`/ikfast61_"$PLANNING_GROUP".cpp
python `openrave-config --python-dir`/openravepy/_openravepy_/ikfast.py --robot="$MYROBOT_NAME".dae --iktype=transform6d --baselink="$BASE_LINK" --eelink="$EEF_LINK" --savefile="$IKFAST_OUTPUT_PATH"

Any help with how to solve my issue would be much appreciated, thanks for your help in advance.

P.S. if you need anymore information that can help just ask :D

edit retag flag offensive close merge delete

Comments

1

P.S. if you need anymore information that can help just ask :D

Just to satisfy my own curiousity: a picture of your robot :). Its name is "harvester" and from the output of --info joints it appears to be a regular 6 axis mounted on a gantry.

What is this harvesting ? :)

gvdhoorn gravatar image gvdhoorn  ( 2019-01-28 02:50:49 -0500 )edit

Thanks for the fast reply, but that's not really the information I meant...

Will_robo gravatar image Will_robo  ( 2019-01-28 03:07:30 -0500 )edit
1

Thanks for the fast reply, but that's not really the information I meant...

...

In any case: rdiankov/openrave#154 from 2012 appears to have not been resolved. Might want to ask what the status of mimic joints is there.

gvdhoorn gravatar image gvdhoorn  ( 2019-01-28 04:07:06 -0500 )edit
1

Probably supported, as evidenced by this github search.

gvdhoorn gravatar image gvdhoorn  ( 2019-01-28 04:08:00 -0500 )edit

Yes, IKfast does support mimic joints. But the problem is that moveit! thinks the URDF is 7 joints (so its including the mimic joint in its joint count) and IKfast solution is 6 joints (so does not include its mimic joint in the joint count). but im not sure how to bypass this fatal error :S

Will_robo gravatar image Will_robo  ( 2019-01-28 04:24:34 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-01-28 05:38:23 -0500

Will_robo gravatar image

I have actually managed to solve the problem I think:

I edited the ikfast_plugin/src/robot_name_ikfast_moveit_plugin.cpp to increase the num_joint of the ikfast so that it matches the moveit! joint number (num_joints_ + 1):

Line 384:

while (link->name != base_frame_ && joint_names_.size() <= (num_joints_+1))

Line 439:

if (joint_names_.size() != num_joints_)
  {
      ROS_FATAL_STREAM_NAMED(name_, "Joint numbers mismatch: URDF has " << joint_names_.size() << " and IKFast has " << (num_joints_+1));
      return false;
  }

Thanks for the help @gvdhoorn :D

edit flag offensive delete link more

Comments

I don't feel that's actually a solution: that check is there for a reason. Even if it's incorrectly implemented in the case of mimic joints in the chain, the proper approach would seem to be to get MoveIt fixed. Not increase an integer, as that essentially turns it into a meaningless check.

gvdhoorn gravatar image gvdhoorn  ( 2019-01-28 05:44:10 -0500 )edit

Yes :S But I used moveit_commander to plan/execute to pose's in the w/s, and its working well, the solutions found in roughly 0.02s which must be ikfast, I think the check is certainly useful but may be redundant in my case. But I'll keep you updated if I find a "proper" solution :D

Will_robo gravatar image Will_robo  ( 2019-01-28 05:56:17 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-01-28 02:44:29 -0500

Seen: 159 times

Last updated: Jan 28 '19