Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves world launching #62

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*.build
*.install

sandbox

# Visual Studio Code files
.vscode
3 changes: 3 additions & 0 deletions andino_gz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions andino_gz/andino_gz/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .launch_tools.substitutions import TextJoin

__all__ = ['TextJoin']
Empty file.
42 changes: 42 additions & 0 deletions andino_gz/andino_gz/launch_tools/substitutions.py
Original file line number Diff line number Diff line change
@@ -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)
271 changes: 271 additions & 0 deletions andino_gz/config_gui/default.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
<?xml version="1.0"?>

<!-- Quick start dialog -->
<dialog name="quick_start" show_again="true"/>

<!-- Window -->
<window>
<width>1000</width>
<height>845</height>
<style
material_theme="Light"
material_primary="DeepOrange"
material_accent="LightBlue"
toolbar_color_light="#f3f3f3"
toolbar_text_color_light="#111111"
toolbar_color_dark="#414141"
toolbar_text_color_dark="#f3f3f3"
plugin_toolbar_color_light="#bbdefb"
plugin_toolbar_text_color_light="#111111"
plugin_toolbar_color_dark="#607d8b"
plugin_toolbar_text_color_dark="#eeeeee"
/>
<menus>
<drawer default="false">
</drawer>
</menus>
<dialog_on_exit>true</dialog_on_exit>
</window>

<!-- GUI plugins -->

<!-- 3D scene -->
<plugin filename="MinimalScene" name="3D View">
<ignition-gui>
<title>3D View</title>
<property type="bool" key="showTitleBar">false</property>
<property type="string" key="state">docked</property>
</ignition-gui>

<engine>ogre2</engine>
<scene>scene</scene>
<ambient_light>0.4 0.4 0.4</ambient_light>
<background_color>0.8 0.8 0.8</background_color>
<camera_pose>-2 0 1 0 0 0</camera_pose>
<horizontal_fov>80</horizontal_fov>
<view_controller>orbit</view_controller>
</plugin>

<!-- Plugins that add functionality to the scene -->
<plugin filename="EntityContextMenuPlugin" name="Entity context menu">
<ignition-gui>
<property key="state" type="string">floating</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>
<plugin filename="GzSceneManager" name="Scene Manager">
<ignition-gui>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>
<plugin filename="InteractiveViewControl" name="Interactive view control">
<ignition-gui>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>
<plugin filename="CameraTracking" name="Camera Tracking">
<ignition-gui>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>
<plugin filename="MarkerManager" name="Marker manager">
<ignition-gui>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>
<plugin filename="SelectEntities" name="Select Entities">
<ignition-gui>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>

<plugin filename="Spawn" name="Spawn Entities">
<ignition-gui>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>

<plugin filename="VisualizationCapabilities" name="Visualization Capabilities">
<ignition-gui>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
</plugin>

<!-- World control -->
<plugin filename="WorldControl" name="World control">
<ignition-gui>
<title>World control</title>
<property type="bool" key="showTitleBar">false</property>
<property type="bool" key="resizable">false</property>
<property type="double" key="height">72</property>
<property type="double" key="width">121</property>
<property type="double" key="z">1</property>

<property type="string" key="state">floating</property>
<anchors target="3D View">
<line own="left" target="left"/>
<line own="bottom" target="bottom"/>
</anchors>
</ignition-gui>

<play_pause>true</play_pause>
<step>true</step>
<start_paused>true</start_paused>
<use_event>true</use_event>

</plugin>

<!-- World statistics -->
<plugin filename="WorldStats" name="World stats">
<ignition-gui>
<title>World stats</title>
<property type="bool" key="showTitleBar">false</property>
<property type="bool" key="resizable">false</property>
<property type="double" key="height">110</property>
<property type="double" key="width">290</property>
<property type="double" key="z">1</property>

<property type="string" key="state">floating</property>
<anchors target="3D View">
<line own="right" target="right"/>
<line own="bottom" target="bottom"/>
</anchors>
</ignition-gui>

<sim_time>true</sim_time>
<real_time>true</real_time>
<real_time_factor>true</real_time_factor>
<iterations>true</iterations>
</plugin>

<!-- Insert simple shapes -->
<plugin filename="Shapes" name="Shapes">
<ignition-gui>
<property key="resizable" type="bool">false</property>
<property key="x" type="double">0</property>
<property key="y" type="double">0</property>
<property key="width" type="double">250</property>
<property key="height" type="double">50</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
<property key="cardBackground" type="string">#666666</property>
</ignition-gui>
</plugin>

<!-- Insert lights -->
<plugin filename="Lights" name="Lights">
<ignition-gui>
<property key="resizable" type="bool">false</property>
<property key="x" type="double">250</property>
<property key="y" type="double">0</property>
<property key="width" type="double">150</property>
<property key="height" type="double">50</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
<property key="cardBackground" type="string">#666666</property>
</ignition-gui>
</plugin>

<!-- Translate / rotate -->
<plugin filename="TransformControl" name="Transform control">
<ignition-gui>
<property key="resizable" type="bool">false</property>
<property key="x" type="double">0</property>
<property key="y" type="double">50</property>
<property key="width" type="double">250</property>
<property key="height" type="double">50</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
<property key="cardBackground" type="string">#777777</property>
</ignition-gui>

<!-- disable legacy features used to connect this plugin to GzScene3D -->
<legacy>false</legacy>
</plugin>

<!-- Screenshot -->
<plugin filename="Screenshot" name="Screenshot">
<ignition-gui>
<property key="resizable" type="bool">false</property>
<property key="x" type="double">250</property>
<property key="y" type="double">50</property>
<property key="width" type="double">50</property>
<property key="height" type="double">50</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
<property key="cardBackground" type="string">#777777</property>
</ignition-gui>
</plugin>

<!-- Copy/Paste -->
<plugin filename="CopyPaste" name="CopyPaste">
<ignition-gui>
<property key="resizable" type="bool">false</property>
<property key="x" type="double">300</property>
<property key="y" type="double">50</property>
<property key="width" type="double">100</property>
<property key="height" type="double">50</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
<property key="cardBackground" type="string">#777777</property>
</ignition-gui>
</plugin>

<!-- Entity tree -->
<plugin filename="EntityTree" name="Entity tree">
<ignition-gui>
<property type="string" key="state">docked_collapsed</property>
</ignition-gui>
</plugin>

<!-- Inspector -->
<plugin filename="ComponentInspector" name="Component inspector">
<ignition-gui>
<property type="string" key="state">docked_collapsed</property>
</ignition-gui>
</plugin>

<!-- Teleop -->
<plugin filename="Teleop" name="Teleop">
<ignition-gui>
<property type="string" key="state">docked_collapsed</property>
</ignition-gui>
<topic>/model/andino/cmd_vel</topic>
</plugin>

<!-- Image of the Camera display -->
<plugin filename="ImageDisplay" name="Image Display">
<ignition-gui>
<property key="state" type="string">docked_collapsed</property>
</ignition-gui>
</plugin>
Loading
Loading