ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I guess you need to add an export to your package.xml
<export>
<!-- You can specify that this package is a metapackage here: -->
<!-- <metapackage/> -->
<!-- Other tools can request additional information be placed here -->
<gazebo_ros gazebo_model_path="${prefix}/models"/>
</export>
so the model path inside your package is found by gazebo.
If you are learning SDF now, I guess I am sure that you might also have to learn URDF because SDF is not supported by ROS tools like robot state publisher. (Just a hint) ;-)
Regards,
Christian
2 | No.2 Revision |
I guess you need to add an export to your package.xml
<export>
<!-- You can specify that this package is a metapackage here: -->
<!-- <metapackage/> -->
<!-- Other tools can request additional information be placed here -->
<gazebo_ros gazebo_model_path="${prefix}/models"/>
</export>
so the model path inside your package is found by gazebo.
If you are learning SDF now, I guess I am sure that you might also have to learn URDF because SDF is not supported by ROS tools like robot state publisher. (Just a hint) ;-)
UPDATE: I have a model myself inside the directory of my package with dae. I inserted it with gazebo and saved the world file with it.
<model name='hills'>
<static>1</static>
<link name='link'>
<collision name='collision'>
<geometry>
<mesh>
<uri>model://hills/mesh/hills.dae</uri>
</mesh>
</geometry>
<max_contacts>10</max_contacts>
<surface>
<bounce/>
<friction>
<ode/>
</friction>
<contact>
<ode/>
</contact>
</surface>
</collision>
<visual name='visual_1'>
<pose>0 0 0 0 -0 0</pose>
<cast_shadows>0</cast_shadows>
<geometry>
<mesh>
<uri>model://hills/mesh/hills.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>model://hills/materials/scripts</uri>
<uri>model://hills/materials/textures</uri>
<name>vrc/grass</name>
</script>
</material>
</visual>
<velocity_decay>
<linear>0</linear>
<angular>0</angular>
</velocity_decay>
<self_collide>0</self_collide>
<kinematic>0</kinematic>
<gravity>1</gravity>
</link>
<pose>5 -5 0 0 -0 0</pose>
</model>
It lies in a subfolder
models
-hills
-materials
-scripts
-textures
-mesh
-hills.dae
model.config
model.sdf
Regards,
Christian
3 | No.3 Revision |
I guess you need to add an export to your package.xml
<export>
<!-- You can specify that this package is a metapackage here: -->
<!-- <metapackage/> -->
<!-- Other tools can request additional information be placed here -->
<gazebo_ros gazebo_model_path="${prefix}/models"/>
</export>
And:
<run_depend>gazebo_ros</run_depend>
<build_depend>gazebo_ros</build_depend>
And in CMakeLists:
find_package(catkin REQUIRED gazebo_ros)
so the model path "models" inside your package is found by gazebo.
If you are learning SDF now, I guess I am sure that you might also have to learn URDF because SDF is not supported by ROS tools like robot state publisher. (Just a hint) ;-)
UPDATE: I have a model myself inside the directory of my package with dae. I inserted it with gazebo and saved the world file with it.
<model name='hills'>
<static>1</static>
<link name='link'>
<collision name='collision'>
<geometry>
<mesh>
<uri>model://hills/mesh/hills.dae</uri>
</mesh>
</geometry>
<max_contacts>10</max_contacts>
<surface>
<bounce/>
<friction>
<ode/>
</friction>
<contact>
<ode/>
</contact>
</surface>
</collision>
<visual name='visual_1'>
<pose>0 0 0 0 -0 0</pose>
<cast_shadows>0</cast_shadows>
<geometry>
<mesh>
<uri>model://hills/mesh/hills.dae</uri>
</mesh>
</geometry>
<material>
<script>
<uri>model://hills/materials/scripts</uri>
<uri>model://hills/materials/textures</uri>
<name>vrc/grass</name>
</script>
</material>
</visual>
<velocity_decay>
<linear>0</linear>
<angular>0</angular>
</velocity_decay>
<self_collide>0</self_collide>
<kinematic>0</kinematic>
<gravity>1</gravity>
</link>
<pose>5 -5 0 0 -0 0</pose>
</model>
It lies in a subfolder
models
-hills
-materials
-scripts
-textures
-mesh
-hills.dae
model.config
model.sdf
Regards,
Christian