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 +