Skip to content

Commit

Permalink
car: add evs hal
Browse files Browse the repository at this point in the history
* EVS camera HAL supports UVC USB webcams. CSI camera modules are not
  supported with EVS. CSI camera modules need to be disconnected when using
  EVS so that UVC USB webcam will populate the first video device
  (/dev/video0).
* Enable default Android camera service so regular camera apps can be used
  as well (CSI camera modules & UVC USB webcams).
* Fixes raspberry-vanilla/android_local_manifest#23
  • Loading branch information
KonstaT committed Aug 22, 2023
1 parent 91e679f commit d2d71de
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 0 deletions.
12 changes: 12 additions & 0 deletions aosp_rpi4_car.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ PRODUCT_VENDOR_PROPERTIES += \
bluetooth.profile.sap.server.enabled=false \
bluetooth.profile.vcp.controller.enabled=false

# Camera
ENABLE_CAMERA_SERVICE := true

# EVS
ENABLE_CAREVSSERVICE_SAMPLE := true
ENABLE_EVS_SAMPLE := true
ENABLE_EVS_SERVICE := true
ENABLE_REAR_VIEW_CAMERA_SAMPLE := true

PRODUCT_COPY_FILES += \
device/brcm/rpi4/camera/evs_config_override.json:${TARGET_COPY_OUT_SYSTEM}/etc/automotive/evs/config_override.json

# Overlays
PRODUCT_PACKAGES += \
AndroidRpiOverlay \
Expand Down
85 changes: 85 additions & 0 deletions camera/evs_config_override.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

{
"car" : {
"width" : 76.7,
"wheelBase" : 117.9,
"frontExtent" : 44.7,
"rearExtent" : 40
},
"displays" : [
{
"_comment": "Display0",
"displayPort" : 0,
"frontRange" : 100,
"rearRange" : 100
},
{
"_comment": "Display1",
"displayPort" : 1,
"frontRange" : 100,
"rearRange" : 100
}
],
"graphic" : {
"frontPixel" : -20,
"rearPixel" : 260
},
"cameras" : [
{
"cameraId" : "/dev/video0",
"function" : "reverse",
"x" : 0.0,
"y" : 20.0,
"z" : 48,
"yaw" : 180,
"pitch" : -10,
"roll" : 0,
"hfov" : 115,
"vfov" : 80,
"hflip" : true,
"vflip" : false
},
{
"cameraId" : "1",
"function" : "front",
"x" : 0.0,
"y" : 100.0,
"z" : 48,
"yaw" : 0,
"pitch" : -10,
"roll" : 0,
"hfov" : 115,
"vfov" : 80,
"hflip" : false,
"vflip" : false
},
{
"cameraId" : "2",
"function" : "right",
"x" : -25.0,
"y" : 60.0,
"z" : 88,
"yaw" : -90,
"pitch" : -10,
"roll" : 0,
"hfov" : 60,
"vfov" : 62,
"hflip" : false,
"vflip" : false
},
{
"cameraId" : "3",
"function" : "left",
"x" : 20.0,
"y" : 60.0,
"z" : 88,
"yaw" : 90,
"pitch" : -10,
"roll" : 0,
"hfov" : 60,
"vfov" : 62,
"hflip" : false,
"vflip" : false
}
]
}
9 changes: 9 additions & 0 deletions overlay/CarServiceRpiOverlay/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,13 @@
Setting this string to empty will disable the feature. -->
<string name="config_userNoticeUiService" translatable="false"></string>

<!-- A name of a camera device that provides the rearview through EVS service -->
<string name="config_evsRearviewCameraId" translatable="false">/dev/video0</string>

<!-- The camera Activity name for EVS, if defined, the Activity will be launched by
CarEvsService. -->
<string name="config_evsCameraActivity" translatable="false">
com.google.android.car.evs/com.google.android.car.evs.CarEvsCameraPreviewActivity
</string>

</resources>

1 comment on commit d2d71de

@SarbeenaS
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Konsta T,
Thanks for the prompt response. Need to confirm whether this solution will work with the CSI camera ?
csi_camera

Thanks,
Sarbeena

Please sign in to comment.