Add EVS configurations for Trout
Test: build and flash with vivid kernel driver enabled, then:
```
adb root
adb shell android.hardware.automotive.evs@1.1-sample &
adb shell android.automotive.evs.manager@1.1 &
adb shell evs_app --test
```
Bug: 178415784
Change-Id: Ia5d5a7c27ff548b3607dee4466ab8920f078f0ca
diff --git a/aosp_trout_common.mk b/aosp_trout_common.mk
index 2b16a37..a3e56a4 100644
--- a/aosp_trout_common.mk
+++ b/aosp_trout_common.mk
@@ -65,6 +65,10 @@
android.hardware.automotive.evs@1.1-sample \
evs_app \
+LOCAL_EVS_PRODUCT_COPY_FILES ?= \
+ device/google/trout/product_files/etc/automotive/evs/config_override.json:${TARGET_COPY_OUT_SYSTEM}/etc/automotive/evs/config_override.json \
+ device/google/trout/product_files/vendor/etc/automotive/evs/evs_configuration_override.xml:$(TARGET_COPY_OUT_VENDOR)/etc/automotive/evs/evs_configuration_override.xml \
+
BOARD_SEPOLICY_DIRS += device/google/trout/sepolicy/vendor/google
# Disable Vulkan feature flag as it is not supported on trout
@@ -88,5 +92,8 @@
tinyplay \
${LOCAL_EVS_PRODUCT_PACKAGE} \
+PRODUCT_COPY_FILES += \
+ ${LOCAL_EVS_PRODUCT_COPY_FILES} \
+
# TODO(b/162901005): Include computepipe once this project points to main.
# include packages/services/Car/cpp/computepipe/products/computepipe.mk
diff --git a/product_files/etc/automotive/evs/config_override.json b/product_files/etc/automotive/evs/config_override.json
new file mode 100644
index 0000000..d5bf5d8
--- /dev/null
+++ b/product_files/etc/automotive/evs/config_override.json
@@ -0,0 +1,69 @@
+{
+ "car" : {
+ "width" : 76.7,
+ "wheelBase" : 117.9,
+ "frontExtent" : 44.7,
+ "rearExtent" : 40 },
+ "displays" : [
+ {
+ "displayPort" : 0,
+ "frontRange" : 100,
+ "rearRange" : 100
+ },
+ {
+ "displayPort" : 1,
+ "frontRange" : 100,
+ "rearRange" : 100
+ }
+ ],
+ "graphic" : {
+ "frontPixel" : -27,
+ "rearPixel" : 273
+ },
+ "cameras" : [
+ {
+ "cameraId" : "/dev/video0",
+ "function" : "reverse,park",
+ "x" : 0.0,
+ "y" : 20.0,
+ "z" : 48,
+ "yaw" : 180,
+ "pitch" : -10,
+ "hfov" : 115,
+ "vfov" : 80
+ },
+ {
+ "cameraId" : "1",
+ "function" : "front,park",
+ "x" : 0.0,
+ "y" : 100.0,
+ "z" : 48,
+ "yaw" : 0,
+ "pitch" : -10,
+ "hfov" : 115,
+ "vfov" : 80
+ },
+ {
+ "cameraId" : "2",
+ "function" : "right,park",
+ "x" : -25.0,
+ "y" : 60.0,
+ "z" : 88,
+ "yaw" : -90,
+ "pitch" : -10,
+ "hfov" : 60,
+ "vfov" : 62
+ },
+ {
+ "cameraId" : "3",
+ "function" : "left, park",
+ "x" : 20.0,
+ "y" : 60.0,
+ "z" : 88,
+ "yaw" : 90,
+ "pitch" : -10,
+ "hfov" : 60,
+ "vfov" : 62
+ }
+ ]
+}
diff --git a/product_files/vendor/etc/automotive/evs/evs_configuration_override.xml b/product_files/vendor/etc/automotive/evs/evs_configuration_override.xml
new file mode 100644
index 0000000..8a99e06
--- /dev/null
+++ b/product_files/vendor/etc/automotive/evs/evs_configuration_override.xml
@@ -0,0 +1,69 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!-- Copyright (C) 2021 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.
+-->
+
+<!-- Exterior View System Example Configuration
+
+ Android Automotive axes are used to define coordinates.
+ See https://source.android.com/devices/sensors/sensor-types#auto_axes
+
+ Use evs_configuration.dtd with xmllint tool, to validate XML configuration file
+-->
+
+<configuration>
+ <!-- system configuration -->
+ <system>
+ <!-- number of cameras available to EVS -->
+ <num_cameras value='1'/>
+ </system>
+
+ <!-- camera device information -->
+ <camera>
+ <!-- camera device starts -->
+ <device id='/dev/video0' position='rear'>
+ <caps>
+ <!-- list of supported controls -->
+ <supported_controls>
+ <control name='BRIGHTNESS' min='0' max='255'/>
+ <control name='CONTRAST' min='0' max='255'/>
+ <control name='AUTO_WHITE_BALANCE' min='0' max='1'/>
+ <control name='WHITE_BALANCE_TEMPERATURE' min='2000' max='7500'/>
+ <control name='SHARPNESS' min='0' max='255'/>
+ <control name='AUTO_FOCUS' min='0' max='1'/>
+ <control name='ABSOLUTE_FOCUS' min='0' max='255' step='5'/>
+ <control name='ABSOLUTE_ZOOM' min='100' max='400'/>
+ </supported_controls>
+
+ <!-- list of supported stream configurations -->
+ <!-- vivid webcam input support below three resolutions -->
+ <stream id='0' width='1280' height='720' format='RGBA_8888' framerate='5'/>
+ <stream id='1' width='640' height='360' format='RGBA_8888' framerate='15'/>
+ <stream id='2' width='360' height='180' format='RGBA_8888' framerate='30'/>
+ </caps>
+
+ <!-- list of parameters -->
+ <characteristics/>
+ </device>
+ </camera>
+
+ <!-- display device starts -->
+ <display>
+ <device id='display0' position='driver'>
+ <caps>
+ <!-- list of supported inpu stream configurations -->
+ <stream id='0' width='1280' height='720' format='RGBA_8888' framerate='30'/>
+ </caps>
+ </device>
+ </display>
+</configuration>