0
$\begingroup$

I have problem with reading my robot URDF file with gazebo. In my worlds.sdf, I put

<include>
      <name>hexapod</name>
      <uri>file://home/uchi/hexapod_ws/src/hexapod_description/urdf/hexapod_description.urdf</uri>
      <pose>0.1 0.1 0.1 0 0 0</pose>
      <static>false</static>
    </include>

when I run my launch file, I get this error:

[ruby $(which ign) gazebo-4] [Err] [Server.cc:139] Error Code 1: [/sdf/world[@name="example_world"]/include[0]/uri:/home/uchi/hexapod_ws/install/hexapod_description/share/hexapod_description/worlds/example_world.sdf:L212]: Msg: Unable to read file[/home/uchi/hexapod_ws/src/hexapod_description/urdf/hexapod_description.urdf]

I also set my export IGN_GAZEBO_RESOURCE_PATH="$HOME/uchi/hexapod_ws/src/hexapod_description/urdf" as well

Why can't uri read my URDF file? Based on my knowledge, SDF would be able to read URDF file with and

UPDATE: I tried to directly read my urdf file with

ign gazebo src/hexapod_description/urdf/hexapod_description.urdf

but still cannot read it. Now I wonder if Fortress can read URDF or if my URDF file is missing something that make Gazebo not be able to read it.

UPDATE 2: I followed Gazebo tutorial to see if I can spawn my robot on Fortress. I got the same error and I also cannot read their robot used in the example either. Anyone reason for this? It is totally fine when I load sdf model instead.

SOLVED: What causes my problem is that in my URDF file, while declaring my links, I only had visual and collision declared,ignored inertial. It was fine on RVIZ but not in Gazebo. Also, I used xacro::property for fast declaration, which prevent gazebo from successfully reading it.

$\endgroup$

1 Answer 1

0
$\begingroup$

Convert your urdf to SDF. Gazebo can read SDF formats:

gz sdf -p /path/to/your/robot.urdf > /path/to/your/robot.sdf
$\endgroup$
1
  • $\begingroup$ Thank you for your response. This could be an answer to my problem as well. I figured that my links are missing inertial parts ( I only have visual and collision declared for my links), which mainly cause gazebo not be able to recognize the object. But this leads me to another problem is that gazebo can't find/load mesh of my objects in STL. $\endgroup$
    – Uchiwuwu
    Commented Mar 8 at 4:10

Your Answer

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

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