-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
AP_Camera: runcam backend #26887
base: master
Are you sure you want to change the base?
AP_Camera: runcam backend #26887
Conversation
I like where this is going! |
@andyp1per where are you going with this one? What advantages were you seeing from being a camera backend? I'd note that the camera library, even in its most compact form is still going to be pretty chunky, and recent commits have shown we don't really care about keeping it absolutely tight space-wise. Definitely not saying it's a bad idea! |
6eb3394
to
302a30b
Compare
The main thing is to get the mavlink and other support for free. People keep asking for runcam mission support |
@@ -238,6 +252,15 @@ void AP_Camera::init() | |||
case CameraType::SCRIPTING: | |||
_backends[instance] = NEW_NOTHROW AP_Camera_Scripting(*this, _params[instance], instance); | |||
break; | |||
#endif | |||
#if AP_CAMERA_RUNCAM_ENABLED | |||
// check for Scripting driver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// check for Scripting driver | |
// check for RunCam driver |
_backends[instance] = NEW_NOTHROW AP_RunCam(*this, _params[instance], instance); | ||
_backend_var_info[instance] = AP_RunCam::var_info; | ||
AP_Param::load_object_from_eeprom(_backends[instance], _backend_var_info[instance]); | ||
AP_Param::invalidate_count(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AP_Param::invalidate_count(); |
done in the load_object_from_eeprom
call
libraries/AP_Camera/AP_Camera.cpp
Outdated
@@ -830,7 +853,7 @@ void AP_Camera::convert_params() | |||
{ | |||
// exit immediately if CAM1_TYPE has already been configured | |||
if (_params[0].type.configured()) { | |||
return; | |||
//return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks strange
@@ -847,6 +870,29 @@ void AP_Camera::convert_params() | |||
// CAM_TRIGG_TYPE was set to Relay, GoPro or Mount | |||
cam1_type = cam_trigg_type + 1; | |||
} | |||
#if AP_CAMERA_RUNCAM_ENABLED | |||
// find vehicle's top level key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need comments in here with the PARAMETER_CONVERSION
tag and relevant dates
@@ -58,3 +58,7 @@ | |||
#ifndef HAL_RUNCAM_ENABLED | |||
#define HAL_RUNCAM_ENABLED 1 | |||
#endif | |||
|
|||
#ifndef AP_CAMERA_RUNCAM_ENABLED | |||
#define AP_CAMERA_RUNCAM_ENABLED AP_CAMERA_BACKEND_DEFAULT_ENABLED && HAL_RUNCAM_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to keep HAL_RUNCAM_ENABLED
around?
@@ -36,7 +36,7 @@ const AP_Param::GroupInfo AP_RunCam::var_info[] = { | |||
// @DisplayName: RunCam device type | |||
// @Description: RunCam device type used to determine OSD menu structure and shutter options. | |||
// @Values: 0:Disabled, 1:RunCam Split Micro/RunCam with UART, 2:RunCam Split, 3:RunCam Split4 4k, 4:RunCam Hybrid/RunCam Thumb Pro, 5:Runcam 2 4k | |||
AP_GROUPINFO_FLAGS("TYPE", 1, AP_RunCam, _cam_type, int(DeviceType::Disabled), AP_PARAM_FLAG_ENABLE), | |||
AP_GROUPINFO_FLAGS("TYPE", 1, AP_RunCam, _cam_type, int(DeviceType::SplitMicro), AP_PARAM_FLAG_ENABLE), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change in default?
{ | ||
AP_Param::setup_object_defaults(this, var_info); | ||
if (_singleton != nullptr) { | ||
if (_singleton != nullptr && _singleton->_instance == instance) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very bad. I mean, it's right there in the name...
You probably simply need to remove the singleton from AP_RunCam entirely.
2dcb5eb
to
3a267a9
Compare
No description provided.