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

When URDF contains ROS specific terms

Chris Mower edited this page Oct 8, 2021 · 1 revision

Sometimes the URDF file contains package://PACKAGE_NAME so the URDF parser can replace this with an absolute path for the specified ROS package. Unfortunately, Pybullet does not have this feature - since it does not currently have any integration with ROS.

You can adapt and use the following Python script to get round this issue.

import rospkg

path = rospkg.RosPack().get_path('exotica_val_description')

replace = 'package://exotica_val_description'
with open('val_simplified.urdf', 'r') as fin:
    with open('val_simplified_pb.urdf', 'w') as fout:
        for line in fin.readlines():
            fout.write(line.replace(replace, path))
Clone this wiki locally