Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'export world files ready for dae importing' cmake step, add utility to generate dae #53

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions rmf_demos/launch/ign_generate_dae.launch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version='1.0' ?>

<!--
Converts one of our ignition .world files to dae format.
The output dae will be found in ./sim_world/sim_world.dae
Usage: ros2 launch rmf_demos ign_generate_dae.launch.xml map_name:=office/clinic/airport/etc/...
-->
<launch>
<arg name="map_package" default="rmf_demos_maps" description="Name of the map package" />
<arg name="map_name" description="Name of the rmf_demos map to generate the dae from" />

<!-- Ignition only -->
<group>
<let name="world_path" value="$(find-pkg-share $(var map_package))/maps_dae_export/$(var map_name).world" />
<let name="model_path" value="$(find-pkg-share $(var map_package))/maps/$(var map_name)_ign/models:$(find-pkg-share rmf_demos_assets)/models:$(env HOME)/.gazebo/models" />
<let name="plugin_path" value="$(find-pkg-prefix rmf_robot_sim_ignition_plugins)/lib:$(find-pkg-prefix rmf_building_sim_ignition_plugins)/lib" />

<!-- TODO: headless in ignitition -->
<executable cmd="ign gazebo --iterations 1 -r -v 4 -s $(var world_path)" output="both">
<env name="IGN_GAZEBO_RESOURCE_PATH" value="$(var model_path):$(var world_path)" />
<env name="IGN_GAZEBO_SYSTEM_PLUGIN_PATH" value="$(var plugin_path)"/>
<env name="IGN_GUI_PLUGIN_PATH" value="$(var plugin_path)"/>
</executable>

<!-- ros_ign bridge for simulation clock -->
<node pkg="ros_ign_bridge" exec="parameter_bridge"
args="/clock@rosgraph_msgs/msg/Clock[ignition.msgs.Clock"
/>
</group>

</launch>
19 changes: 19 additions & 0 deletions rmf_demos_maps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,25 @@ foreach(path ${traffic_editor_paths})
DEPENDS ${map_path}
)

##############################################################################
# Generate worlds with the export dae plugin
##############################################################################
set(dae_ign_output_dir ${CMAKE_CURRENT_BINARY_DIR}/maps_dae_export/${output_world_name}_ign)
set(dae_ign_output_world_path ${dae_ign_output_dir}/${output_world_name}.world)
set(dae_ign_output_model_dir ${dae_ign_output_dir}/models)

add_custom_command(
OUTPUT ${dae_ign_output_world_path}
COMMAND ros2 run rmf_building_map_tools building_map_generator ignition_dae_export ${map_path} ${dae_ign_output_world_path} ${dae_ign_output_model_dir}
DEPENDS ${map_path}
)
add_custom_target(generate_${world_name}_dae ALL
DEPENDS ${dae_ign_output_world_path}
)
install(
DIRECTORY ${dae_ign_output_world_path}
DESTINATION share/${PROJECT_NAME}/maps_dae_export
)

##############################################################################
# generate the navmesh and required files for crowd simulation for ign
Expand Down