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.