Problems viewing Collada files in Gazebo-ROS
I have followed the tutorial to insert a Collada .dae
file into Gazebo, so that my world file is:
<?xml version="1.0" ?>
<sdf version="1.4">
<world name="test_world">
<include>
<uri>model://sun</uri>
</include>
<include>
<uri>model://ground_plane</uri>
</include>
<model name="duck">
<pose>0 0 0 0 0 0</pose>
<static>true</static>
<link name="body">
<visual name="visual">
<geometry>
<mesh><uri>file://duck.dae</uri></mesh>
</geometry>
</visual>
</link>
</model>
</world>
</sdf>
If I run gazebo test_world.world
I can see the duck. However, if I create the following launch file:
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find my_package)/models/test_world.world" />
<arg name="use_sim_time" value="true" />
<arg name="debug" value="false" />
<arg name="gui" value="true" />
</include>
</launch>
The duck is not displayed in Gazebo, although I can see the element exists in the left-hand pannel. I have seen other people with my problem, and tried many things, but I cannot make it work.
Should the .dae
and .world
files be in a specific folder? Any help is appreciated! (I'm using Gazebo 4.1.3 with ROS Indigo).
UPDATE: After applying the accepted answer, this is the final state (note that file://
has changed to model://
)
Launch file:
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find my_package)/models/test_world.world" />
<arg name="use_sim_time" value="true" />
<arg name="debug" value="false" />
<arg name="gui" value="true" />
</include>
</launch>
World file:
<?xml version="1.0" ?>
<sdf version="1.4">
<world name="test_world">
<include>
<uri>model://sun</uri>
</include>
<include>
<uri>model://ground_plane</uri>
</include>
<model name="duck">
<pose>0 0 0 0 0 0</pose>
<static>true</static>
<link name="body">
<visual name="visual">
<geometry>
<mesh><uri>model://duck.dae</uri></mesh>
</geometry>
</visual>
</link>
</model>
</world>
</sdf>
And the folder structure is:
- my_package
- models
- test_world.world
- duck.dae
- lauch
- test_launch.launch
- CMakeLists.txt
- package.xml
- models