Skip to content

Commit

Permalink
PR #12628 from OhadMeir: Add error handling mechanism to D500
Browse files Browse the repository at this point in the history
  • Loading branch information
OhadMeir committed Feb 4, 2024
2 parents 52fc021 + 85fa332 commit 6287dc7
Show file tree
Hide file tree
Showing 8 changed files with 367 additions and 74 deletions.
2 changes: 1 addition & 1 deletion src/ds/d400/d400-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ namespace librealsense
_polling_error_handler = std::make_shared<polling_error_handler>(1000,
error_control,
raw_depth_sensor->get_notifications_processor(),
std::make_shared<ds_notification_decoder>());
std::make_shared< ds_notification_decoder >( d400_fw_error_report ) );

depth_sensor.register_option(RS2_OPTION_ERROR_POLLING_ENABLED, std::make_shared<polling_errors_disable>(_polling_error_handler));
}
Expand Down
70 changes: 70 additions & 0 deletions src/ds/d400/d400-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "ds/ds-private.h"
#include <src/platform/backend-device-group.h>
#include <src/core/notification.h>

namespace librealsense
{
Expand Down Expand Up @@ -267,5 +268,74 @@ namespace librealsense
float3 translation_rect; // Translation vector for rectification
uint8_t reserved[24];
};

enum d400_notifications_types
{
success = 0,
hot_laser_power_reduce,
hot_laser_disable,
flag_B_laser_disable,
stereo_module_not_connected,
eeprom_corrupted,
calibration_corrupted,
mm_upd_fail,
isp_upd_fail,
mm_force_pause,
mm_failure,
usb_scp_overflow,
usb_rec_overflow,
usb_cam_overflow,
mipi_left_error,
mipi_right_error,
mipi_rt_error,
mipi_fe_error,
i2c_cfg_left_error,
i2c_cfg_right_error,
i2c_cfg_rt_error,
i2c_cfg_fe_error,
stream_not_start_z,
stream_not_start_y,
stream_not_start_cam,
rec_error,
usb2_limit,
cold_laser_disable,
no_temperature_disable_laser,
isp_boot_data_upload_failed,
};

// Elaborate FW XU report. The reports may be consequently extended for PU/CTL/ISP
const std::map< int, std::string > d400_fw_error_report = {
{ success, "Success" },
{ hot_laser_power_reduce, "Laser hot - power reduce" },
{ hot_laser_disable, "Laser hot - disabled" },
{ flag_B_laser_disable, "Flag B - laser disabled" },
{ stereo_module_not_connected, "Stereo Module is not connected" },
{ eeprom_corrupted, "EEPROM corrupted" },
{ calibration_corrupted, "Calibration corrupted" },
{ mm_upd_fail, "Motion Module update failed" },
{ isp_upd_fail, "ISP update failed" },
{ mm_force_pause, "Motion Module force pause" },
{ mm_failure, "Motion Module failure" },
{ usb_scp_overflow, "USB SCP overflow" },
{ usb_rec_overflow, "USB REC overflow" },
{ usb_cam_overflow, "USB CAM overflow" },
{ mipi_left_error, "Left MIPI error" },
{ mipi_right_error, "Right MIPI error" },
{ mipi_rt_error, "RT MIPI error" },
{ mipi_fe_error, "FishEye MIPI error" },
{ i2c_cfg_left_error, "Left IC2 Config error" },
{ i2c_cfg_right_error, "Right IC2 Config error" },
{ i2c_cfg_rt_error, "RT IC2 Config error" },
{ i2c_cfg_fe_error, "FishEye IC2 Config error" },
{ stream_not_start_z, "Depth stream start failure" },
{ stream_not_start_y, "IR stream start failure" },
{ stream_not_start_cam, "Camera stream start failure" },
{ rec_error, "REC error" },
{ usb2_limit, "USB2 Limit" },
{ cold_laser_disable, "Laser cold - disabled" },
{ no_temperature_disable_laser, "Temperature read failure - laser disabled" },
{ isp_boot_data_upload_failed, "ISP boot data upload failure" },
};

} // namespace ds
} // namespace librealsense
14 changes: 14 additions & 0 deletions src/ds/d500/d500-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,20 @@ namespace librealsense
std::make_shared<temperature_option>(_hw_monitor,
temperature_option::temperature_component::LEFT_PROJ, "Temperature reading for Left Projector"));

auto error_control = std::make_shared< uvc_xu_option< uint8_t > >( raw_depth_sensor,
depth_xu,
DS5_ERROR_REPORTING,
"Error reporting" );

_polling_error_handler = std::make_shared< polling_error_handler >(
1000,
error_control,
raw_depth_sensor->get_notifications_processor(),
std::make_shared< ds_notification_decoder >( d500_fw_error_report ) );

depth_sensor.register_option( RS2_OPTION_ERROR_POLLING_ENABLED,
std::make_shared< polling_errors_disable >( _polling_error_handler ) );

// Metadata registration
depth_sensor.register_metadata(RS2_FRAME_METADATA_FRAME_TIMESTAMP, make_uvc_header_parser(&uvc_header::timestamp));
}); //group_multiple_fw_calls
Expand Down
1 change: 1 addition & 0 deletions src/ds/d500/d500-private.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,5 +271,6 @@ namespace librealsense

return{ rect_rot_mat,trans_vector };
}

} // librealsense::ds
} // namespace librealsense
Loading

0 comments on commit 6287dc7

Please sign in to comment.