Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update camera types for X20, use more verbose name for the 'default t… #696

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions app/telemetry/models/openhd_core/camera.hpp
Original file line number Diff line number Diff line change
@@ -74,7 +74,13 @@ static constexpr int X_CAM_TYPE_RPI_V4L2_VEYE_MVCAM = 63;
// X20 Specific starts here
//
// Right now we only have one camera, but more (might) follow.
static constexpr int X_CAM_TYPE_X20_RUNCAM_GENERIC = 70;
// Generic - camera(s) that don't support any IQ params or changing settings.
// For example the Foxeer cameras, or old runcam cameras
static constexpr int X_CAM_TYPE_X20_HDZERO_GENERIC = 70;
static constexpr int X_CAM_TYPE_X20_HDZERO_RUNCAM_V1 = 71;
static constexpr int X_CAM_TYPE_X20_HDZERO_RUNCAM_V2 = 72;
static constexpr int X_CAM_TYPE_X20_HDZERO_RUNCAM_V3 = 73;
static constexpr int X_CAM_TYPE_X20_HDZERO_RUNCAM_NANO_90 = 74;
// ... 9 reserved for future use
//
// ROCK Specific starts here
@@ -145,8 +151,16 @@ static std::string x_cam_type_to_string(int camera_type) {
case X_CAM_TYPE_RPI_V4L2_VEYE_MVCAM:
return "VEYE_MVCAM";
// All the x20 begin
case X_CAM_TYPE_X20_RUNCAM_GENERIC:
return "X20_RUNCAM_GENERIC";
case X_CAM_TYPE_X20_HDZERO_GENERIC:
return "X20_HDZERO_GENERIC";
case X_CAM_TYPE_X20_HDZERO_RUNCAM_V1:
return "X20_HDZERO_RUNCAM_V1";
case X_CAM_TYPE_X20_HDZERO_RUNCAM_V2:
return "X20_HDZERO_RUNCAM_V2";
case X_CAM_TYPE_X20_HDZERO_RUNCAM_V3:
return "X20_HDZERO_RUNCAM_V3";
case X_CAM_TYPE_X20_HDZERO_RUNCAM_NANO_90:
return "X20_HDZERO_RUNCAM_NANO";
// All the rock begin
case X_CAM_TYPE_ROCK_HDMI_IN:
return "ROCK_HDMI_IN";
@@ -201,6 +215,10 @@ struct XCamera {
bool requires_x20_cedar_pipeline() const {
return camera_type >= 70 && camera_type < 80;
}
bool x20_supports_basic_iq_params() const {
return requires_x20_cedar_pipeline() &&
camera_type != X_CAM_TYPE_X20_HDZERO_GENERIC;
}
bool requires_rockchip_mpp_pipeline() const {
return camera_type >= 80 && camera_type < 90;
}
@@ -510,11 +528,22 @@ static std::vector<ManufacturerForPlatform> get_camera_choices_for_platform(
MANUFACTURER_USB,
MANUFACTURER_DEBUG};
} else if (platform_type == X_PLATFORM_TYPE_ALWINNER_X20) {
// On the X20, we have auto detection of the camera type,
// But we still populate the UI like for platforms where the user has to
// select the cam type.
std::vector<CameraNameAndType> generic_cameras{
CameraNameAndType{"GENERIC", X_CAM_TYPE_X20_HDZERO_GENERIC},
};
std::vector<CameraNameAndType> runcam_cameras{
CameraNameAndType{"GENERIC", X_CAM_TYPE_X20_RUNCAM_GENERIC},
CameraNameAndType{"RUNCAM V1", X_CAM_TYPE_X20_HDZERO_RUNCAM_V1},
CameraNameAndType{"RUNCAM V2", X_CAM_TYPE_X20_HDZERO_RUNCAM_V2},
CameraNameAndType{"RUNCAM V3", X_CAM_TYPE_X20_HDZERO_RUNCAM_V3},
CameraNameAndType{"RUNCAM NANO 90",
X_CAM_TYPE_X20_HDZERO_RUNCAM_NANO_90},
};
return std::vector<ManufacturerForPlatform>{
ManufacturerForPlatform{"HDZERO", runcam_cameras}};
ManufacturerForPlatform{"HDZERO", generic_cameras},
ManufacturerForPlatform{"RUNCAM", runcam_cameras}};
} else if (platform_type == X_PLATFORM_TYPE_ROCKCHIP_RK3566_RADXA_ZERO3W) {
std::vector<CameraNameAndType> arducam_cameras{
CameraNameAndType{"IMX219", X_CAM_TYPE_ROCK_RK3566_IMX219},
4 changes: 2 additions & 2 deletions app/telemetry/settings/documentedparam.cpp
Original file line number Diff line number Diff line change
@@ -530,7 +530,7 @@ static std::vector<std::shared_ptr<XParam>> get_parameters_list(){
{
auto fc_uart_conn_values=std::vector<ImprovedStringSetting::Item>{
{"disable",""},
{"SERIAL_0","SERIAL_0"},
{"OHD TELEMETRY 0","OHD_TELEMETRY_0"},
{"/dev/serial0","/dev/serial0"},
{"/dev/serial1","/dev/serial1"},
{"/dev/ttyS1","/dev/ttyS1"},
@@ -541,7 +541,7 @@ static std::vector<std::shared_ptr<XParam>> get_parameters_list(){
{"/dev/ttyS7","/dev/ttyS7"}
};
append_string(ret,"FC_UART_CONN",ImprovedStringSetting{fc_uart_conn_values},
"Telemetry FC<->Air unit. Make sure FC_UART_BAUD matches your FC. SERIAL_0 - default, primary telemetry serial of this platform (see wiki)."
"Telemetry FC<->Air unit. Make sure FC_UART_BAUD matches your FC. OHD TELEMETRY 0 - default, primary telemetry serial of this platform (see wiki)."
"Otherwise, any linux serial fd filename (dev/testing).");
//same for ground uart out
append_string(ret,"TRACKER_UART_OUT",ImprovedStringSetting{fc_uart_conn_values},