Skip to content

Commit

Permalink
Merge branch 'ros2' into caguero/air_pressure_demo_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
caguero authored Nov 22, 2024
2 parents 80dd86a + 5c1251a commit 4bb317f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion ros_gz_bridge/ros_gz_bridge/actions/ros_gz_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ def execute(self, context: LaunchContext) -> Optional[List[Action]]:
if isinstance(self.__create_own_container, list):
self.__create_own_container = self.__create_own_container[0]

if isinstance(self.__use_respawn, list):
self.__use_respawn = self.__use_respawn[0]

# Standard node configuration
load_nodes = GroupAction(
condition=IfCondition(PythonExpression(['not ', self.__use_composition])),
Expand All @@ -185,7 +188,7 @@ def execute(self, context: LaunchContext) -> Optional[List[Action]]:
name=self.__bridge_name,
namespace=self.__namespace,
output='screen',
respawn=self.__use_respawn,
respawn=bool(self.__use_respawn),
respawn_delay=2.0,
parameters=[{'config_file': self.__config_file, **parsed_bridge_params}],
arguments=['--ros-args', '--log-level', self.__log_level],
Expand Down
14 changes: 7 additions & 7 deletions ros_gz_sim/ros_gz_sim/actions/gzserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from launch.frontend import Entity, expose_action, Parser
from launch.launch_context import LaunchContext
from launch.some_substitutions_type import SomeSubstitutionsType
from launch.substitutions import LaunchConfiguration, PythonExpression
from launch.substitutions import PythonExpression
from launch_ros.actions import ComposableNodeContainer, LoadComposableNodes, Node
from launch_ros.descriptions import ComposableNode

Expand Down Expand Up @@ -125,8 +125,8 @@ def execute(self, context: LaunchContext) -> Optional[List[Action]]:
package='ros_gz_sim',
executable='gzserver',
output='screen',
parameters=[{'world_sdf_file': LaunchConfiguration('world_sdf_file'),
'world_sdf_string': LaunchConfiguration('world_sdf_string')}],
parameters=[{'world_sdf_file': self.__world_sdf_file,
'world_sdf_string': self.__world_sdf_string}],
),
],
)
Expand All @@ -145,8 +145,8 @@ def execute(self, context: LaunchContext) -> Optional[List[Action]]:
package='ros_gz_sim',
plugin='ros_gz_sim::GzServer',
name='gz_server',
parameters=[{'world_sdf_file': LaunchConfiguration('world_sdf_file'),
'world_sdf_string': LaunchConfiguration('world_sdf_string')}],
parameters=[{'world_sdf_file': self.__world_sdf_file,
'world_sdf_string': self.__world_sdf_string}],
extra_arguments=[{'use_intra_process_comms': True}],
),
],
Expand All @@ -166,8 +166,8 @@ def execute(self, context: LaunchContext) -> Optional[List[Action]]:
package='ros_gz_sim',
plugin='ros_gz_sim::GzServer',
name='gz_server',
parameters=[{'world_sdf_file': LaunchConfiguration('world_sdf_file'),
'world_sdf_string': LaunchConfiguration('world_sdf_string')}],
parameters=[{'world_sdf_file': self.__world_sdf_file,
'world_sdf_string': self.__world_sdf_string}],
extra_arguments=[{'use_intra_process_comms': True}],
),
],
Expand Down

0 comments on commit 4bb317f

Please sign in to comment.