mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Add HAL changes for LANE_CENTERING_ASSIST_COMMAND
Bug: 264946354 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Test: atest CtsCarTestCases:LaneCenteringAssistCommandTest Test: atest AndroidCarApiTest:LaneCenteringAssistCommandTest Change-Id: I126ed24748f9ef7cd9bc0541e2bdbf75eac43edf
This commit is contained in:
@@ -250,6 +250,7 @@ std::unordered_map<VehicleProperty, VehiclePropertyAccess> AccessForVehiclePrope
|
||||
{VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE},
|
||||
{VehicleProperty::LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess::READ},
|
||||
{VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE},
|
||||
{VehicleProperty::LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyAccess::WRITE},
|
||||
{VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess::READ},
|
||||
{VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE},
|
||||
{VehicleProperty::ADAPTIVE_CRUISE_CONTROL_ENABLED, VehiclePropertyAccess::READ_WRITE},
|
||||
|
||||
@@ -250,6 +250,7 @@ std::unordered_map<VehicleProperty, VehiclePropertyChangeMode> ChangeModeForVehi
|
||||
{VehicleProperty::LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
|
||||
{VehicleProperty::LANE_KEEP_ASSIST_STATE, VehiclePropertyChangeMode::ON_CHANGE},
|
||||
{VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
|
||||
{VehicleProperty::LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyChangeMode::ON_CHANGE},
|
||||
{VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyChangeMode::ON_CHANGE},
|
||||
{VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
|
||||
{VehicleProperty::ADAPTIVE_CRUISE_CONTROL_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
|
||||
|
||||
@@ -242,6 +242,7 @@ public final class AccessForVehicleProperty {
|
||||
Map.entry(VehicleProperty.LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE),
|
||||
Map.entry(VehicleProperty.LANE_KEEP_ASSIST_STATE, VehiclePropertyAccess.READ),
|
||||
Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE),
|
||||
Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyAccess.WRITE),
|
||||
Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess.READ),
|
||||
Map.entry(VehicleProperty.EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess.READ_WRITE),
|
||||
Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_ENABLED, VehiclePropertyAccess.READ_WRITE),
|
||||
|
||||
@@ -242,6 +242,7 @@ public final class ChangeModeForVehicleProperty {
|
||||
Map.entry(VehicleProperty.LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
|
||||
Map.entry(VehicleProperty.LANE_KEEP_ASSIST_STATE, VehiclePropertyChangeMode.ON_CHANGE),
|
||||
Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
|
||||
Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyChangeMode.ON_CHANGE),
|
||||
Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_STATE, VehiclePropertyChangeMode.ON_CHANGE),
|
||||
Map.entry(VehicleProperty.EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
|
||||
Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
|
||||
|
||||
@@ -45,6 +45,7 @@ using ::aidl::android::hardware::automotive::vehicle::EvsServiceType;
|
||||
using ::aidl::android::hardware::automotive::vehicle::ForwardCollisionWarningState;
|
||||
using ::aidl::android::hardware::automotive::vehicle::FuelType;
|
||||
using ::aidl::android::hardware::automotive::vehicle::GsrComplianceRequirementType;
|
||||
using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistCommand;
|
||||
using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistState;
|
||||
using ::aidl::android::hardware::automotive::vehicle::LaneKeepAssistState;
|
||||
using ::aidl::android::hardware::automotive::vehicle::RawPropValues;
|
||||
@@ -222,6 +223,8 @@ JsonValueParser::JsonValueParser() {
|
||||
std::make_unique<ConstantParser<BlindSpotWarningState>>();
|
||||
mConstantParsersByType["LaneKeepAssistState"] =
|
||||
std::make_unique<ConstantParser<LaneKeepAssistState>>();
|
||||
mConstantParsersByType["LaneCenteringAssistCommand"] =
|
||||
std::make_unique<ConstantParser<LaneCenteringAssistCommand>>();
|
||||
mConstantParsersByType["LaneCenteringAssistState"] =
|
||||
std::make_unique<ConstantParser<LaneCenteringAssistState>>();
|
||||
mConstantParsersByType["Constants"] = std::make_unique<LocalVariableParser>();
|
||||
|
||||
@@ -3292,6 +3292,9 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"property": "VehicleProperty::LANE_CENTERING_ASSIST_COMMAND"
|
||||
},
|
||||
{
|
||||
"property": "VehicleProperty::LANE_CENTERING_ASSIST_STATE",
|
||||
"defaultValue": {
|
||||
|
||||
@@ -149,6 +149,8 @@ We support the following constant types:
|
||||
|
||||
* LaneKeepAssistState
|
||||
|
||||
* LaneCenteringAssistCommand
|
||||
|
||||
* LaneCenteringAssistState
|
||||
|
||||
* ErrorState
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <aidl/android/hardware/automotive/vehicle/GetValueResult.h>
|
||||
#include <aidl/android/hardware/automotive/vehicle/GetValueResults.h>
|
||||
#include <aidl/android/hardware/automotive/vehicle/GsrComplianceRequirementType.h>
|
||||
#include <aidl/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.h>
|
||||
#include <aidl/android/hardware/automotive/vehicle/LaneCenteringAssistState.h>
|
||||
#include <aidl/android/hardware/automotive/vehicle/LaneKeepAssistState.h>
|
||||
#include <aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.h>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
|
||||
// two cases:
|
||||
// 1). this is a frozen version file - do not edit this in any case.
|
||||
// 2). this is a 'current' file. If you make a backwards compatible change to
|
||||
// the interface (from the latest frozen version), the build system will
|
||||
// prompt you to update this file with `m <name>-update-api`.
|
||||
//
|
||||
// You must not make a backward incompatible change to any AIDL file built
|
||||
// with the aidl_interface module type with versions property set. The module
|
||||
// type is used to build AIDL files in a way that they can be used across
|
||||
// independently updatable components of the system. If a device is shipped
|
||||
// with such a backward incompatible change, it has a high risk of breaking
|
||||
// later when a module using the interface is updated, e.g., Mainline modules.
|
||||
|
||||
package android.hardware.automotive.vehicle;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum LaneCenteringAssistCommand {
|
||||
ACTIVATE = 1,
|
||||
DEACTIVATE = 2,
|
||||
}
|
||||
@@ -248,6 +248,7 @@ enum VehicleProperty {
|
||||
LANE_KEEP_ASSIST_ENABLED = (((0x1008 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313928 */,
|
||||
LANE_KEEP_ASSIST_STATE = (((0x1009 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411081 */,
|
||||
LANE_CENTERING_ASSIST_ENABLED = (((0x100A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313930 */,
|
||||
LANE_CENTERING_ASSIST_COMMAND = (((0x100B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411083 */,
|
||||
LANE_CENTERING_ASSIST_STATE = (((0x100C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411084 */,
|
||||
EMERGENCY_LANE_KEEP_ASSIST_ENABLED = (((0x100D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313933 */,
|
||||
ADAPTIVE_CRUISE_CONTROL_ENABLED = (((0x100F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313935 */,
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.automotive.vehicle;
|
||||
|
||||
/**
|
||||
* Used by Lane Centering Assist (LCA) to enumerate commands.
|
||||
*/
|
||||
@VintfStability
|
||||
@Backing(type="int")
|
||||
enum LaneCenteringAssistCommand {
|
||||
/**
|
||||
* When VehicleProperty#LANE_CENTERING_ASSIST_STATE = LaneCenteringAssistState#ENABLED, this
|
||||
* command sends a request to activate steering control that keeps the vehicle centered in its
|
||||
* lane. While waiting for the LCA System to take control of the vehicle,
|
||||
* VehicleProperty#LANE_CENTERING_ASSIST_STATE must be in the
|
||||
* LaneCenteringAssistState#ACTIVATION_REQUESTED state. Once the vehicle takes control of
|
||||
* steering, then VehicleProperty#LANE_CENTERING_ASSIST_STATE must be in the
|
||||
* LaneCenteringAssistState#ACTIVATED state. Otherwise, an error can be communicated through an
|
||||
* ErrorState value.
|
||||
*/
|
||||
ACTIVATE = 1,
|
||||
/**
|
||||
* When VehicleProperty#LANE_CENTERING_ASSIST_STATE is set to
|
||||
* LaneCenteringAssistState#ACTIVATION_REQUESTED or LaneCenteringAssistState#ACTIVATED, this
|
||||
* command deactivates steering control and the driver should take full control of the vehicle.
|
||||
* If this command succeeds, VehicleProperty#LANE_CENTERING_ASSIST_STATE must be updated to
|
||||
* LaneCenteringAssistState#ENABLED.
|
||||
*/
|
||||
DEACTIVATE = 2,
|
||||
}
|
||||
@@ -3657,6 +3657,30 @@ enum VehicleProperty {
|
||||
LANE_CENTERING_ASSIST_ENABLED =
|
||||
0x100A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
|
||||
|
||||
/**
|
||||
* Lane Centering Assist (LCA) commands.
|
||||
*
|
||||
* Commands to activate and suspend LCA. They are only valid when LANE_CENTERING_ASSIST_ENABLED
|
||||
* = true. Otherwise, these commands must return StatusCode#NOT_AVAILABLE or
|
||||
* StatusCode#NOT_AVAILABLE_DISABLED.
|
||||
*
|
||||
* When the command ACTIVATE from LaneCenteringAssistCommmand is sent,
|
||||
* LANE_CENTERING_ASSIST_STATE must be set to LaneCenteringAssistState#ACTIVATION_REQUESTED.
|
||||
* When the ACTIVATE command succeeds, LANE_CENTERING_ASSIST_STATE must be set to
|
||||
* LaneCenteringAssistState#ACTIVATED. When the command DEACTIVATE from
|
||||
* LaneCenteringAssistCommmand succeeds, LANE_CENTERING_ASSIST_STATE must be set to
|
||||
* LaneCenteringAssistState#ENABLED.
|
||||
*
|
||||
* For the global area ID (0), the VehicleAreaConfig#supportedEnumValues must be defined unless
|
||||
* all enum values of LaneCenteringAssistCommand are supported.
|
||||
*
|
||||
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
|
||||
* @access VehiclePropertyAccess.WRITE
|
||||
* @data_enum LaneCenteringAssistCommmand
|
||||
*/
|
||||
LANE_CENTERING_ASSIST_COMMAND =
|
||||
0x100B + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
|
||||
|
||||
/**
|
||||
* Lane Centering Assist (LCA) state.
|
||||
*
|
||||
|
||||
@@ -738,6 +738,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistEnabledConfig
|
||||
VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
|
||||
}
|
||||
|
||||
TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistCommandConfig) {
|
||||
verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_COMMAND, VehiclePropertyAccess::WRITE,
|
||||
VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
|
||||
VehicleArea::GLOBAL, VehiclePropertyType::INT32);
|
||||
}
|
||||
|
||||
TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistStateConfig) {
|
||||
verifyProperty(VehicleProperty::LANE_CENTERING_ASSIST_STATE, VehiclePropertyAccess::READ,
|
||||
VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
|
||||
|
||||
Reference in New Issue
Block a user