How to Import a URDF file

Typically: "How do I... ", "How can I... " questions
Post Reply
juyeon
Posts: 15
Joined: 27 Mar 2023, 07:11

How to Import a URDF file

Post by juyeon »

hello,
i have a urdf file, and in this file,

Code: Select all

<visual>
      <origin rpy="0 0 0" xyz="0 0 -0.02"/>
      <geometry>
        <mesh filename="./quad.obj" scale=".0875 .0875 .0875"/>
      </geometry> 
      <material name="grey">
        <color rgba=".2 .2 .2 1"/>
      </material> 
    </visual>
i tried to Modules->Importers->urdf importer, but it appears transparent in the scene.
and File->Import->mesh
It can be imported urdf and this .obj files,respectively. But it seems like importing them separately is not the correct approach.
I'm able to successfully import this file in PyBullet, so I'm wondering how I should go about importing this file?

I'm really looking forward to your answer, thanks.

fferri
Posts: 1231
Joined: 09 Sep 2013, 19:28

Re: How to Import a URDF file

Post by fferri »

It is really transparent (opacity = 0) or it is in a hidden layer?

juyeon
Posts: 15
Joined: 27 Mar 2023, 07:11

Re: How to Import a URDF file

Post by juyeon »

fferri wrote: 10 Apr 2024, 16:45 It is really transparent (opacity = 0) or it is in a hidden layer?

I've found the reason.
When I put them in the same folder /home/lab/model and tried to reference it using "./quad.obj" and "quad.obj", it couldn't find the file.
But when I changed the path to an absolute path "/home/lab/model/quad.obj", it was able to reference successfully and the URDF was imported successfully.
So, is it because relative paths can't be used?
Thank you very much for your reply!

fferri
Posts: 1231
Joined: 09 Sep 2013, 19:28

Re: How to Import a URDF file

Post by fferri »

Yes, the URDF importer is very finicky about the resources' paths, and often those need to be adjusted...

juyeon
Posts: 15
Joined: 27 Mar 2023, 07:11

Re: How to Import a URDF file

Post by juyeon »

fferri wrote: 11 Apr 2024, 13:34 Yes, the URDF importer is very finicky about the resources' paths, and often those need to be adjusted...
I have encountered a new problem. The joints in my URDF file are all in the same location as the base_link after import, and the coordinates set in URDF don't appear. In addition, the joint imported is of the type 'forcesensor'. Where can I find the mappings from URDF types to CoppeliaSim types?

Code: Select all

<link name="prop0_link">
    <inertial>
      <origin rpy="0 0 0" xyz="0.028 -0.028 0"/>
      <mass value="0"/>
      <inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
    </inertial>
  </link>
  <joint name="prop0_joint" type="fixed">
    <parent link="base_link"/>
    <child link="prop0_link"/>
  </joint>

fferri
Posts: 1231
Joined: 09 Sep 2013, 19:28

Re: How to Import a URDF file

Post by fferri »

Force sensors are used for "Fixed joints".

Post Reply