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

AP_Camera: runcam backend #26887

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

andyp1per
Copy link
Collaborator

No description provided.

@rmackay9
Copy link
Contributor

I like where this is going!

@peterbarker
Copy link
Contributor

@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!

@andyp1per
Copy link
Collaborator Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
AP_Param::invalidate_count();

done in the load_object_from_eeprom call

@@ -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;
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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),
Copy link
Contributor

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) {
Copy link
Contributor

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.

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WikiNeeded needs wiki update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants