# Vehicle interface

This page describes the interface of the vehicle interface component. See the [vehicle interface design](<../../../components/vehicle/index.md>) for the concepts and the data flow.

The vehicle interface component sits between the Control component and the vehicle.

The vehicle interface component receives the vehicle commands from Autoware and publishes the vehicle statuses. It communicates with the vehicle by the vehicle-specific protocol.

The optional vehicle command adapter converts the generalized control command (target steering angle, steering rate, velocity, and acceleration) into vehicle-specific control values, for example steering torque, wheel torque, voltage, brake pressure, or accelerator pedal position.

## Communication with the vehicle

The interface to communicate with the vehicle varies between brands and models. For example, a vehicle can use CAN (Controller Area Network) with a ROS 2 driver, such as [pacmod3](<https://github.com/astuff/pacmod3>). In addition, an Autoware-specific interface is often necessary, such as [pacmod\_interface](<https://github.com/tier4/pacmod_interface/tree/main/pacmod_interface>).

## Vehicle adapter

The basic control command of Autoware gives the target motion of the vehicle as speed, acceleration, steering angle, and steering rate. This does not suit all vehicles. As a result, there are two types of vehicles:

- Type 1: A vehicle that takes a subset of speed, acceleration, steering angle, and steering rate directly.
- Type 2: A vehicle that uses custom commands, for example motor torque, voltage, or pedal pressure.

For vehicles of type 2, a vehicle adapter is necessary to convert the Autoware control command into the vehicle specific commands. For an example, see the [autoware\_raw\_vehicle\_cmd\_converter](<https://autowarefoundation.github.io/autoware_universe/main/vehicle/autoware_raw_vehicle_cmd_converter/>). It converts the target acceleration and the target steering into accelerator, brake, and steering inputs, and publishes them as `/control/command/actuation_cmd`. It uses an acceleration map and a brake map, which give the pedal value for each velocity and acceleration. If its parameters ask for it, it uses `/vehicle/status/actuation_status` as feedback, for example for the variable gear ratio of the steering.

The `autoware_vehicle_msgs` package of `autoware_msgs` 1.13.0 also defines [ActuationCommandStamped](<https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/msg/ActuationCommandStamped.msg>) and [ActuationReportStamped](<https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/msg/ActuationReportStamped.msg>). In Autoware 2.0.0, `autoware_raw_vehicle_cmd_converter` and the `autoware_component_interface_specs_universe` package still use the `tier4_vehicle_msgs` types in the tables below.

## Inputs from Autoware

| Name | Topic | Type | Description |
| --- | --- | --- | --- |
| Control command | `/control/command/control_cmd` | [autoware\_control\_msgs/msg/Control](<https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_control_msgs/msg/Control.msg>) | Target controls of the vehicle, for example the steering angle and the velocity |
| Control mode command | `/control/control_mode_request` (service) | [autoware\_vehicle\_msgs/srv/ControlModeCommand](<https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/srv/ControlModeCommand.srv>) | Request to switch between manual and autonomous driving |
| Gear command | `/control/command/gear_cmd` | [autoware\_vehicle\_msgs/msg/GearCommand](<https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/msg/GearCommand.msg>) | Target gear of the vehicle |
| Hazard lights command | `/control/command/hazard_lights_cmd` | [autoware\_vehicle\_msgs/msg/HazardLightsCommand](<https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/msg/HazardLightsCommand.msg>) | Target values of the hazard lights |
| Turn indicator command | `/control/command/turn_indicators_cmd` | [autoware\_vehicle\_msgs/msg/TurnIndicatorsCommand](<https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/msg/TurnIndicatorsCommand.msg>) | Target values of the turn signals |
| Actuation command | `/control/command/actuation_cmd` | [tier4\_vehicle\_msgs/msg/ActuationCommandStamped](<https://github.com/tier4/tier4_autoware_msgs/blob/tier4/universe/tier4_vehicle_msgs/msg/ActuationCommandStamped.msg>) | Target accelerator, brake, and steering values. Only for a vehicle of type 2 that uses `autoware_raw_vehicle_cmd_converter`. |
| Door command | `/vehicle/doors/command` (service) | [autoware\_adapi\_v1\_msgs/srv/SetDoorCommand](<https://github.com/autowarefoundation/autoware_adapi_msgs/blob/main/autoware_adapi_v1_msgs/vehicle/srv/SetDoorCommand.srv>) | Request to open or close the doors. Only for a vehicle with doors that Autoware controls. The AD API calls this service. |
| Door layout | `/vehicle/doors/layout` (service) | [autoware\_adapi\_v1\_msgs/srv/GetDoorLayout](<https://github.com/autowarefoundation/autoware_adapi_msgs/blob/main/autoware_adapi_v1_msgs/vehicle/srv/GetDoorLayout.srv>) | Request for the door layout of the vehicle. Only for a vehicle with doors that Autoware controls. The AD API calls this service. |

## Outputs to Autoware

| Name | Topic | Type | Optional | Description |
| --- | --- | --- | --- | --- |
| Actuation status | `/vehicle/status/actuation_status` | [tier4\_vehicle\_msgs/msg/ActuationStatusStamped](<https://github.com/tier4/tier4_autoware_msgs/blob/tier4/universe/tier4_vehicle_msgs/msg/ActuationStatusStamped.msg>) | Yes (vehicle with mechanical inputs) | Current acceleration, brake, and steer values reported by the vehicle |
| Battery charge | `/vehicle/status/battery_charge` | [tier4\_vehicle\_msgs/msg/BatteryStatus](<https://github.com/tier4/tier4_autoware_msgs/blob/tier4/universe/tier4_vehicle_msgs/msg/BatteryStatus.msg>) | Yes | Current energy level of the vehicle. The AD API reports it as a vehicle metric. |
| Control mode | `/vehicle/status/control_mode` | [autoware\_vehicle\_msgs/msg/ControlModeReport](<https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/msg/ControlModeReport.msg>) |  | Current control mode, for example manual or autonomous |
| Door status | `/vehicle/doors/status` | [autoware\_adapi\_v1\_msgs/msg/DoorStatusArray](<https://github.com/autowarefoundation/autoware_adapi_msgs/blob/main/autoware_adapi_v1_msgs/vehicle/msg/DoorStatusArray.msg>) | Yes | Current door status |
| Gear report | `/vehicle/status/gear_status` | [autoware\_vehicle\_msgs/msg/GearReport](<https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/msg/GearReport.msg>) |  | Current gear of the vehicle |
| Hazard light status | `/vehicle/status/hazard_lights_status` | [autoware\_vehicle\_msgs/msg/HazardLightsReport](<https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/msg/HazardLightsReport.msg>) |  | Current hazard lights status |
| Steering status | `/vehicle/status/steering_status` | [autoware\_vehicle\_msgs/msg/SteeringReport](<https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/msg/SteeringReport.msg>) |  | Current steering angle of the steering tire |
| Turn indicators status | `/vehicle/status/turn_indicators_status` | [autoware\_vehicle\_msgs/msg/TurnIndicatorsReport](<https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/msg/TurnIndicatorsReport.msg>) |  | Current state of the left and right turn indicators |
| Velocity status | `/vehicle/status/velocity_status` | [autoware\_vehicle\_msgs/msg/VelocityReport](<https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_vehicle_msgs/msg/VelocityReport.msg>) |  | Current velocities of the vehicle (longitudinal, lateral, heading rate) |

The [Component interfaces](<../index.md>) page lists the QoS of these topics. The commands and the statuses of the vehicle interface also have detailed specifications:

- [/control/command/control\_cmd](<../list/control-command-control-cmd/index.md>)
- [/control/command/gear\_cmd](<../list/control-command-gear-cmd/index.md>)
- [/control/command/turn\_indicators\_cmd](<../list/control-command-turn-indicators-cmd/index.md>)
- [/control/command/hazard\_lights\_cmd](<../list/control-command-hazard-lights-cmd/index.md>)
- [/control/control\_mode\_request](<../list/control-control-mode-request/index.md>)
- [/vehicle/status/control\_mode](<../list/vehicle-status-control-mode/index.md>)
- [/vehicle/status/velocity\_status](<../list/vehicle-status-velocity-status/index.md>)
- [/vehicle/status/steering\_status](<../list/vehicle-status-steering-status/index.md>)
- [/vehicle/status/gear\_status](<../list/vehicle-status-gear-status/index.md>)
- [/vehicle/status/turn\_indicators\_status](<../list/vehicle-status-turn-indicators-status/index.md>)
- [/vehicle/status/hazard\_lights\_status](<../list/vehicle-status-hazard-lights-status/index.md>)
