1
$\begingroup$

I'm trying to display an image on top of a box in a .urdf file. How could I achieve this?

$\endgroup$
1
  • $\begingroup$ i think that you want to specify a custom texture .... i do not know how to do that though $\endgroup$
    – jsotola
    May 9, 2018 at 5:15

2 Answers 2

2
$\begingroup$

This ROS Answers response walks you through the steps. My answer is a summary of that post.

To add your image, called a texture, you first create a material file, let's call it box.material and input your image file:

material YourMaterialName{
    technique
    {
        pass
        {
            texture_unit
            {
                texture your_material_image.jpg
                scale 1 1
            }
        }   
    }
}

Then, in your URDF file, you add a reference to the material above the link, like so:

<gazebo reference="your_link">
    <material>YourMaterialName</material>
</gazebo>

Note that this approach only works for URDF primitives (boxes, cylinders, etc). If you are using a mesh file for your URDF you will need to use a different approach with a more complex material file.

$\endgroup$
0
$\begingroup$

I recomend you to watch this ROS Developers Live Class where it is explained how to build a URDF model of a robot: https://youtu.be/q01dDxeHTMs

The key point here is that you understand what is the difference between the collision and visual of the model, as well as the pose of those.

$\endgroup$
1
  • 3
    $\begingroup$ Hello @Ricardo Tellez, it looks like you are an employee (or owner?) of The Construct, the publisher of the youtube video linked. Your post appears to promote this youtube channel without disclosure of affiliation. Please edit your post and disclose your affiliation. $\endgroup$
    – Ben
    Sep 15, 2020 at 11:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.