Migrate cabot_sites repositories for ROS2
Closed this issue · 0 comments
daisukes commented
This is related to #72.
The current cabot_sites_xxx repos has a main branch and a ros2 branch.
The ROS2 migration requires you to migrate your cabot_sites_xxx.
General migration steps are as follows
- make a branch
dev-ros2
fromros2
- merge
main/master
intodev-ros2
- revert config/config.sh file as
main/master
one (usually ros2 branch updated the file) - make sure
CMakeLists.txt
installs all the sub folders such asmodels
andworlds
- configure gazebo world for ROS2 environment
- model files that are accessed with
file://
URI in world files needs to be updated tomodel://
URI - typical configuration of
models
directory
- model files that are accessed with
- remove
export GAZEBO_RESOURCE_PATH=$sitedir
if it is specifiedconfig.sh
(this may cause a crush gazebo ROS2)
- package.xml
- worlds/your_world.world
- models/
|- <model_name1>/
| |- <model_name1>.{stl,dae}
| |- model.config
| |- model.sdf
|- <model_name2>/
| |- <model_name2>.{stl,dae}
| |- model.config
| |- model.sdf
|- database.config
|- ... # others
Start from your world file
find file://
URIs in your world file
...
<model name="my_mesh">
<pose>0 0 0 0 0 0</pose>
<static>true</static>
<link name="link1">
<collision name="collision">
<geometry>
<mesh>
<uri>file://models/model_name1/model_name1.stl</uri>
<scale>0.001 0.001 0.001</scale>
</mesh>
</geometry>
</collision>
<visual name="visual">
<geometry>
<mesh>
<uri>file://models/model_name1/model_name1.dae</uri>
</mesh>
</geometry>
</visual>
</link>
...
modify it to model://
URIs
You can make any portion of sdf elements into a model. In this case, <link name="link1">
element is moved to a model.sdf
...
<model name="my_mesh">
<pose>0 0 0 0 0 0</pose>
<static>true</static>
<model name='link1'>
<static>true</static>
<include>
<uri>model://model_name1</uri>
</include>
</model>
...
Configure models
sample model.sdf
<?xml version='1.0'?>
<sdf version='1.6'>
<model name='model_name1'>
<link name="link1">
<collision name="collision">
<geometry>
<mesh>
<uri>model://model_name1/model_name1.stl</uri>
<scale>0.001 0.001 0.001</scale>
</mesh>
</geometry>
</collision>
<visual name="visual">
<geometry>
<mesh>
<uri>model://model_name1/model_name1.dae</uri>
</mesh>
</geometry>
</visual>
</link>
</model>
</sdf>
sample model.config
<?xml version="1.0" ?>
<model>
<name>model_name1</name>
<version>1.0</version>
<sdf version="1.6">model.sdf</sdf>
<author>
<name></name>
<email></email>
</author>
<description></description>
</model>
sample database.config
<?xml version='1.0'?>
<database>
<name>cabot_sites_xxx_model</name>
<license>MIT</license>
<models>
<uri>file://model_name1</uri>
<uri>file://model_name2</uri>
</models>
</database>
add gazebo_ros
tag into package.xml so that gazebo_ros can find your models
<package>
...
<export>
<build_type>ament_cmake</build_type>
<gazebo_ros gazebo_model_path="${prefix}/models"/>
</export>
</package>