Skip to content

Commit 222a8f4

Browse files
authored
Merge pull request #452 from OpenSimulationInterface/feature/tp/had-output
Feature/tp/had output
2 parents 50b0332 + 2893ff2 commit 222a8f4

18 files changed

+145
-19
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ githooks/pre-commit
4040
# PyCharm specific files
4141
.idea
4242
.vscode/settings.json
43+
44+
# Local build tool output
45+
local_build_tools/*.html

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ set(OSI_PROTO_FILES
7777
osi_environment.proto
7878
osi_groundtruth.proto
7979
osi_hostvehicledata.proto
80+
osi_motionrequest.proto
8081
osi_trafficsign.proto
8182
osi_trafficlight.proto
8283
osi_trafficupdate.proto

doc/_config.adoc

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
// This file contains AsciiDoc attributes that shall be used in every AsciiDoc file.
33
// NOTE: Its content is only applied for Asciidoctor!
44
// If the same attribute is defined in the antora.yml (without @), the antora.yml definition takes precedence for Antora.
5-
65
ifndef::root-path[:root-path: ./]
7-
86
:partials-path: {root-path}../_additional_content
97
:asciidoc-resources: ../../../asciidoc-resources
108
:appendix-caption: Annex
119
:page-feedbackurl: https://github.com/OpenSimulationInterface/open-simulation-interface/issues/new
12-
1310
// ifndef::use-antora-rules,include-only-once[]
1411
ifndef::include-only-once[]
1512
:GLO_VAR_STA_ASAM_OpenCRG: ASAM OpenCRG
@@ -27,13 +24,14 @@ ifndef::include-only-once[]
2724
// Replace PLACEHOLDER with the name of your standard, e.g. OpenDRIVE
2825
:THIS_STANDARD: {GLO_VAR_STA_ASAM_OSI}
2926
:asam-terminology: https://code.asam.net/common/asam-terminology/-/raw/main/terms_and_definitions_opendrive.adoc
30-
:imagesdir: {root-path}/images
27+
:imagesdir: {root-path}images
3128
:include-only-once: true
3229
:topicdir: topics
3330
:reusedir: reuse
3431
:toclevels: 3
3532
:xrefstyle: full
36-
:images_open_simulation_interface: {imagesdir}
33+
:images_open_simulation_interface: ../images
34+
:data-uri:
3735
// :images_osi-sensor-model-packaging: ./osi-sensor-model-packaging/doc/images
3836
:doc_open_simulation_interface: ../../open-simulation-interface/doc/
3937
:doc_osi-sensor-model-packaging: ../../osi-sensor-model-packaging/doc/
@@ -43,13 +41,10 @@ ifndef::include-only-once[]
4341
// Please note that this variable has to used in all image includes. Includes here have to use "image::./images..."
4442
// :images_osi_sensor_model_packaging: ./osi-sensor-model-packaging/doc/images // example
4543
:imagesoutdir: ./images/generated_images
46-
4744
endif::[]
48-
4945
ifndef::use-antora-rules[]
5046
include::{asciidoc-resources}/preamble.adoc[]
5147
endif::[]
52-
5348
ifdef::env-gitlab[]
5449
:relfilesuffix: .adoc
5550
endif::[]

doc/architecture/architecture_overview.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ image::{images_open_simulation_interface}/osi-traffic-participant-advanced.png[1
3434

3535
The `HostVehicleData` interface describes the measured internal states of a traffic participant.
3636
OSI currently provides only limited support for data structures that describe measured internal states of traffic participants.
37-
Actuator intentions are currently not covered by OSI and must be handled using a different data description format.
37+
One example would be the `MotionRequest` interface that can be used to communicate the results of the behavior planning to the dynamic model.
3838

3939
NOTE: OSI uses singular instead of plural for `repeated` field names.
4040

doc/architecture/motion_request.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ifndef::include-only-once[]
2+
:root-path: ../
3+
include::{root-path}_config.adoc[]
4+
endif::[]
5+
= Motion Request
6+
7+
`MotionRequest` messages are traffic participant internal messages.
8+
They function as a interface between a motion/behavior planning model and a dynamics model including, for example, controllers and vehicle kinematics.

doc/architecture/traffic_participant.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ The following figure shows the interface of a traffic participant.
2222
.Interface of a traffic participant
2323
image::{images_open_simulation_interface}/osi-traffic-participant-principle.png[1100]
2424

25-
Traffic participant models may use other OSI interfaces internally, for example, to model autonomous vehicles.
26-
The following figure shows a more advanced use case for traffic participants.
25+
Traffic participant models may use other OSI interfaces, for example, the `SensorData` and `MotionRequest` message, internally.
26+
The following figure shows a more advanced use case for traffic participants, that can, for example, be used to model an autonomous vehicle.
2727

2828
[#fig-traffic-participant-other-osi-interfaces]
2929
.Traffic participant using other OSI interfaces internally
-28.4 KB
Loading
-11.9 KB
Loading
Loading
-43.4 KB
Loading
-47.7 KB
Loading

doc/open-simulation-interface_user_guide.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ include::./architecture/sensor_data.adoc[leveloffset=+3]
2525

2626
include::./architecture/traffic_command.adoc[leveloffset=+3]
2727

28+
include::./architecture/motion_request.adoc[leveloffset=+3]
29+
2830
include::./architecture/traffic_update.adoc[leveloffset=+3]
2931

3032
=== Model types

doc/usecases/modeling_traffic_participant.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ The following figure shows a traffic participant with separately modeled behavio
2828
image::{images_open_simulation_interface}/osi-traffic-participant-use-case-2.png[1100]
2929

3030
OSI currently provides only limited support for data structures that describe measured internal states of the traffic participant.
31-
OSI does not currently cover actuator intentions.
32-
These must be handled with a different data description format.
31+
An example for a traffic participant internal interface is the `MotionRequest` message that can be used to communicate planned behaviors from a behavior planning model to a dynamics model including, for example motion controllers and vehicle dynamics.
3332

3433
The following figure shows a more complex traffic participant.
3534

@@ -41,7 +40,6 @@ This use case will probably be relevant for modeling the ego vehicle, which incl
4140
The traffic participant includes an arbitrary number of sensor models.
4241
The sensor models consume sensor view and produce sensor data.
4342
The AD function consumes sensor data and produces input for the dynamics model.
44-
OSI currently does not support data flow to dynamics models.
4543
The loop to the environment simulation is closed via traffic update.
4644

4745
The following figure shows a cooperative use case with both an AD function and a human driver.
@@ -54,4 +52,4 @@ It is possible to model a traffic participant with an AD function in the loop, b
5452
This type of cooperative use case is, for example, relevant to studies on human-machine interaction.
5553
In this example, a virtual on-screen representation of the scenario, or mock-up, is added after the AD function.
5654
The driver-in-the-loop interacts with the dynamics model via this mock-up.
57-
OSI's limitations regarding dynamics-model input apply in this example as well.
55+
OSI currently provides only limited interfaces for data flow between the driver and the dynamics model.

local_build_tools/compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ services:
55
image: asciidoctor/docker-asciidoctor
66
volumes:
77
- ../:/documents
8-
entrypoint: asciidoctor --failure-level WARN -r asciidoctor-kroki -a mathjax -r asciidoctor-bibtex --trace content/index.adoc -o local_build_tools/HTML_content_local_build.html
8+
entrypoint: asciidoctor -r asciidoctor-kroki -a mathjax --trace doc/open-simulation-interface_user_guide.adoc -o local_build_tools/HTML_content_local_build.html

osi_common.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,8 @@ message StatePoint
592592
// Position in the global coordinate system.
593593
//
594594
// \note Remark: The definition of the reference point follows the
595-
// specification of the \c BaseMoving message.
595+
// specification of the \c BaseMoving message, if not specified otherwise
596+
// in the message the StatePoint is used in.
596597
//
597598
optional Vector3d position = 2;
598599

osi_motionrequest.proto

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
syntax = "proto2";
2+
3+
option optimize_for = SPEED;
4+
5+
import "osi_common.proto";
6+
import "osi_version.proto";
7+
8+
package osi3;
9+
10+
//
11+
// \brief This message is intended as an interface between a
12+
// motion-planning function and the actuator management.
13+
// The motion-planning function can thereby be a representation of a
14+
// highly-automated driving function, a human driving behavior model, etc.
15+
//
16+
// The motion-planning function can either send a desired future trajectory or a desired
17+
// future state. The message can be defined by an additional variable.
18+
//
19+
// \note The coordinate system is defined as right-handed.
20+
// All coordinates and orientations are relative to the global coordinate system.
21+
// The reference point of the vehicle is the middle of the rear axis.
22+
// Units are m for positions, m/s for velocities, and m/s^2 for accelerations.
23+
//
24+
message MotionRequest
25+
{
26+
// The interface version used by the sender (simulation environment).
27+
//
28+
optional InterfaceVersion version = 1;
29+
30+
// The data timestamp of the simulation environment.
31+
// A reference to \c Timestamp message.
32+
//
33+
optional Timestamp timestamp = 2;
34+
35+
// Define the type that is used to specify the motion request.
36+
// This must be set. Additionally, the field corresponding to the specified
37+
// option must be set.
38+
//
39+
optional MotionRequestType motion_request_type = 3;
40+
41+
// Defines a desired state.
42+
// If the output option is set to DESIRED_STATE, this field must be set.
43+
//
44+
optional DesiredState desired_state = 4;
45+
46+
// Defines a desired trajectory.
47+
// If the output option is set to DESIRED_TRAJECTORY, this field must be set.
48+
//
49+
optional DesiredTrajectory desired_trajectory = 5;
50+
51+
// Define different options for function output.
52+
// Each option corresponds to a field in the message.
53+
//
54+
enum MotionRequestType
55+
{
56+
// Desired state calculated by the function.
57+
//
58+
MOTION_REQUEST_TYPE_DESIRED_STATE = 0;
59+
60+
// Desired trajectory calculated by the function.
61+
//
62+
MOTION_REQUEST_TYPE_TRAJECTORY = 1;
63+
}
64+
65+
// \brief The desired state is calculated by the function as a result of
66+
// the motion planning stack.
67+
//
68+
// The actuator management is supposed to reach the desired state at the
69+
// specified time.
70+
//
71+
message DesiredState
72+
{
73+
// A reference to \c Timestamp message.
74+
//
75+
optional Timestamp timestamp = 1;
76+
77+
// Intended position to be reached in in x-, y-, and z-direction.
78+
//
79+
optional Vector3d position = 2;
80+
81+
// Intended orientation to be reached containing yaw, pitch and roll angle.
82+
//
83+
optional Orientation3d orientation = 3;
84+
85+
// Intended velocity to be reached in in x-, y-, and z-direction.
86+
//
87+
// Unit: m/s
88+
//
89+
optional Vector3d velocity = 4;
90+
91+
// Intended acceleration to be reached in x-, y-, and z-direction.
92+
//
93+
// Unit: m/s^2
94+
//
95+
optional Vector3d acceleration = 5;
96+
}
97+
98+
// \brief Defined trajectory desired by the function.
99+
//
100+
// This trajectory is the result of the trajectory planning step in the function.
101+
// The task of the actuator management is to follow this trajectory as closely as possible.
102+
// The timestamps inside the trajectory must be defined in global simulation time.
103+
//
104+
// \note The trajectory is kept as a separate message for future extensions.
105+
//
106+
message DesiredTrajectory
107+
{
108+
// The trajectory consists of intended position (x, y, and z) and
109+
// orientation (yaw, pitch and roll) of intended state to be reached.
110+
// A reference to \c StatePoint message.
111+
//
112+
// \note The position within the trajectory point references to the
113+
// middle point of the rear axis.
114+
//
115+
repeated StatePoint trajectory_point = 1;
116+
}
117+
}

osi_object.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ message MovingObject
449449
// realistic simulation of traffic participants that are not under test.
450450
// This information should not be made available to the stack under test.
451451
//
452-
// \note Moving objects are not required to stick to this trajectory, it is
453-
// indicative, and equivalent to the output of a perception + prediction
452+
// \note Moving objects are not required to stick to this trajectory. It is
453+
// indicative and equivalent to the output of a perception and prediction
454454
// system.
455455
//
456456
repeated StatePoint future_trajectory = 8;

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def find_protoc():
6060
'osi_lane.proto',
6161
'osi_logicaldetectiondata.proto',
6262
'osi_logicallane.proto',
63+
'osi_motionrequest.proto',
6364
'osi_object.proto',
6465
'osi_occupant.proto',
6566
'osi_referenceline.proto',

0 commit comments

Comments
 (0)