ros / kdl_parser

kdl_parser and kdl_parser_py provide tools to construct a KDL tree from an XML robot representation in URDF.
67 stars 62 forks source link

Used keys for Orocos #38

Closed ahcorde closed 4 years ago

ahcorde commented 4 years ago

With this PR https://github.com/ros/rosdistro/pull/23841/files Orokos could be installed via rosdep

ahcorde commented 4 years ago

Maybe for this changes we need to target noetic-devel branch. Because this keys are not availables for bionic

ahcorde commented 4 years ago

@ros-pull-request-builder retest this please

ahcorde commented 4 years ago

this error has appeared. is the python3-pykdl working fine?

15:38:46 [ROSUNIT] Outputting test results to /tmp/ws/test_results/kdl_parser_py/rostest-test_test_kdl_parser.xml
15:38:46 python: /build/orocos-kdl-mPkyII/orocos-kdl-1.4.0/python_orocos_kdl/PyKDL/std_string.sip:52: int convertTo_std_string(PyObject*, void**, int*, PyObject*): Assertion `PyUnicode_Check(s)' failed.
ahcorde commented 4 years ago

Maybe is this the issue https://github.com/orocos/orocos_kinematics_dynamics/pull/229 ?

sloretz commented 4 years ago

Retargeted at noetic-devel since melodic should keep using ros packages.

sloretz commented 4 years ago

Build Status

sloretz commented 4 years ago

this error has appeared. is the python3-pykdl working fine?

Investigating, minimal reproducible example:

import urdf_parser_py.urdf as urdf
import kdl_parser_py.urdf

xml = """<?xml version="1.0"?>
<robot name="physics">
  <link name="base_link"/>
</robot>
"""

model = urdf.URDF.from_xml_string(xml)
(ok, tree) = kdl_parser_py.urdf.treeFromUrdfModel(model)
sloretz commented 4 years ago

Even smaller example:

$ python3 -c "import PyKDL; PyKDL.Tree('foobar')"
python3: /build/orocos-kdl-mPkyII/orocos-kdl-1.4.0/python_orocos_kdl/PyKDL/std_string.sip:52: int convertTo_std_string(PyObject*, void**, int*, PyObject*): Assertion `PyUnicode_Check(s)' failed.
Aborted (core dumped)
sloretz commented 4 years ago

Another user encountered same bug: https://github.com/orocos/orocos_kinematics_dynamics/issues/59#issuecomment-369870840

ahcorde commented 4 years ago

I was able to remove the error with this branch orocos/orocos_kinematics_dynamics#229

sloretz commented 4 years ago

I was able to remove the error with this branch orocos/orocos_kinematics_dynamics#229

Since we're using python3-pykdl from upstream, we'll need to get it fixed in Debian Buster and Ubuntu Focal. I opened bugs upstream.

In the meantime, maybe we can workaround the issue by avoiding any KDL api's that use strings?

sloretz commented 4 years ago

Avoid APIs that cause KDL to crash in 80b0918

sloretz commented 4 years ago

It seems there's no way to avoid the string APIs, at least I can't avoid addSegment() :( . This will need to wait for the bug to be fixed upstream.

now exiting InteractiveConsole...
Traceback (most recent call last):
  File "mre.py", line 241, in <module>
    (ok, tree) = kdl_parser_py.urdf.treeFromUrdfModel(model)
  File "/home/sloretz/ws/noetic/src/kdl_parser/kdl_parser_py/kdl_parser_py/urdf.py", line 130, in treeFromUrdfModel
    if not _add_children_to_tree(robot_model, robot_model.link_map[child], tree):
  File "/home/sloretz/ws/noetic/src/kdl_parser/kdl_parser_py/kdl_parser_py/urdf.py", line 96, in _add_children_to_tree
    if not tree.addSegment(sgm):
TypeError: addSegment(self, segment: Segment, hook_name: object): not enough arguments
[Inferior 1 (process 17992) exited with code 01]