Skip to content

Commit

Permalink
feat(control-messages): add control messages (#11)
Browse files Browse the repository at this point in the history
Signed-off-by: M. Fatih Cırıt <[email protected]>
  • Loading branch information
xmfcx authored Jun 6, 2022
1 parent 2ce4d9c commit f54db16
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 0 deletions.
3 changes: 3 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Copyright 2022 The Autoware Foundation

Some of the messages within this repository are based on autoware_auto_msgs messages that were developed in cooperation with Apex.AI, Inc.
26 changes: 26 additions & 0 deletions autoware_control_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.5)
project(autoware_control_msgs)

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

set(msg_files
"msg/Control.msg"
"msg/ControlHorizon.msg"
"msg/Lateral.msg"
"msg/Longitudinal.msg")

set(msg_dependencies
builtin_interfaces)

rosidl_generate_interfaces(${PROJECT_NAME}
${msg_files}
DEPENDENCIES ${msg_dependencies}
ADD_LINTER_TESTS)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_auto_package()
43 changes: 43 additions & 0 deletions autoware_control_msgs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# autoware_control_msgs

## Design

Vehicle dimensions and axes: <https://autowarefoundation.github.io/autoware-documentation/main/design/autoware-interfaces/components/vehicle-dimensions/>

### Lateral.msg

Defines a lateral control command message with a timestamp.

The message conveys the expectation for vehicle's lateral state to be in the given configuration in the time point: `control_time`.

- The field `steering_tire_angle` is required.
- The field `steering_tire_rotation_rate` is optional but may be required by some nodes.
- If this field is used, `is_defined_steering_tire_rotation_rate` must be set `true`.

### Longitudinal.msg

Defines a longitudinal control command message with a timestamp.

The message conveys the expectation for vehicle's longitudinal state to be in the given configuration in the time point: `control_time`.

- The field `velocity` is required.
- The field `acceleration` is optional but may be required by some nodes.
- If this field is used, `is_defined_acceleration` must be set `true`.
- The field `jerk` is optional but may be required by some nodes.
- If this field is used, `is_defined_jerk` must be set `true`.

### Control.msg

Defines a control command message, combining `Lateral.msg` and `Longitudinal.msg`.

The message conveys the expectation for vehicle's combined control state to be in the given configuration in the time point: `control_time`.

If the `control_time` is defined, the `control_time` field in the `lateral` and `longitudinal` fields are ignored.

### ControlHorizon.msg

Defines a control commands array calculated for a future horizon.

- Control messages are ordered from near to far future `[0 to N)` with `time_step_ms` increments.
- First element of the array contains the control signals at the `control_time` of this message.
- The `control_time` field in each element of the controls array can be ignored.
13 changes: 13 additions & 0 deletions autoware_control_msgs/msg/Control.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Control message with lateral and longitudinal components

# Time this message was created
builtin_interfaces/Time stamp

# Time this configuration state is expected to be achieved in (optional)
builtin_interfaces/Time control_time

# Lateral control command
Lateral lateral

# Longitudinal control command
Longitudinal longitudinal
18 changes: 18 additions & 0 deletions autoware_control_msgs/msg/ControlHorizon.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Control messages calculated for a future horizon
#
# Control messages are ordered from near to far future [0 to N) with time_step_ms increments.
#
# First element of the array contains the control signals at the control_time of this message.
#
# The control_time field in each element of the controls array can be ignored.

# Time this message was created
builtin_interfaces/Time stamp

# Time when controls[0] configuration state is expected to be achieved in
builtin_interfaces/Time control_time

# Time difference between consecutive elements of the controls array in milliseconds
float32 time_step_ms

Control[] controls
24 changes: 24 additions & 0 deletions autoware_control_msgs/msg/Lateral.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Lateral control message for Ackermann-style platforms
#
# Note regarding tires: If the platform has multiple steering tires, the commands
# given here are for a virtual tire at the average lateral position of the steering tires.
#
# Look up Ackermann Bicycle Model for more details
#
# Positive values represents left inclination (if forward)
# Negative values represents right inclination (if forward)

# Time this message was created
builtin_interfaces/Time stamp

# Time this configuration state is expected to be achieved in (optional)
builtin_interfaces/Time control_time

# Desired angle of the steering tire in rad (radians)
float32 steering_tire_angle

# Desired rate of change of the steering tire angle in rad/s
float32 steering_tire_rotation_rate

# Controller has filled in the steering_tire_rotation_rate value
bool is_defined_steering_tire_rotation_rate
27 changes: 27 additions & 0 deletions autoware_control_msgs/msg/Longitudinal.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Longitudinal control message
#
# Values are in the base_link frame in X axis
#
# Positive values represent forward motion (+X)
# Negative values represent backward motion (-X)

# Time this message was created
builtin_interfaces/Time stamp

# Time this configuration state is expected to be achieved in (optional)
builtin_interfaces/Time control_time

# Desired vehicle velocity in in m/s
float32 velocity

# Desired vehicle acceleration in m/s²
float32 acceleration

# Desired vehicle jerk in m/s³
float32 jerk

# Controller has filled in the acceleration value
bool is_defined_acceleration

# Controller has filled in the jerk value
bool is_defined_jerk
27 changes: 27 additions & 0 deletions autoware_control_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>autoware_control_msgs</name>
<version>1.0.0</version>
<description>Autoware control messages package.</description>

<maintainer email="[email protected]">M. Fatih Cırıt</maintainer>

<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>

<depend>builtin_interfaces</depend>

<exec_depend>rosidl_default_runtime</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<member_of_group>rosidl_interface_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
1 change: 1 addition & 0 deletions build_depends.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repositories:

0 comments on commit f54db16

Please sign in to comment.