From 9bcefd2d4dbbb18cb4a9936208dc78fb9b258fc7 Mon Sep 17 00:00:00 2001 From: Aarav Gupta <134804732+Amronos@users.noreply.github.com> Date: Fri, 6 Sep 2024 04:22:04 +0000 Subject: [PATCH 1/9] Remove default_value for config_file Signed-off-by: Aarav Gupta <134804732+Amronos@users.noreply.github.com> --- ros_gz_sim/launch/ros_gz_sim.launch.py | 2 +- ros_gz_sim/launch/ros_gz_spawn_model.launch.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ros_gz_sim/launch/ros_gz_sim.launch.py b/ros_gz_sim/launch/ros_gz_sim.launch.py index d0a68835..3f6690d2 100644 --- a/ros_gz_sim/launch/ros_gz_sim.launch.py +++ b/ros_gz_sim/launch/ros_gz_sim.launch.py @@ -34,7 +34,7 @@ def generate_launch_description(): world_sdf_string = LaunchConfiguration('world_sdf_string') declare_config_file_cmd = DeclareLaunchArgument( - 'config_file', default_value='', description='YAML config file' + 'config_file', description='YAML config file' ) declare_container_name_cmd = DeclareLaunchArgument( diff --git a/ros_gz_sim/launch/ros_gz_spawn_model.launch.py b/ros_gz_sim/launch/ros_gz_spawn_model.launch.py index 87dcb248..20e83bd7 100644 --- a/ros_gz_sim/launch/ros_gz_spawn_model.launch.py +++ b/ros_gz_sim/launch/ros_gz_spawn_model.launch.py @@ -44,7 +44,7 @@ def generate_launch_description(): yaw = LaunchConfiguration('Y', default='0.0') declare_config_file_cmd = DeclareLaunchArgument( - 'config_file', default_value='', description='YAML config file' + 'config_file', description='YAML config file' ) declare_container_name_cmd = DeclareLaunchArgument( From c130c910b8f3d4295c8defa974b184486780c857 Mon Sep 17 00:00:00 2001 From: Aarav Gupta <134804732+Amronos@users.noreply.github.com> Date: Fri, 6 Sep 2024 10:34:43 +0000 Subject: [PATCH 2/9] Update ros_gz_sim.launch Signed-off-by: Aarav Gupta <134804732+Amronos@users.noreply.github.com> --- ros_gz_sim/launch/ros_gz_sim.launch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ros_gz_sim/launch/ros_gz_sim.launch b/ros_gz_sim/launch/ros_gz_sim.launch index cc6b04fc..88194102 100644 --- a/ros_gz_sim/launch/ros_gz_sim.launch +++ b/ros_gz_sim/launch/ros_gz_sim.launch @@ -1,6 +1,6 @@ - + From 9ed56137a66607fd5eb2a17320c9d6671ff2af00 Mon Sep 17 00:00:00 2001 From: Amronos <134804732+Amronos@users.noreply.github.com> Date: Fri, 6 Sep 2024 23:20:47 +0530 Subject: [PATCH 3/9] Fix errors with name of bridge not being given (#600) * Add argument bridge_name to fix errors Signed-off-by: Aarav Gupta <134804732+Amronos@users.noreply.github.com> --- ros_gz_bridge/launch/ros_gz_bridge.launch | 4 ++-- ros_gz_bridge/launch/ros_gz_bridge.launch.py | 12 +++++----- .../ros_gz_bridge/actions/ros_gz_bridge.py | 18 +++++++-------- ros_gz_sim/launch/gz_spawn_model.launch | 4 ++-- ros_gz_sim/launch/gz_spawn_model.launch.py | 10 ++++----- ros_gz_sim/launch/ros_gz_sim.launch | 6 ++--- ros_gz_sim/launch/ros_gz_sim.launch.py | 9 +++++++- .../launch/ros_gz_spawn_model.launch.py | 22 ++++++++++++------- .../ros_gz_sim/actions/gz_spawn_model.py | 18 +++++++-------- 9 files changed, 58 insertions(+), 45 deletions(-) diff --git a/ros_gz_bridge/launch/ros_gz_bridge.launch b/ros_gz_bridge/launch/ros_gz_bridge.launch index 80004a26..d7b738ed 100644 --- a/ros_gz_bridge/launch/ros_gz_bridge.launch +++ b/ros_gz_bridge/launch/ros_gz_bridge.launch @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ Optional[List[Action]]: [PathJoinSubstitution([FindPackageShare('ros_gz_bridge'), 'launch', 'ros_gz_bridge.launch.py'])]), - launch_arguments=[('name', self.__name), + launch_arguments=[('bridge_name', self.__bridge_name), ('config_file', self.__config_file), ('container_name', self.__container_name), ('namespace', self.__namespace), diff --git a/ros_gz_sim/launch/gz_spawn_model.launch b/ros_gz_sim/launch/gz_spawn_model.launch index 3f289048..c19c25cd 100644 --- a/ros_gz_sim/launch/gz_spawn_model.launch +++ b/ros_gz_sim/launch/gz_spawn_model.launch @@ -3,7 +3,7 @@ - + @@ -16,7 +16,7 @@ file="$(var file)" xml_string="$(var xml_string)" topic="$(var topic)" - name="$(var name)" + entity_name="$(var entity_name)" allow_renaming="$(var allow_renaming)" x="$(var x)" y="$(var y)" diff --git a/ros_gz_sim/launch/gz_spawn_model.launch.py b/ros_gz_sim/launch/gz_spawn_model.launch.py index 59cb4361..456e35e7 100644 --- a/ros_gz_sim/launch/gz_spawn_model.launch.py +++ b/ros_gz_sim/launch/gz_spawn_model.launch.py @@ -26,7 +26,7 @@ def generate_launch_description(): file = LaunchConfiguration('file') xml_string = LaunchConfiguration('string') topic = LaunchConfiguration('topic') - name = LaunchConfiguration('name') + entity_name = LaunchConfiguration('entity_name') allow_renaming = LaunchConfiguration('allow_renaming') x = LaunchConfiguration('x', default='0.0') y = LaunchConfiguration('y', default='0.0') @@ -50,8 +50,8 @@ def generate_launch_description(): 'topic', default_value=TextSubstitution(text=''), description='Get XML from this topic' ) - declare_name_cmd = DeclareLaunchArgument( - 'name', default_value=TextSubstitution(text=''), + declare_entity_name_cmd = DeclareLaunchArgument( + 'entity_name', default_value=TextSubstitution(text=''), description='Name of the entity' ) declare_allow_renaming_cmd = DeclareLaunchArgument( @@ -67,7 +67,7 @@ def generate_launch_description(): 'file': file, 'string': xml_string, 'topic': topic, - 'name': name, + 'name': entity_name, 'allow_renaming': allow_renaming, 'x': x, 'y': y, @@ -86,7 +86,7 @@ def generate_launch_description(): ld.add_action(declare_file_cmd) ld.add_action(declare_xml_string_cmd) ld.add_action(declare_topic_cmd) - ld.add_action(declare_name_cmd) + ld.add_action(declare_entity_name_cmd) ld.add_action(declare_allow_renaming_cmd) # Add the actions to launch all of the create nodes ld.add_action(load_nodes) diff --git a/ros_gz_sim/launch/ros_gz_sim.launch b/ros_gz_sim/launch/ros_gz_sim.launch index 88194102..7aef6af4 100644 --- a/ros_gz_sim/launch/ros_gz_sim.launch +++ b/ros_gz_sim/launch/ros_gz_sim.launch @@ -1,6 +1,6 @@ - - + + @@ -15,7 +15,7 @@ use_composition="$(var use_composition)"> Optional[List[Action]]: ('file', self.__file), ('xml_string', self.__xml_string), ('topic', self.__topic), - ('name', self.__name), + ('entity_name', self.__entity_name), ('allow_renaming', self.__allow_renaming), ('x', self.__x), ('y', self.__y), From e9fac33993a7d62633b586b020745180c4260fe1 Mon Sep 17 00:00:00 2001 From: Aarav Gupta <134804732+Amronos@users.noreply.github.com> Date: Sat, 7 Sep 2024 03:17:16 +0000 Subject: [PATCH 4/9] Remove default values for config_file and bridge_name Signed-off-by: Aarav Gupta <134804732+Amronos@users.noreply.github.com> --- ros_gz_bridge/launch/ros_gz_bridge.launch | 2 +- ros_gz_bridge/launch/ros_gz_bridge.launch.py | 2 +- ros_gz_sim/launch/ros_gz_sim.launch | 2 +- ros_gz_sim/launch/ros_gz_sim.launch.py | 2 +- ros_gz_sim/launch/ros_gz_spawn_model.launch.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ros_gz_bridge/launch/ros_gz_bridge.launch b/ros_gz_bridge/launch/ros_gz_bridge.launch index d7b738ed..f4db1e4f 100644 --- a/ros_gz_bridge/launch/ros_gz_bridge.launch +++ b/ros_gz_bridge/launch/ros_gz_bridge.launch @@ -1,6 +1,6 @@ - + diff --git a/ros_gz_bridge/launch/ros_gz_bridge.launch.py b/ros_gz_bridge/launch/ros_gz_bridge.launch.py index 37320fa7..efaa9925 100644 --- a/ros_gz_bridge/launch/ros_gz_bridge.launch.py +++ b/ros_gz_bridge/launch/ros_gz_bridge.launch.py @@ -37,7 +37,7 @@ def generate_launch_description(): ) declare_config_file_cmd = DeclareLaunchArgument( - 'config_file', default_value='', description='YAML config file' + 'config_file', description='YAML config file' ) declare_container_name_cmd = DeclareLaunchArgument( diff --git a/ros_gz_sim/launch/ros_gz_sim.launch b/ros_gz_sim/launch/ros_gz_sim.launch index 7aef6af4..7a024066 100644 --- a/ros_gz_sim/launch/ros_gz_sim.launch +++ b/ros_gz_sim/launch/ros_gz_sim.launch @@ -1,6 +1,6 @@ - + diff --git a/ros_gz_sim/launch/ros_gz_sim.launch.py b/ros_gz_sim/launch/ros_gz_sim.launch.py index 8655ef0b..4f5f7e80 100644 --- a/ros_gz_sim/launch/ros_gz_sim.launch.py +++ b/ros_gz_sim/launch/ros_gz_sim.launch.py @@ -35,7 +35,7 @@ def generate_launch_description(): world_sdf_string = LaunchConfiguration('world_sdf_string') declare_bridge_name_cmd = DeclareLaunchArgument( - 'bridge_name', default_value='', description='Name of the bridge' + 'bridge_name', description='Name of the bridge' ) declare_config_file_cmd = DeclareLaunchArgument( diff --git a/ros_gz_sim/launch/ros_gz_spawn_model.launch.py b/ros_gz_sim/launch/ros_gz_spawn_model.launch.py index d28cee51..8e7593e9 100644 --- a/ros_gz_sim/launch/ros_gz_spawn_model.launch.py +++ b/ros_gz_sim/launch/ros_gz_spawn_model.launch.py @@ -45,7 +45,7 @@ def generate_launch_description(): yaw = LaunchConfiguration('Y', default='0.0') declare_bridge_name_cmd = DeclareLaunchArgument( - 'bridge_name', default_value='', description='Name of the bridge' + 'bridge_name', description='Name of the bridge' ) declare_config_file_cmd = DeclareLaunchArgument( From 59e9fe64f1f76c01f0a1e6288c3b22e6861fd9df Mon Sep 17 00:00:00 2001 From: Aarav Gupta <134804732+Amronos@users.noreply.github.com> Date: Sun, 8 Sep 2024 09:24:43 +0000 Subject: [PATCH 5/9] Change xml_string to string Signed-off-by: Aarav Gupta <134804732+Amronos@users.noreply.github.com> --- ros_gz_sim/launch/gz_spawn_model.launch.py | 8 ++++---- ros_gz_sim/launch/ros_gz_spawn_model.launch.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ros_gz_sim/launch/gz_spawn_model.launch.py b/ros_gz_sim/launch/gz_spawn_model.launch.py index 456e35e7..59b60e65 100644 --- a/ros_gz_sim/launch/gz_spawn_model.launch.py +++ b/ros_gz_sim/launch/gz_spawn_model.launch.py @@ -24,7 +24,7 @@ def generate_launch_description(): world = LaunchConfiguration('world') file = LaunchConfiguration('file') - xml_string = LaunchConfiguration('string') + string = LaunchConfiguration('string') topic = LaunchConfiguration('topic') entity_name = LaunchConfiguration('entity_name') allow_renaming = LaunchConfiguration('allow_renaming') @@ -41,7 +41,7 @@ def generate_launch_description(): declare_file_cmd = DeclareLaunchArgument( 'file', default_value=TextSubstitution(text=''), description='SDF filename') - declare_xml_string_cmd = DeclareLaunchArgument( + declare_string_cmd = DeclareLaunchArgument( 'string', default_value='', description='XML string', @@ -65,7 +65,7 @@ def generate_launch_description(): output='screen', parameters=[{'world': world, 'file': file, - 'string': xml_string, + 'string': string, 'topic': topic, 'name': entity_name, 'allow_renaming': allow_renaming, @@ -84,7 +84,7 @@ def generate_launch_description(): # Declare the launch options ld.add_action(declare_world_cmd) ld.add_action(declare_file_cmd) - ld.add_action(declare_xml_string_cmd) + ld.add_action(declare_string_cmd) ld.add_action(declare_topic_cmd) ld.add_action(declare_entity_name_cmd) ld.add_action(declare_allow_renaming_cmd) diff --git a/ros_gz_sim/launch/ros_gz_spawn_model.launch.py b/ros_gz_sim/launch/ros_gz_spawn_model.launch.py index 8e7593e9..c8cd6691 100644 --- a/ros_gz_sim/launch/ros_gz_spawn_model.launch.py +++ b/ros_gz_sim/launch/ros_gz_spawn_model.launch.py @@ -33,7 +33,7 @@ def generate_launch_description(): world = LaunchConfiguration('world') file = LaunchConfiguration('file') - xml_string = LaunchConfiguration('string') + string = LaunchConfiguration('string') topic = LaunchConfiguration('topic') entity_name = LaunchConfiguration('entity_name') allow_renaming = LaunchConfiguration('allow_renaming') @@ -84,7 +84,7 @@ def generate_launch_description(): 'file', default_value=TextSubstitution(text=''), description='SDF filename') - declare_xml_string_cmd = DeclareLaunchArgument( + declare_string_cmd = DeclareLaunchArgument( 'string', default_value='', description='XML string', @@ -125,7 +125,7 @@ def generate_launch_description(): 'gz_spawn_model.launch.py'])]), launch_arguments=[('world', world), ('file', file), - ('xml_string', xml_string), + ('string', string), ('topic', topic), ('entity_name', entity_name), ('allow_renaming', allow_renaming), @@ -149,7 +149,7 @@ def generate_launch_description(): ld.add_action(declare_log_level_cmd) ld.add_action(declare_world_cmd) ld.add_action(declare_file_cmd) - ld.add_action(declare_xml_string_cmd) + ld.add_action(declare_string_cmd) ld.add_action(declare_topic_cmd) ld.add_action(declare_entity_name_cmd) ld.add_action(declare_allow_renaming_cmd) From b8c55b048ba904e1fc704944cd7f4889f4f78396 Mon Sep 17 00:00:00 2001 From: Aarav Gupta <134804732+Amronos@users.noreply.github.com> Date: Sun, 8 Sep 2024 09:32:27 +0000 Subject: [PATCH 6/9] Change xml_string to string in actions Signed-off-by: Aarav Gupta <134804732+Amronos@users.noreply.github.com> --- .../ros_gz_sim/actions/gz_spawn_model.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ros_gz_sim/ros_gz_sim/actions/gz_spawn_model.py b/ros_gz_sim/ros_gz_sim/actions/gz_spawn_model.py index 0eeae015..5e402032 100644 --- a/ros_gz_sim/ros_gz_sim/actions/gz_spawn_model.py +++ b/ros_gz_sim/ros_gz_sim/actions/gz_spawn_model.py @@ -36,7 +36,7 @@ def __init__( *, world: Optional[SomeSubstitutionsType] = None, file: Optional[SomeSubstitutionsType] = None, - xml_string: Optional[SomeSubstitutionsType] = None, + string: Optional[SomeSubstitutionsType] = None, topic: Optional[SomeSubstitutionsType] = None, entity_name: Optional[SomeSubstitutionsType] = None, allow_renaming: Optional[SomeSubstitutionsType] = None, @@ -56,7 +56,7 @@ def __init__( :param: world World name. :param: file SDF filename. - :param: xml_string XML string. + :param: 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. @@ -70,7 +70,7 @@ def __init__( super().__init__(**kwargs) self.__world = world self.__file = file - self.__xml_string = xml_string + self.__string = string self.__topic = topic self.__entity_name = entity_name self.__allow_renaming = allow_renaming @@ -94,8 +94,8 @@ def parse(cls, entity: Entity, parser: Parser): 'file', data_type=str, optional=True) - xml_string = entity.get_attr( - 'xml_string', data_type=str, + string = entity.get_attr( + 'string', data_type=str, optional=True) topic = entity.get_attr( @@ -142,9 +142,9 @@ def parse(cls, entity: Entity, parser: Parser): file = parser.parse_substitution(file) kwargs['file'] = file - if isinstance(xml_string, str): - xml_string = parser.parse_substitution(xml_string) - kwargs['xml_string'] = xml_string + if isinstance(string, str): + string = parser.parse_substitution(string) + kwargs['string'] = string if isinstance(topic, str): topic = parser.parse_substitution(topic) @@ -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), - ('xml_string', self.__xml_string), + ('string', self.__string), ('topic', self.__topic), ('entity_name', self.__entity_name), ('allow_renaming', self.__allow_renaming), From 385d6c36fac258c9fb721d549185b04339f454ea Mon Sep 17 00:00:00 2001 From: Aarav Gupta <134804732+Amronos@users.noreply.github.com> Date: Mon, 9 Sep 2024 16:21:10 +0000 Subject: [PATCH 7/9] Change string and xml_string to sdf_string Signed-off-by: Aarav Gupta <134804732+Amronos@users.noreply.github.com> --- ros_gz_sim/launch/gz_spawn_model.launch | 4 ++-- ros_gz_sim/launch/gz_spawn_model.launch.py | 10 +++++----- ros_gz_sim/launch/ros_gz_spawn_model.launch.py | 10 +++++----- .../ros_gz_sim/actions/gz_spawn_model.py | 18 +++++++++--------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ros_gz_sim/launch/gz_spawn_model.launch b/ros_gz_sim/launch/gz_spawn_model.launch index c19c25cd..cdf7e261 100644 --- a/ros_gz_sim/launch/gz_spawn_model.launch +++ b/ros_gz_sim/launch/gz_spawn_model.launch @@ -1,7 +1,7 @@ - + @@ -14,7 +14,7 @@ Optional[List[Action]]: 'gz_spawn_model.launch.py'])]), launch_arguments=[('world', self.__world), ('file', self.__file), - ('string', self.__string), + ('sdf_string', self.__sdf_string), ('topic', self.__topic), ('entity_name', self.__entity_name), ('allow_renaming', self.__allow_renaming), From 4998bb663c36cdc6b631f217c28e02d621c896fe Mon Sep 17 00:00:00 2001 From: Aarav Gupta <134804732+Amronos@users.noreply.github.com> Date: Mon, 9 Sep 2024 16:53:02 +0000 Subject: [PATCH 8/9] Change sdf_string to world_string Signed-off-by: Aarav Gupta <134804732+Amronos@users.noreply.github.com> --- ros_gz_sim/launch/gz_spawn_model.launch | 4 ++-- ros_gz_sim/launch/gz_spawn_model.launch.py | 10 +++++----- ros_gz_sim/launch/ros_gz_spawn_model.launch.py | 10 +++++----- ros_gz_sim/ros_gz_sim/actions/gz_spawn_model.py | 16 ++++++++-------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ros_gz_sim/launch/gz_spawn_model.launch b/ros_gz_sim/launch/gz_spawn_model.launch index cdf7e261..a132ae08 100644 --- a/ros_gz_sim/launch/gz_spawn_model.launch +++ b/ros_gz_sim/launch/gz_spawn_model.launch @@ -1,7 +1,7 @@ - + @@ -14,7 +14,7 @@ Optional[List[Action]]: 'gz_spawn_model.launch.py'])]), launch_arguments=[('world', self.__world), ('file', self.__file), - ('sdf_string', self.__sdf_string), + ('world_string', self.__world_string), ('topic', self.__topic), ('entity_name', self.__entity_name), ('allow_renaming', self.__allow_renaming), From 874feffe8c94d8a5b7878dfd0090fe8827d50ac1 Mon Sep 17 00:00:00 2001 From: Aarav Gupta <134804732+Amronos@users.noreply.github.com> Date: Mon, 9 Sep 2024 16:59:26 +0000 Subject: [PATCH 9/9] Missed one Signed-off-by: Aarav Gupta <134804732+Amronos@users.noreply.github.com> --- ros_gz_sim/ros_gz_sim/actions/gz_spawn_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ros_gz_sim/ros_gz_sim/actions/gz_spawn_model.py b/ros_gz_sim/ros_gz_sim/actions/gz_spawn_model.py index eb467a00..95992652 100644 --- a/ros_gz_sim/ros_gz_sim/actions/gz_spawn_model.py +++ b/ros_gz_sim/ros_gz_sim/actions/gz_spawn_model.py @@ -95,7 +95,7 @@ def parse(cls, entity: Entity, parser: Parser): optional=True) world_string = entity.get_attr( - 'sdf_string', data_type=str, + 'world_string', data_type=str, optional=True) topic = entity.get_attr(