Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-labs committed Mar 2, 2024
1 parent 9527e40 commit df06ccd
Show file tree
Hide file tree
Showing 46 changed files with 90 additions and 298 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## TL;DR

Scenario execution is a backend- and middleware-agnostic library written in Python based on the generic scenario description language [OpenSCENARIO 2](https://www.asam.net/static_downloads/public/asam-openscenario/2.0.0/welcome.html) and [pytrees](https://py-trees.readthedocs.io/en/devel/).
It reads a scenario definition from a file and then executes it, reusing available checks and behaviors. It is easily extendable through a library mechanism.
It reads a scenario definition from a file and then executes it, reusing available checks and actions. It is easily extendable through a library mechanism.
This separation of the scenario definition from implementation massively reduces the manual efforts of scenario creation.

To give an impression of the functionality of scenario execution, the following animation shows an example scenario with a turtlebot-like robot in simulation using Nav2 to navigate towards a specified navigation goal in a simulated warehouse environment.
Expand Down
4 changes: 2 additions & 2 deletions examples/example_simulation/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example Simulation Navigation

To run the Example Simulation Navigation with scenario, first build the Example Simulation Navigation Package:
To run the Example Simulation Navigation with scenario, first build the `example_simulation` package:

```bash
colcon build --packages-up-to example_simulation
Expand All @@ -18,6 +18,6 @@ Now, run the following command to launch the scenario:
ros2 launch tb4_sim_scenario sim_nav_scenario_launch.py scenario:=examples/example_simulation/scenarios/example_simulation.osc
```

A turtlebot is initialsed with nav2 which drives to a point and back. During the ride an object is spawned in front of the turtlebot which will then drive around the object.
A turtlebot is initialised with nav2 which drives to a goal and back. During the ride an obstacle is spawned in front of the turtlebot which will then drive around the object.

For a more detailed understanding of the code structure and scenario implementation please refer to the [tutorial documentation](https://intellabs.github.io/scenario_execution/tutorials.html).
5 changes: 1 addition & 4 deletions examples/example_simulation/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@
<package format="3">
<name>example_simulation</name>
<version>1.0.0</version>
<description>Simulation example for scenario execution</description>
<description>Scenario Execution Example for Simulation</description>
<author email="[email protected]">Intel Labs</author>
<maintainer email="[email protected]">Intel Labs</maintainer>
<license file="../../LICENSE">Apache-2.0</license>

<depend>scenario_execution</depend>
<depend>scenario_execution_rviz</depend>
<depend>scenario_execution_gazebo</depend>
<depend>gazebo_tf_publisher</depend>
<depend>tb4_sim_scenario</depend>
<depend>navigation2</depend>
<depend>nav2_bringup</depend>

<exec_depend>rclpy</exec_depend>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ def log_output(out, buffer):
process = subprocess.Popen(launch_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)

log_stdout_thread = Thread(target=log_output, args=(process.stdout, output, ))
log_stdout_thread.daemon = True # die with the program TODO: remove
log_stdout_thread.daemon = True # die with the program
log_stdout_thread.start()

log_stderr_thread = Thread(target=log_output, args=(process.stderr, output, ))
log_stderr_thread.daemon = True # die with the program TODO: remove
log_stderr_thread.daemon = True # die with the program
log_stderr_thread.start()

print(f"### Waiting for process to finish...")
Expand Down
2 changes: 1 addition & 1 deletion scenario_execution/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package format="3">
<name>scenario_execution</name>
<version>1.0.0</version>
<description>Package for ROS scenario execution</description>
<description>ROS Scenario Execution</description>
<author email="[email protected]">Intel Labs</author>
<maintainer email="[email protected]">Intel Labs</maintainer>
<license file="../LICENSE">Apache-2.0</license>
Expand Down
6 changes: 2 additions & 4 deletions scenario_execution/scenario_execution/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@

""" Main entry for scenario execution """

from . import action_plugins
from . import external_methods
from . import actions
from .logging_ros import RosLogger
from .scenario_execution_ros import ROSScenarioExecution

__all__ = [
'action_plugins',
'external_methods',
'actions',
'RosLogger',
'ROSScenarioExecution'
]

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

class InitNav2State(Enum):
"""
States for executing a nav-to-pose with nav2
States for executing a initialization of nav2
"""
IDLE = 1
LOCALIZER_STATE_REQUESTED = 2
Expand All @@ -54,14 +54,7 @@ class InitNav2State(Enum):

class InitNav2(py_trees.behaviour.Behaviour):
"""
Class to navigate to a pose
Args:
initial_pose: a 6 numbers list in str form containing the initial pose of the entity
in the shape of [x, y, z. roll, pitch, yaw].
goal_pose: a 6 numbers list in str form containing the goal pose of the entity
in the shape of [x, y, z. roll, pitch, yaw].
Class to initialize nav2
"""

def __init__(self, name, associated_actor, initial_pose: list, base_frame_id: str, wait_for_initial_pose: bool, use_initial_pose: bool, namespace_override: str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ class NavThroughPosesState(Enum):
class NavThroughPoses(py_trees.behaviour.Behaviour):
"""
Class to navigate through poses
Args:
goal_pose: a 6 numbers list in str form containing the goal pose of the entity
in the shape of [x, y, z. roll, pitch, yaw].
"""

def __init__(self, name: str, associated_actor, goal_poses: list, monitor_progress: bool, namespace_override: str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ class NavToPoseState(Enum):
class NavToPose(py_trees.behaviour.Behaviour):
"""
Class to navigate to a pose
Args:
goal_pose: a 6 numbers list in str form containing the goal pose of the entity
in the shape of [x, y, z. roll, pitch, yaw].
"""

def __init__(self, name: str, associated_actor, goal_pose: list, monitor_progress: bool, action_topic: str, namespace_override: str) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
class OdometryDistanceTraveled(py_trees.behaviour.Behaviour):
"""
Class to wait for a certain covered distance, based on odometry
Args:
distance [float]: expected distance traveled
namespace [str]: namspace of odom topic
"""

def __init__(self, name, associated_actor, distance: float):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from enum import Enum

import py_trees
from scenario_execution_base.behaviors import RunExternalProcess
from scenario_execution_base.actions import RunExternalProcess
import shutil
import signal

Expand All @@ -38,13 +38,6 @@ class RosBagRecordActionState(Enum):
class RosBagRecord(RunExternalProcess):
"""
Class to execute ros bag recording
Args:
destination_dir [str]: destination directory
topics [str]: topics to record
timestamp_suffix [bool]: add timestamp suffix to output dir?
hidden_topics [bool]: whether to record hidden topics
"""

def __init__(self, name, destination_dir: str, topics: list, timestamp_suffix: bool, hidden_topics: bool, storage: str):
Expand Down
19 changes: 0 additions & 19 deletions scenario_execution/scenario_execution/external_methods/__init__.py

This file was deleted.

28 changes: 0 additions & 28 deletions scenario_execution/scenario_execution/external_methods/power.py

This file was deleted.

Loading

0 comments on commit df06ccd

Please sign in to comment.