Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

RBDL IK Interface seg fault #8

Open
cmower opened this issue Mar 28, 2022 · 5 comments
Open

RBDL IK Interface seg fault #8

cmower opened this issue Mar 28, 2022 · 5 comments
Assignees

Comments

@cmower
Copy link
Owner

cmower commented Mar 28, 2022

The RBDL IK interface seg faults when running the example. The bug has been difficult to find since the output of RBDL is not being passed to stdout. I have worked out that RBDL is failing on rbdl.loadModel at this line. See below for a re-creation of the issue.

$ ipython
Python 3.8.10 (default, Mar 15 2022, 12:22:08) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.23.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import rbdl

In [2]: filename = '/home/chris/catkin_ws/src/ik_ros/ik_ros_examples/robots/lwr.urdf'

In [3]: m = rbdl.loadModel(filename, verbose=True, floating_base=True)
joint 'base_joint' child link 'lwr_arm_0_link' type = 6
  joint 'lwr_arm_0_joint' child link 'lwr_arm_1_link' type = 1
    joint 'lwr_arm_1_joint' child link 'lwr_arm_2_link' type = 1
      joint 'lwr_arm_2_joint' child link 'lwr_arm_3_link' type = 1
        joint 'lwr_arm_3_joint' child link 'lwr_arm_4_link' type = 1
          joint 'lwr_arm_4_joint' child link 'lwr_arm_5_link' type = 1
            joint 'lwr_arm_5_joint' child link 'lwr_arm_6_link' type = 1
              joint 'lwr_arm_6_joint' child link 'lwr_arm_7_link' type = 1
Error while processing joint 'base_joint': parent link 'base' could not be found.
+ Adding Body: lwr_arm_0_link
  parent_id  : 4294967295
  joint frame: X.E = 
          -1 -2.06624e-13            0
 2.06624e-13           -1            0
           0            0            1
X.r =    0    0 0.02
  joint dofs : 0
  body inertia: 
0.00381667          0          0
         0     0.0036          0
         0          0 0.00381667
  body mass   : 2
  body name   : lwr_arm_0_link
Segmentation fault (core dumped)

The error says that the base parent link could not be found, but it is there - see the following.

<link name="base">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<box size="1 1 0.04"/>
</geometry>
<material name="DarkGrey"/>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<box size="1 1 0.04"/>
</geometry>
</collision>
</link>

@stoutheo do you have any insights to why this might be happening? Could it be that the URDF is missing something that most other parsers don't need but RBDL requires?

This issue needs to be resolved before #7 can be merged. @stoutheo is it possible for you to provide a fix? I've tried to keep your RBDL node the same as it was in the ros_pybullet_interface - so the code should be fairly familiar.

@joaomoura24
Copy link
Collaborator

We had this problem before. I need to think about what is the issue, but it has to do with the base link name that the rbdl is expecting a given specific name.

@cmower
Copy link
Owner Author

cmower commented Mar 29, 2022

This seems to have been an issue. I tried renaming the base link as you suggest but this didn't make any difference. Adding <inertial>..</inertial> to the base link seems to resolve the issue when I load the model via ipython but something is happening at the same line, i.e. the node just stops. No output, the node doesn't die, nothing - very strange!

I tried catching the error with try/except but nothing seems to happen. It's as if once Python enters rbdl.loadModel in the ROS node it just hangs, like it's in some internal infinite while-loop.

@cmower
Copy link
Owner Author

cmower commented Mar 29, 2022

I'll try using a different URDF next.

@cmower
Copy link
Owner Author

cmower commented Mar 29, 2022

I added the kuka urdf/meshes using the pointer, see: 541836c

Same issue however, the node enters rbdl.loadModel and hangs. No exceptions are thrown, it just pauses.

@cmower
Copy link
Owner Author

cmower commented Mar 29, 2022

Just for reference, I verified that

  • in both ipython and in the ROS node I am linking to the same build of RBDL.
  • no issues are coming from old builds, re-built my catkin_ws from scratch and same issue persists

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants