Skip to content

URDF not parsable from python wrapper when bio_ik is find_package'd #29

@timonegk

Description

@timonegk

The problem

I am using the MoveIt RobotModelLoader to load a URDF from the ros parameter server. The URDF will not be parsed when the following two conditions are fulfilled:

  1. The RobotModelLoader is initialized in a function that is called from python, i.e. in a python module/wrapper
  2. bio_ik is listed as a catkin component in CMakeLists.txt

Reproducible example:

  1. cd catkin_ws/src && catkin create pkg minimal_example
  2. Put the following files in the new catkin package:
CMakeLists.txt
cmake_minimum_required(VERSION 2.8.3)
project(minimal_example)

find_package(catkin REQUIRED COMPONENTS
        roscpp
        bio_ik
        moveit_ros_planning
)

find_package(PythonLibs COMPONENTS Interpreter Development)
find_package(Boost REQUIRED COMPONENTS python)

catkin_package()

include_directories(
        ${catkin_INCLUDE_DIRS}
        ${Boost_INCLUDE_DIRS}
        ${PYTHON_INCLUDE_DIRS}
)

add_library(wrapper SHARED wrapper.cpp)
add_dependencies(wrapper ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(wrapper ${catkin_LIBRARIES} ${Boost_LIBRARIES})
set_target_properties(wrapper PROPERTIES
        PREFIX ""
        LIBRARY_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_PYTHON_DESTINATION}
)
wrapper.cpp
#include <boost/python.hpp>
#include <moveit/robot_model_loader/robot_model_loader.h>

void start() {
    robot_model_loader::RobotModelLoader rml("robot_description", true);
}

BOOST_PYTHON_MODULE (wrapper) {
  using namespace boost::python;

  def("start", &start);
}
  1. Build the package, source the workspace
  2. Load a urdf, e.g. roslaunch pr2-description upload_pr2.launch
  3. Run the following in python:
from moveit_ros_planning_interface._moveit_roscpp_initializer import roscpp_init
roscpp_init("test", [])
from minimal_example.wrapper import start
start()
Then, a lot of ros errors are raised:
[ERROR] [1613744905.421133198]: Material [Blue] has malformed color rgba values: Unable to parse component [0.0] to a double (while parsing a color value)
[ERROR] [1613744905.421257104]: Material [Blue] color has no rgba
[ERROR] [1613744905.421345652]: Material [Blue] not defined in file
[ERROR] [1613744905.421559337]: Material [Green] has malformed color rgba values: Unable to parse component [0.0] to a double (while parsing a color value)
[ERROR] [1613744905.421679050]: Material [Green] color has no rgba
[ERROR] [1613744905.421736653]: Material [Green] not defined in file
[ERROR] [1613744905.421899605]: Material [Grey] has malformed color rgba values: Unable to parse component [0.7] to a double (while parsing a color value)
[ERROR] [1613744905.421960551]: Material [Grey] color has no rgba
[ERROR] [1613744905.421993995]: Material [Grey] not defined in file
[ERROR] [1613744905.422110530]: Material [Grey2] has malformed color rgba values: Unable to parse component [0.9] to a double (while parsing a color value)
[ERROR] [1613744905.422164421]: Material [Grey2] color has no rgba
[ERROR] [1613744905.422200912]: Material [Grey2] not defined in file
[ERROR] [1613744905.422367720]: Material [Red] has malformed color rgba values: Unable to parse component [0.8] to a double (while parsing a color value)
[ERROR] [1613744905.422454364]: Material [Red] color has no rgba
[ERROR] [1613744905.422525520]: Material [Red] not defined in file
[ERROR] [1613744905.422691867]: Material [White] has malformed color rgba values: Unable to parse component [1.0] to a double (while parsing a color value)
[ERROR] [1613744905.422749125]: Material [White] color has no rgba
[ERROR] [1613744905.422812759]: Material [White] not defined in file
[ERROR] [1613744905.422942299]: Material [Black] has malformed color rgba values: Unable to parse component [0.1] to a double (while parsing a color value)
[ERROR] [1613744905.422995747]: Material [Black] color has no rgba
[ERROR] [1613744905.423060430]: Material [Black] not defined in file
[ERROR] [1613744905.423174719]: Material [LightGrey] has malformed color rgba values: Unable to parse component [0.6] to a double (while parsing a color value)
[ERROR] [1613744905.423210584]: Material [LightGrey] color has no rgba
[ERROR] [1613744905.423251483]: Material [LightGrey] not defined in file
[ERROR] [1613744905.423448811]: Unable to parse component [-0.061] to a double (while parsing a vector value)
[ERROR] [1613744905.423489629]: Could not parse inertial element for Link [base_link]
[ERROR] [1613744905.423588783]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.423626958]: Could not parse inertial element for Link [base_footprint]
[ERROR] [1613744905.423722349]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.423759400]: Could not parse inertial element for Link [base_bellow_link]
[ERROR] [1613744905.423856896]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.423901057]: Could not parse inertial element for Link [base_laser_link]
[ERROR] [1613744905.423998539]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.424035614]: Could not parse inertial element for Link [fl_caster_rotation_link]
[ERROR] [1613744905.424131989]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.424168781]: Could not parse inertial element for Link [fl_caster_l_wheel_link]
[ERROR] [1613744905.424261822]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.424298544]: Could not parse inertial element for Link [fl_caster_r_wheel_link]
[ERROR] [1613744905.424392930]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.424430763]: Could not parse inertial element for Link [fr_caster_rotation_link]
[ERROR] [1613744905.424523717]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.424561717]: Could not parse inertial element for Link [fr_caster_l_wheel_link]
[ERROR] [1613744905.424642766]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.424679720]: Could not parse inertial element for Link [fr_caster_r_wheel_link]
[ERROR] [1613744905.424783002]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.424820717]: Could not parse inertial element for Link [bl_caster_rotation_link]
[ERROR] [1613744905.424900987]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.424937599]: Could not parse inertial element for Link [bl_caster_l_wheel_link]
[ERROR] [1613744905.425029065]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.425064242]: Could not parse inertial element for Link [bl_caster_r_wheel_link]
[ERROR] [1613744905.425139219]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.425177220]: Could not parse inertial element for Link [br_caster_rotation_link]
[ERROR] [1613744905.425269975]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.425306871]: Could not parse inertial element for Link [br_caster_l_wheel_link]
[ERROR] [1613744905.425400131]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.425436585]: Could not parse inertial element for Link [br_caster_r_wheel_link]
[ERROR] [1613744905.425530191]: Unable to parse component [-0.1] to a double (while parsing a vector value)
[ERROR] [1613744905.425567198]: Could not parse inertial element for Link [torso_lift_link]
[ERROR] [1613744905.425667310]: Unable to parse component [-0.0625] to a double (while parsing a vector value)
[ERROR] [1613744905.425704389]: Could not parse inertial element for Link [l_torso_lift_side_plate_link]
[ERROR] [1613744905.425797797]: Unable to parse component [-0.0625] to a double (while parsing a vector value)
[ERROR] [1613744905.425834060]: Could not parse inertial element for Link [r_torso_lift_side_plate_link]
[ERROR] [1613744905.425926920]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.425963485]: Could not parse inertial element for Link [torso_lift_motor_screw_link]
[ERROR] [1613744905.426056790]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.426093051]: Could not parse inertial element for Link [imu_link]
[ERROR] [1613744905.426188788]: Unable to parse component [0.010907] to a double (while parsing a vector value)
[ERROR] [1613744905.426225659]: Could not parse inertial element for Link [head_pan_link]
[ERROR] [1613744905.426319806]: Unable to parse component [0.001716] to a double (while parsing a vector value)
[ERROR] [1613744905.426356186]: Could not parse inertial element for Link [head_tilt_link]
[ERROR] [1613744905.426449479]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.426485690]: Could not parse inertial element for Link [head_plate_frame]
[ERROR] [1613744905.426579829]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.426642692]: Could not parse inertial element for Link [sensor_mount_link]
[ERROR] [1613744905.426730224]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.426771594]: Could not parse inertial element for Link [high_def_frame]
[ERROR] [1613744905.426861823]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.426899307]: Could not parse inertial element for Link [high_def_optical_frame]
[ERROR] [1613744905.426978513]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.427014018]: Could not parse inertial element for Link [double_stereo_link]
[ERROR] [1613744905.427105094]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.427144812]: Could not parse inertial element for Link [wide_stereo_link]
[ERROR] [1613744905.427245829]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.427282756]: Could not parse inertial element for Link [wide_stereo_l_stereo_camera_frame]
[ERROR] [1613744905.427379709]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.427415972]: Could not parse inertial element for Link [wide_stereo_r_stereo_camera_frame]
[ERROR] [1613744905.427528414]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.427564602]: Could not parse inertial element for Link [narrow_stereo_link]
[ERROR] [1613744905.427664059]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.427699921]: Could not parse inertial element for Link [narrow_stereo_l_stereo_camera_frame]
[ERROR] [1613744905.427795854]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.427831885]: Could not parse inertial element for Link [narrow_stereo_r_stereo_camera_frame]
[ERROR] [1613744905.427928084]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.427964662]: Could not parse inertial element for Link [projector_wg6802418_frame]
[ERROR] [1613744905.428063242]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.428114795]: Could not parse inertial element for Link [projector_wg6802418_child_frame]
[ERROR] [1613744905.428184298]: Unable to parse component [-0.001136] to a double (while parsing a vector value)
[ERROR] [1613744905.428210630]: Could not parse inertial element for Link [laser_tilt_mount_link]
[ERROR] [1613744905.428279646]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.428306179]: Could not parse inertial element for Link [laser_tilt_link]
[ERROR] [1613744905.428376115]: Unable to parse component [-0.001201] to a double (while parsing a vector value)
[ERROR] [1613744905.428402552]: Could not parse inertial element for Link [r_shoulder_pan_link]
[ERROR] [1613744905.428472165]: Unable to parse component [0.02195] to a double (while parsing a vector value)
[ERROR] [1613744905.428498587]: Could not parse inertial element for Link [r_shoulder_lift_link]
[ERROR] [1613744905.428567934]: Unable to parse component [0.0] to a double (while parsing a vector value)
[ERROR] [1613744905.428595138]: Could not parse inertial element for Link [r_upper_arm_roll_link]
[ERROR] [1613744905.428654026]: Unable to parse component [0.21398] to a double (while parsing a vector value)
[ERROR] [1613744905.428680435]: Could not parse inertial element for Link [r_upper_arm_link]
[ERROR] [1613744905.428753108]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.428780626]: Could not parse inertial element for Link [r_forearm_roll_link]
[ERROR] [1613744905.428849772]: Unable to parse component [0.01014] to a double (while parsing a vector value)
[ERROR] [1613744905.428878595]: Could not parse inertial element for Link [r_elbow_flex_link]
[ERROR] [1613744905.428954919]: Unable to parse component [0.18791] to a double (while parsing a vector value)
[ERROR] [1613744905.428985475]: Could not parse inertial element for Link [r_forearm_link]
[ERROR] [1613744905.429057071]: Unable to parse component [-0.00157] to a double (while parsing a vector value)
[ERROR] [1613744905.429087929]: Could not parse inertial element for Link [r_wrist_flex_link]
[ERROR] [1613744905.429146575]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.429175503]: Could not parse inertial element for Link [r_wrist_roll_link]
[ERROR] [1613744905.429235187]: Unable to parse component [0.06623] to a double (while parsing a vector value)
[ERROR] [1613744905.429264501]: Could not parse inertial element for Link [r_gripper_palm_link]
[ERROR] [1613744905.429324362]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.429355596]: Could not parse inertial element for Link [r_gripper_motor_accelerometer_link]
[ERROR] [1613744905.429428199]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.429459845]: Could not parse inertial element for Link [r_gripper_motor_slider_link]
[ERROR] [1613744905.429533061]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.429565129]: Could not parse inertial element for Link [r_gripper_motor_screw_link]
[ERROR] [1613744905.429644151]: Unable to parse component [0.03598] to a double (while parsing a vector value)
[ERROR] [1613744905.429672665]: Could not parse inertial element for Link [r_gripper_l_finger_link]
[ERROR] [1613744905.429745145]: Unable to parse component [0.03576] to a double (while parsing a vector value)
[ERROR] [1613744905.429773194]: Could not parse inertial element for Link [r_gripper_r_finger_link]
[ERROR] [1613744905.429847374]: Unable to parse component [0.00423] to a double (while parsing a vector value)
[ERROR] [1613744905.429875234]: Could not parse inertial element for Link [r_gripper_l_finger_tip_link]
[ERROR] [1613744905.429946583]: Unable to parse component [0.00423] to a double (while parsing a vector value)
[ERROR] [1613744905.429975453]: Could not parse inertial element for Link [r_gripper_r_finger_tip_link]
[ERROR] [1613744905.430074151]: Unable to parse component [-0.001201] to a double (while parsing a vector value)
[ERROR] [1613744905.430102480]: Could not parse inertial element for Link [l_shoulder_pan_link]
[ERROR] [1613744905.430177591]: Unable to parse component [0.02195] to a double (while parsing a vector value)
[ERROR] [1613744905.430205785]: Could not parse inertial element for Link [l_shoulder_lift_link]
[ERROR] [1613744905.430277491]: Unable to parse component [0.0] to a double (while parsing a vector value)
[ERROR] [1613744905.430305160]: Could not parse inertial element for Link [l_upper_arm_roll_link]
[ERROR] [1613744905.430379558]: Unable to parse component [0.21405] to a double (while parsing a vector value)
[ERROR] [1613744905.430407262]: Could not parse inertial element for Link [l_upper_arm_link]
[ERROR] [1613744905.430478621]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.430506163]: Could not parse inertial element for Link [l_forearm_roll_link]
[ERROR] [1613744905.430579621]: Unable to parse component [0.01014] to a double (while parsing a vector value)
[ERROR] [1613744905.430618398]: Could not parse inertial element for Link [l_elbow_flex_link]
[ERROR] [1613744905.430705837]: Unable to parse component [0.18791] to a double (while parsing a vector value)
[ERROR] [1613744905.430733502]: Could not parse inertial element for Link [l_forearm_link]
[ERROR] [1613744905.430805290]: Unable to parse component [-0.00157] to a double (while parsing a vector value)
[ERROR] [1613744905.430833176]: Could not parse inertial element for Link [l_wrist_flex_link]
[ERROR] [1613744905.430907456]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.430934684]: Could not parse inertial element for Link [l_wrist_roll_link]
[ERROR] [1613744905.431006990]: Unable to parse component [0.06623] to a double (while parsing a vector value)
[ERROR] [1613744905.431034927]: Could not parse inertial element for Link [l_gripper_palm_link]
[ERROR] [1613744905.431108694]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.431136095]: Could not parse inertial element for Link [l_gripper_motor_accelerometer_link]
[ERROR] [1613744905.431210253]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.431238369]: Could not parse inertial element for Link [l_gripper_motor_slider_link]
[ERROR] [1613744905.431315438]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.431343624]: Could not parse inertial element for Link [l_gripper_motor_screw_link]
[ERROR] [1613744905.431415007]: Unable to parse component [0.03598] to a double (while parsing a vector value)
[ERROR] [1613744905.431443524]: Could not parse inertial element for Link [l_gripper_l_finger_link]
[ERROR] [1613744905.431517333]: Unable to parse component [0.03576] to a double (while parsing a vector value)
[ERROR] [1613744905.431544894]: Could not parse inertial element for Link [l_gripper_r_finger_link]
[ERROR] [1613744905.431616387]: Unable to parse component [0.00423] to a double (while parsing a vector value)
[ERROR] [1613744905.431644363]: Could not parse inertial element for Link [l_gripper_l_finger_tip_link]
[ERROR] [1613744905.431718383]: Unable to parse component [0.00423] to a double (while parsing a vector value)
[ERROR] [1613744905.431745975]: Could not parse inertial element for Link [l_gripper_r_finger_tip_link]
[ERROR] [1613744905.431823067]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.431856851]: Could not parse inertial element for Link [l_forearm_cam_frame]
[ERROR] [1613744905.431936225]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.431964181]: Could not parse inertial element for Link [r_forearm_cam_frame]
[ERROR] [1613744905.432041440]: Unable to parse component [0] to a double (while parsing a vector value)
[ERROR] [1613744905.432070149]: Malformed parent origin element for joint [base_footprint_joint]
[ERROR] [1613744905.432102347]: joint xml is not initialized correctly
[ERROR] [1613744905.432583054]: Unable to parse URDF from parameter '/robot_description'

Now, remove bio_ik from the CMakeLists.txt, recompile, and try again. The problem will not occur.

I tested this on ROS Melodic on Ubuntu 18.04 for both python2 and python3 (just replace python with python3 in the find_package(BOOST...)). The problem did not occur on a self compiled workspace on Debian Testing.

In my case it was fortunately possible to remove bio_ik from the catkin components, but that may not always be the case.

I'm sorry for the bizarre issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions