Skip to content

Commit

Permalink
Use optional parameters in actions (#601)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Agüero <[email protected]>
  • Loading branch information
caguero authored Sep 5, 2024
1 parent 0767132 commit 08fca27
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 33 deletions.
12 changes: 6 additions & 6 deletions ros_gz_bridge/ros_gz_bridge/actions/ros_gz_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ def __init__(
self,
*,
name: SomeSubstitutionsType,
config_file: Optional[SomeSubstitutionsType] = None,
container_name: Optional[SomeSubstitutionsType] = None,
namespace: Optional[SomeSubstitutionsType] = None,
use_composition: Optional[SomeSubstitutionsType] = None,
use_respawn: Optional[SomeSubstitutionsType] = None,
log_level: Optional[SomeSubstitutionsType] = None,
config_file: SomeSubstitutionsType,
container_name: Optional[SomeSubstitutionsType] = 'ros_gz_container',
namespace: Optional[SomeSubstitutionsType] = '',
use_composition: Optional[SomeSubstitutionsType] = 'True',
use_respawn: Optional[SomeSubstitutionsType] = 'False',
log_level: Optional[SomeSubstitutionsType] = 'info',
**kwargs
) -> None:
"""
Expand Down
27 changes: 4 additions & 23 deletions ros_gz_sim/launch/ros_gz_sim.launch
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
<launch>
<arg name="name" />
<arg name="config_file" default="" />
<arg name="container_name" default="ros_gz_container" />
<arg name="namespace" default="" />
<arg name="use_composition" default="True" />
<arg name="use_respawn" default="False" />
<arg name="log_level" default="info" />
<arg name="world_sdf_file" default="empty.sdf" />
<arg name="world_sdf_string" default="" />
<gz_server
world_sdf_file="$(var world_sdf_file)"
world_sdf_string="$(var world_sdf_string)"
container_name="$(var container_name)"
use_composition="$(var use_composition)">
</gz_server>
<gz_server
world_sdf_file="empty.sdf" />
<ros_gz_bridge
name="$(var name)"
config_file="$(var config_file)"
container_name="$(var container_name)"
namespace="$(var namespace)"
use_composition="$(var use_composition)"
use_respawn="$(var use_respawn)"
log_level="$(var log_level)">
</ros_gz_bridge>
name="bridge"
config_file="/home/caguero/ros_gz_ws/src/ros_gz/ros_gz_bridge/test/config/full.yaml" />
</launch>
8 changes: 4 additions & 4 deletions ros_gz_sim/ros_gz_sim/actions/gzserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class GzServer(Action):
def __init__(
self,
*,
world_sdf_file: Optional[SomeSubstitutionsType] = None,
world_sdf_string: Optional[SomeSubstitutionsType] = None,
container_name: Optional[SomeSubstitutionsType] = None,
use_composition: Optional[SomeSubstitutionsType] = None,
world_sdf_file: Optional[SomeSubstitutionsType] = '',
world_sdf_string: Optional[SomeSubstitutionsType] = '',
container_name: Optional[SomeSubstitutionsType] = 'ros_gz_container',
use_composition: Optional[SomeSubstitutionsType] = 'True',
**kwargs
) -> None:
"""
Expand Down

0 comments on commit 08fca27

Please sign in to comment.