question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding Custom URDF Robot Models

See original GitHub issue

Describe the bug Adding new URDF models (that refer to stl files) needs a relative path to the XACRO path in rtbdata.

ValueError: file xacro/stl/braccio_base.stl not found locally or in rtbdata

Any help on how to do this properly will be highly appreciated. Here’s a snapshot of the code we have written:

class Braccio(rtb.ERobot):

    def __init__(self):

        links, name, urdf_string, urdf_filepath = self.URDF_read(
            rtb.rtb_path_to_datafile("../urdf/braccio.urdf.xacro", local=True)
        )

        super().__init__(
            links,
            name=name,
            manufacturer="Arduino",
            gripper_links=links[12],
            urdf_string=urdf_string,
            urdf_filepath=urdf_filepath,
        )

We would like to keep the URDF model information local to our project than to move it to our installation folders. The code that parses xacro files seems to look for geometry files relative to the XACRO directory.

Version information

Did you install it from PyPI or GitHub? Latest Github version (pulled) Commit hash: 51aa8bbb3663a7c815f9880d538d61e7c85bc470

Environment (please complete the following information):

  • Ubuntu 18.04.
  • Python 3.6.9.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
olmergcommented, Jan 31, 2022

I use os.chdir(os.path.dirname(file)) to solve the problem about absolute path.

https://github.com/olmerg/rtb_serial_robot/blob/main/planar_3dof/Planar3DOF.py

1reaction
petercorkecommented, Jan 22, 2022

The behaviour we should have is that if an abs path is given it should use that, rather than the package relative one.

@pranshumalik14 would that work for you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building a Visual Robot Model with URDF from Scratch
In later tutorials, you'll learn how to articulate the model, add in some physical properties, generate neater code with xacro and make it...
Read more >
URDF Models and 3D Models for Your Robotics Project
URDF Models and Standard 3D Models are valuable tools for any robotics project. We provide both of these models for our line of...
Read more >
3.7. Creating a URDF with an UR5 robot and a custom end ...
Creating a URDF with an UR5 robot and a custom end-effector. 3.7.1. Export your meshes. In ROS, robot link (and end-effector) geometry is...
Read more >
Tutorial: Using a URDF in Gazebo
For your own custom robot, we assume its URDF lives in a ROS package named MYROBOT_description in the subfolder /urdf . The method...
Read more >
It is not possible to add new URDF robots in different path of ...
you have a xacro folder with a custom urdf project in the place of the ipynb. you create a robot in a cell...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found