diff --git a/.gitignore b/.gitignore
index 4e033e6..a64c2ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
*.build
*.install
+sandbox
+
# Visual Studio Code files
.vscode
diff --git a/andino_gz/CMakeLists.txt b/andino_gz/CMakeLists.txt
index 39903be..3073d68 100644
--- a/andino_gz/CMakeLists.txt
+++ b/andino_gz/CMakeLists.txt
@@ -5,9 +5,12 @@ find_package(gazebo QUIET)
find_package(ament_cmake REQUIRED)
+ament_python_install_package("andino_gz")
+
install(
DIRECTORY
config
+ config_gui
models
launch
rviz
diff --git a/andino_gz/andino_gz/__init__.py b/andino_gz/andino_gz/__init__.py
new file mode 100644
index 0000000..2dcb5d3
--- /dev/null
+++ b/andino_gz/andino_gz/__init__.py
@@ -0,0 +1,3 @@
+from .launch_tools.substitutions import TextJoin
+
+__all__ = ['TextJoin']
diff --git a/andino_gz/andino_gz/launch_tools/__init__.py b/andino_gz/andino_gz/launch_tools/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/andino_gz/andino_gz/launch_tools/substitutions.py b/andino_gz/andino_gz/launch_tools/substitutions.py
new file mode 100644
index 0000000..3bbd1e4
--- /dev/null
+++ b/andino_gz/andino_gz/launch_tools/substitutions.py
@@ -0,0 +1,42 @@
+from typing import Dict, Iterable, Text, Union, List, Sequence
+from launch.frontend import expose_substitution
+from launch.substitution import Substitution
+from launch.launch_context import LaunchContext
+from launch.some_substitutions_type import SomeSubstitutionsType
+from launch.substitutions import SubstitutionFailure
+from launch.utilities import normalize_to_list_of_substitutions
+from launch.utilities import perform_substitutions
+from launch.utilities.type_utils import perform_typed_substitution
+
+
+class TextJoin(Substitution):
+ """Substitution that TextJoin stuff."""
+
+ def __init__(self,
+ substitutions: Iterable[Union[Text, Substitution]],
+ separator: Text = '') -> None:
+ """Create a TextJoin."""
+ self.__substitutions = normalize_to_list_of_substitutions(
+ substitutions)
+ self.__separator = separator
+
+ @property
+ def substitutions(self) -> Iterable[Substitution]:
+ """Getter for variable_name."""
+ return self.__substitutions
+
+ @property
+ def separator(self) -> Text:
+ """Getter for variable_name."""
+ return self.__separator
+
+ def describe(self) -> Text:
+ """Return a description of this substitution as a string."""
+ return f"TextJoin: {self.__separator.join([sub.describe() for sub in self.__substitutions])}"
+
+ def perform(self, context: LaunchContext) -> Text:
+ """Perform the substitution by retrieving the local variable."""
+ performed_substitutions = [
+ sub.perform(context) for sub in self.__substitutions
+ ]
+ return self.__separator.join(performed_substitutions)
diff --git a/andino_gz/config_gui/default.config b/andino_gz/config_gui/default.config
new file mode 100644
index 0000000..5124e8b
--- /dev/null
+++ b/andino_gz/config_gui/default.config
@@ -0,0 +1,271 @@
+
+
+
+
+
+
+
+ 1000
+ 845
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+ 3D View
+ false
+ docked
+
+
+ ogre2
+ scene
+ 0.4 0.4 0.4
+ 0.8 0.8 0.8
+ -2 0 1 0 0 0
+ 80
+ orbit
+
+
+
+
+
+ floating
+ 5
+ 5
+ false
+
+
+
+
+ false
+ 5
+ 5
+ floating
+ false
+
+
+
+
+ false
+ 5
+ 5
+ floating
+ false
+
+
+
+
+ false
+ 5
+ 5
+ floating
+ false
+
+
+
+
+ false
+ 5
+ 5
+ floating
+ false
+
+
+
+
+ false
+ 5
+ 5
+ floating
+ false
+
+
+
+
+
+ false
+ 5
+ 5
+ floating
+ false
+
+
+
+
+
+ false
+ 5
+ 5
+ floating
+ false
+
+
+
+
+
+
+ World control
+ false
+ false
+ 72
+ 121
+ 1
+
+ floating
+
+
+
+
+
+
+ true
+ true
+ true
+ true
+
+
+
+
+
+
+ World stats
+ false
+ false
+ 110
+ 290
+ 1
+
+ floating
+
+
+
+
+
+
+ true
+ true
+ true
+ true
+
+
+
+
+
+ false
+ 0
+ 0
+ 250
+ 50
+ floating
+ false
+ #666666
+
+
+
+
+
+
+ false
+ 250
+ 0
+ 150
+ 50
+ floating
+ false
+ #666666
+
+
+
+
+
+
+ false
+ 0
+ 50
+ 250
+ 50
+ floating
+ false
+ #777777
+
+
+
+ false
+
+
+
+
+
+ false
+ 250
+ 50
+ 50
+ 50
+ floating
+ false
+ #777777
+
+
+
+
+
+
+ false
+ 300
+ 50
+ 100
+ 50
+ floating
+ false
+ #777777
+
+
+
+
+
+
+ docked_collapsed
+
+
+
+
+
+
+ docked_collapsed
+
+
+
+
+
+
+ docked_collapsed
+
+ /model/andino/cmd_vel
+
+
+
+
+
+ docked_collapsed
+
+
diff --git a/andino_gz/launch/andino_gz.launch.py b/andino_gz/launch/andino_gz.launch.py
index e6b77b9..9e01d57 100644
--- a/andino_gz/launch/andino_gz.launch.py
+++ b/andino_gz/launch/andino_gz.launch.py
@@ -11,6 +11,8 @@
from nav2_common.launch import ParseMultiRobotPose
+from andino_gz.launch_tools.substitutions import TextJoin
+
def generate_launch_description():
pkg_andino_gz = get_package_share_directory('andino_gz')
@@ -23,20 +25,33 @@ def generate_launch_description():
robots_arg = DeclareLaunchArgument(
'robots', default_value="andino={x: 0., y: 0., z: 0.1, yaw: 0.};",
description='Robots to spawn, multiple robots can be stated separated by a ; ')
+ gui_config_arg = DeclareLaunchArgument(
+ 'gui_config',
+ default_value='default.config',
+ description='Name of the gui configuration file to load.')
# Variables of launch file.
rviz = LaunchConfiguration('rviz')
ros_bridge = LaunchConfiguration('ros_bridge')
world_name = LaunchConfiguration('world_name')
+ gui_config = LaunchConfiguration('gui_config')
+ gui_config_path = PathJoinSubstitution([pkg_andino_gz, 'config_gui', gui_config])
# Obtains world path.
world_path = PathJoinSubstitution([pkg_andino_gz, 'worlds', world_name])
-
+ gz_args = TextJoin(
+ substitutions=[
+ world_path,
+ TextJoin(substitutions=["--gui-config", gui_config_path], separator=' '),
+ ],
+ separator=' ',
+ )
base_group = GroupAction(
scoped=True, forwarding=False,
launch_configurations={
'ros_bridge': ros_bridge,
- 'world_name': world_name
+ 'world_name': world_name,
+ 'gui_config': gui_config
},
actions=[
# Gazebo Sim
@@ -44,7 +59,7 @@ def generate_launch_description():
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory('ros_gz_sim'), 'launch', 'gz_sim.launch.py')
),
- launch_arguments={'gz_args': world_path}.items(),
+ launch_arguments={'gz_args': gz_args}.items(),
),
# ROS Bridge for generic Gazebo stuff
Node(
@@ -127,6 +142,7 @@ def generate_launch_description():
ld.add_action(rviz_arg)
ld.add_action(world_name_arg)
ld.add_action(robots_arg)
+ ld.add_action(gui_config_arg)
ld.add_action(base_group)
for group in spawn_robots_group:
ld.add_action(group)
diff --git a/andino_gz/models/office/model.config b/andino_gz/models/office/model.config
deleted file mode 100644
index 5936fcd..0000000
--- a/andino_gz/models/office/model.config
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
- office
- 1.0
- model.sdf
-
-
-
-
-
-
diff --git a/andino_gz/models/office/model.sdf b/andino_gz/models/office/model.sdf
deleted file mode 100644
index decb374..0000000
--- a/andino_gz/models/office/model.sdf
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
- 1
-
- 0.166667
- 0
- 0
- 0.166667
- 0
- 0.166667
-
- 0 0 0 0 -0 0
-
- 1e-06 -2e-06 0 0 -0 0
- 1
- 0
- 0
- 0
-
- 0 0 0 0 -0 0
-
-
- model://office.stl
- 1 1 1
-
-
-
- 1
-
-
-
- 0
- 1
-
-
- 0
- 10
- 0 0 0 0 -0 0
-
-
- model://office.stl
- 1 1 1
-
-
-
-
-
- 1
- 1
- 0 0 0
- 0
- 0
-
-
- 1
- 0
- 0
- 1
-
- 0
-
-
-
-
- 0
- 1e+06
-
-
- 0
- 1
- 1
-
- 0
- 0.2
- 1e+13
- 1
- 0.01
- 0
-
-
- 1
- -0.01
- 0
- 0.2
- 1e+13
- 1
-
-
-
-
-
- 0
- 1
-
-
diff --git a/andino_gz/worlds/depot.sdf b/andino_gz/worlds/depot.sdf
index dfd4719..3b2cf4a 100644
--- a/andino_gz/worlds/depot.sdf
+++ b/andino_gz/worlds/depot.sdf
@@ -20,157 +20,6 @@
0
-
-
-
-
-
- 3D View
- false
- docked
-
-
- ogre2
- scene
- 0.4 0.4 0.4
- 0.8 0.8 0.8
- -1.7 0.7 0.7 0 0.3 -0.3
-
-
-
-
-
- World control
- false
- false
- 72
- 121
- 1
-
- floating
-
-
-
-
-
-
- true
- true
- true
-
-
-
-
-
-
- World stats
- false
- false
- 110
- 290
- 1
-
- floating
-
-
-
-
-
-
- true
- true
- true
- true
-
-
-
-
-
-
- false
- 0
- 0
- 250
- 50
- floating
- false
- #666666
-
-
-
-
-
-
- false
- 250
- 0
- 150
- 50
- floating
- false
- #666666
-
-
-
-
-
-
- false
- 0
- 50
- 250
- 50
- floating
- false
- #777777
-
-
-
-
-
-
- false
- 250
- 50
- 50
- 50
- floating
- false
- #777777
-
-
-
-
-
-
- docked_collapsed
-
-
-
-
-
-
- docked_collapsed
-
-
-
-
-
-
- docked_collapsed
-
- /model/andino/cmd_vel
-
-
-
-
-
- docked
-
-
-
-
-
1
diff --git a/andino_gz/worlds/office.sdf b/andino_gz/worlds/office.sdf
index a25fb66..12ea029 100644
--- a/andino_gz/worlds/office.sdf
+++ b/andino_gz/worlds/office.sdf
@@ -1,6 +1,22 @@
-
+
+
+ 0.01
+ 1
+
+
+
+
+
+
+ ogre2
+
+
+ 0.4 0.4 0.4 1
+ 0.7 0.7 0.7 1
+ 1
+
1
0 0 10 0 -0 0
@@ -67,80 +83,8 @@
0
- 0 0 -9.8
- 6e-06 2.3e-05 -4.2e-05
-
-
- 0.001
- 1
- 1000
-
-
- 0.4 0.4 0.4 1
- 0.7 0.7 0.7 1
- 1
-
-
-
-
- EARTH_WGS84
- 0
- 0
- 0
- 0
-
-
- 0 0
- 0 0
- 1695691762 389384964
- 0
-
- 0 0 0 0 -0 0
- 1 1 1
-
- 0 0 0 0 -0 0
- 0 0 0 0 -0 0
- 0 0 0 0 -0 0
- 0 0 0 0 -0 0
-
-
-
- -1.90399 -7.35802 0 0 -0 0
- 1 1 1
-
- -1.90399 -7.35802 0 0 -0 0
- 0 0 0 0 -0 0
- 0 0 0 0 -0 0
- 0 0 0 0 -0 0
-
-
-
- 0 0 10 0 -0 0
-
-
-
-
- 22.4093 -8.70437 29.0004 0 0.903642 2.52738
- orbit
- perspective
-
-
-
-
- 1
-
- 0.166667
- 0
- 0
- 0.166667
- 0
- 0.166667
-
- 0 0 0 0 -0 0
-
+
1e-06 -5e-06 0 0 -0 0
0
0
@@ -174,51 +118,6 @@
1 1 1
-
-
-
- 1
- 1
- 0 0 0
- 0
- 0
-
-
- 1
- 0
- 0
- 1
-
- 0
-
-
-
-
- 0
- 1e+06
-
-
- 0
- 1
- 1
-
- 0
- 0.2
- 1e+13
- 1
- 0.01
- 0
-
-
- 1
- -0.01
- 0
- 0.2
- 1e+13
- 1
-
-
-
1