Skip to content

Commit

Permalink
AP_Camera: remove lf from panic
Browse files Browse the repository at this point in the history
correct camera info message and defend against -1
  • Loading branch information
andyp1per committed Dec 13, 2024
1 parent 631c494 commit 684d95a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions libraries/AP_Camera/AP_RunCam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ AP_RunCam::AP_RunCam(AP_Camera &frontend, AP_Camera_Params &params, uint8_t inst
{
AP_Param::setup_object_defaults(this, var_info);
if (_singleton != nullptr && _singleton->_instance == instance) {
AP_HAL::panic("AP_RunCam instance must be a singleton %u\n", instance);
AP_HAL::panic("AP_RunCam instance must be a singleton %u", instance);
}
if (_singleton == nullptr) {
_singleton = this;
Expand Down Expand Up @@ -1078,20 +1078,22 @@ bool AP_RunCam::healthy() const
}

// momentary switch to change camera between picture and video modes
void AP_RunCam::cam_mode_toggle() {
void AP_RunCam::cam_mode_toggle()
{

}

// entry point to actually take a picture. returns true on success
bool AP_RunCam::trigger_pic() {
bool AP_RunCam::trigger_pic()
{
return false;
}

// send camera information message to GCS
void AP_RunCam::send_camera_information(mavlink_channel_t chan) const
{
// exit immediately if not initialised
if (!camera_ready() || _cam_type.get() == 0 || _cam_type.get() > int8_t(ARRAY_SIZE(_models))) {
if (!camera_ready() || _cam_type.get() <= 0 || _cam_type.get() > int8_t(ARRAY_SIZE(_models))) {
return;
}

Expand All @@ -1118,9 +1120,9 @@ void AP_RunCam::send_camera_information(mavlink_channel_t chan) const
vendor_name, // vendor_name uint8_t[32]
model_name, // model_name uint8_t[32]
0, // firmware version uint32_t
NaNf, // focal_length float (mm)
NaNf, // sensor_size_h float (mm)
NaNf, // sensor_size_v float (mm)
0, // sensor_size_v float (mm)
0, // resolution_h uint16_t (pix)
0, // resolution_v uint16_t (pix)
0, // lens_id uint8_t
Expand Down

0 comments on commit 684d95a

Please sign in to comment.