Skip to content

Commit

Permalink
Add xml launch file to showcase <ros_gz_bridge> and <gz_server> (#9)
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey authored Sep 25, 2024
1 parent 3df5931 commit 746ae0f
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ionic_demo/launch/ionic_navigation_demo_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def generate_launch_description():
launch_dir = bringup_dir / 'launch'
headless = LaunchConfiguration('headless')
declare_headless_cmd = DeclareLaunchArgument(
'headless', default_value='True', description='Whether to execute gzclient)'
'headless', default_value='True', description='Whether to execute gzclient'
)

return LaunchDescription(
Expand Down
13 changes: 13 additions & 0 deletions ionic_demo/launch/ionic_navigation_demo_launch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<launch>
<arg name="headless" default="True" description="Whether to execute gzclient" />

<include file="$(find-pkg-share ionic_demo)/launch/tb4_spawn_launch.xml" />
<include file="$(find-pkg-share ionic_demo)/launch/world_launch.xml" />

<executable cmd="gz sim -g -v4" output="screen" unless="$(var headless)" />

<include file="$(find-pkg-share nav2_bringup)/launch/rviz_launch.py">
<arg name="use_sim_time" value="True" />
<arg name="rviz_config" value="$(find-pkg-share nav2_bringup)/rviz/nav2_default_view.rviz" />
</include>
</launch>
38 changes: 38 additions & 0 deletions ionic_demo/launch/tb4_spawn_launch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<launch>
<include file="$(find-pkg-share nav2_bringup)/launch/bringup_launch.py">
<arg name="map" value="$(find-pkg-share ionic_demo)/maps/ionic_demo.yaml" />
<arg name="use_sim_time" value="True" />
<arg name="use_composition" value="True" />
</include>

<let name="robot_name" value="ionic_tb4" />
<let name="robot_sdf"
value="$(command '$(find-exec xacro) $(find-pkg-share ionic_demo)/models/ionic_tb4.urdf.xacro')" />

<node pkg="robot_state_publisher" exec="robot_state_publisher"
name="robot_state_publisher" output="screen">
<param name="use_sim_time" value="True" />
<param name="robot_description" value="$(var robot_sdf)" />
<remap from="/tf" to="tf" />
<remap from="/tf_static" to="tf_static" />
</node>

<ros_gz_bridge
bridge_name="tb4_bridge"
config_file="$(find-pkg-share nav2_minimal_tb4_sim)/configs/tb4_bridge.yaml"
use_composition='True'>
</ros_gz_bridge>
<ros_gz_bridge
bridge_name="tb4_camera_bridge"
config_file="$(find-pkg-share ionic_demo)/configs/tb4_camera_bridge.yaml"
use_composition='True'>
</ros_gz_bridge>

<node pkg="ros_gz_sim" exec="create" output="screen">
<param name="entity" value="$(var robot_name)" />
<param name="string" value="$(var robot_sdf)" />
</node>

<set_env name="GZ_SIM_RESOURCE_PATH" value="$(env GZ_SIM_RESOURCE_PATH):$(find-pkg-share nav2_minimal_tb4_description)/../" />

</launch>
6 changes: 6 additions & 0 deletions ionic_demo/launch/world_launch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<launch>
<gz_server
world_sdf_file="$(find-pkg-share ionic_demo)/worlds/ionic.sdf"
use_composition="True"
/>
</launch>

0 comments on commit 746ae0f

Please sign in to comment.