-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
Handle digicam messages as COMMAND_INT as well as COMMAND_LONG #25409
Handle digicam messages as COMMAND_INT as well as COMMAND_LONG #25409
Conversation
f22fbe5
to
0c44593
Compare
libraries/AP_Camera/AP_Camera.h
Outdated
@@ -96,12 +96,12 @@ class AP_Camera { | |||
void send_camera_settings(mavlink_channel_t chan); | |||
|
|||
// configure camera | |||
void configure(float shooting_mode, float shutter_speed, float aperture, float ISO, float exposure_type, float cmd_id, float engine_cutoff_time); | |||
void configure(uint8_t instance, float shooting_mode, float shutter_speed, float aperture, float ISO, float exposure_type, float cmd_id, float engine_cutoff_time); | |||
void configure(float shooting_mode, float shutter_speed, float aperture, float ISO, uint32_t exposure_type, uint32_t cmd_id, float engine_cutoff_time); |
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.
int32_t to match type in COMMAND_INT, also to cope if someone used a -1 float
@@ -161,10 +161,10 @@ void AP_Camera_Backend::stop_capture() | |||
} | |||
|
|||
// handle camera control | |||
void AP_Camera_Backend::control(float session, float zoom_pos, float zoom_step, float focus_lock, float shooting_cmd, float cmd_id) | |||
void AP_Camera_Backend::control(float session, float zoom_pos, float zoom_step, float focus_lock, uint32_t shooting_cmd, uint32_t cmd_id) |
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.
int32_t
@@ -89,10 +89,10 @@ class AP_Camera_Backend | |||
virtual void handle_message(mavlink_channel_t chan, const mavlink_message_t &msg) {} | |||
|
|||
// configure camera | |||
virtual void configure(float shooting_mode, float shutter_speed, float aperture, float ISO, float exposure_type, float cmd_id, float engine_cutoff_time) {} | |||
virtual void configure(float shooting_mode, float shutter_speed, float aperture, float ISO, uint32_t exposure_type, uint32_t cmd_id, float engine_cutoff_time) {} |
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.
int32_t
fine to merge when no signed -> unsigned changes |
0c44593
to
610fd85
Compare
Added more tests into the autotest suite to ensure fields get passed through appropriately.
The integer fields in these commands are used for integer values (enumeration / de-dupe sequencing / exposure integer), so that's handy.
Comments on what the command fields mean can be found in the message equivalents of the commands.