Skip to content

Commit

Permalink
More model_string instances.
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
  • Loading branch information
caguero committed Sep 11, 2024
1 parent 0529ab7 commit 9e63f09
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ros_gz_sim/ros_gz_sim/actions/gz_spawn_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(
*,
world: Optional[SomeSubstitutionsType] = None,
file: Optional[SomeSubstitutionsType] = None,
world_string: Optional[SomeSubstitutionsType] = None,
model_string: Optional[SomeSubstitutionsType] = None,
topic: Optional[SomeSubstitutionsType] = None,
entity_name: Optional[SomeSubstitutionsType] = None,
allow_renaming: Optional[SomeSubstitutionsType] = None,
Expand All @@ -56,7 +56,7 @@ def __init__(
:param: world World name.
:param: file SDF filename.
:param: world_string XML string.
:param: model_string XML string.
:param: topic Get XML from this topic.
:param: entity_name Name of the entity.
:param: allow_renaming Whether the entity allows renaming or not.
Expand All @@ -70,7 +70,7 @@ def __init__(
super().__init__(**kwargs)
self.__world = world
self.__file = file
self.__world_string = world_string
self.__model_string = model_string
self.__topic = topic
self.__entity_name = entity_name
self.__allow_renaming = allow_renaming
Expand All @@ -94,8 +94,8 @@ def parse(cls, entity: Entity, parser: Parser):
'file', data_type=str,
optional=True)

world_string = entity.get_attr(
'world_string', data_type=str,
model_string = entity.get_attr(
'model_string', data_type=str,
optional=True)

topic = entity.get_attr(
Expand Down Expand Up @@ -142,9 +142,9 @@ def parse(cls, entity: Entity, parser: Parser):
file = parser.parse_substitution(file)
kwargs['file'] = file

if isinstance(world_string, str):
world_string = parser.parse_substitution(world_string)
kwargs['world_string'] = world_string
if isinstance(model_string, str):
model_string = parser.parse_substitution(model_string)
kwargs['model_string'] = model_string

if isinstance(topic, str):
topic = parser.parse_substitution(topic)
Expand Down Expand Up @@ -193,7 +193,7 @@ def execute(self, context: LaunchContext) -> Optional[List[Action]]:
'gz_spawn_model.launch.py'])]),
launch_arguments=[('world', self.__world),
('file', self.__file),
('world_string', self.__world_string),
('model_string', self.__model_string),
('topic', self.__topic),
('entity_name', self.__entity_name),
('allow_renaming', self.__allow_renaming),
Expand Down

0 comments on commit 9e63f09

Please sign in to comment.