Go to the documentation of this file.
10 #include "../src/ds/d400/d400-private.h"
16 :
dev(
dev), _not_model(not_model)
31 if( std::abs(
x -
orig ) > 0.00001 )
42 const float3x3& original,
bool& changed)
77 const auto window_name =
"Calibration Window";
87 catch(std::exception
e)
89 error_message =
e.what();
137 table->baseline = cf.
get(
"baseline");
153 load_float3x4(
"intrinsic_left",
table->intrinsic_left);
154 load_float3x4(
"intrinsic_right",
table->intrinsic_right);
155 load_float3x4(
"world2left_rot",
table->world2left_rot);
156 load_float3x4(
"world2right_rot",
table->world2right_rot);
170 catch (
const std::exception& ex)
172 error_message = ex.what();
189 cf.
set(
"baseline",
table->baseline);
205 save_float3x4(
"intrinsic_left",
table->intrinsic_left);
206 save_float3x4(
"intrinsic_right",
table->intrinsic_right);
207 save_float3x4(
"world2left_rot",
table->world2left_rot);
208 save_float3x4(
"world2right_rot",
table->world2right_rot);
213 int w = xy.x;
int h = xy.y;
226 catch (
const std::exception& ex)
228 error_message = ex.what();
257 catch(
const std::exception& ex)
259 error_message = ex.what();
277 ImGui::SetTooltip(
"%s",
"Write selected calibration table to the device. For advanced users");
294 draw_float(
"Baseline",
table->baseline, orig_table->baseline, changed);
298 draw_float4x4(
"Left Intrinsics",
table->intrinsic_left, orig_table->intrinsic_left, changed);
299 draw_float4x4(
"Right Intrinsics",
table->intrinsic_right, orig_table->intrinsic_right, changed);
300 draw_float4x4(
"World to Left Rotation",
table->world2left_rot, orig_table->world2left_rot, changed);
301 draw_float4x4(
"World to Right Rotation",
table->world2right_rot, orig_table->world2right_rot, changed);
309 std::vector<std::string> resolution_names;
310 std::vector<const char*> resolution_names_char;
311 std::vector<int> resolution_offset;
315 int w = xy.x;
int h = xy.y;
317 resolution_offset.push_back(
i);
319 resolution_names.push_back(
name);
322 for (
size_t i = 0;
i < resolution_offset.size();
i++)
324 resolution_names_char.push_back(resolution_names[
i].c_str());
364 ImGui::SetTooltip(
"%s",
"Changing calibration will affect depth quality. Changes are persistent.\nThere is an option to get back to factory calibration, but it maybe worse than current calibration\nBefore writing to flash, we strongly recommend to make a file backup");
390 table->header.crc32 = crc;
397 catch (
const std::exception& ex)
399 error_message = ex.what();
417 ImGui::SetTooltip(
"%s",
"Write selected calibration table to the device. For advanced users");
429 catch (
const std::exception&)
437 catch (
const std::exception& ex)
439 error_message = ex.what();
IMGUI_API void PushItemWidth(float item_width)
static config_file & instance()
std::vector< uint8_t > _original
@ RS2_NOTIFICATION_CATEGORY_HARDWARE_EVENT
@ ImGuiCol_TextSelectedBg
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0))
IMGUI_API void SameLine(float pos_x=0.0f, float spacing_w=-1.0f)
IMGUI_API void SetNextWindowSize(const ImVec2 &size, ImGuiSetCond cond=0)
static const ImVec4 light_grey
static const ImVec4 dark_sensor_bg
IMGUI_API void PopStyleColor(int count=1)
GLsizei const GLchar *const * string
IMGUI_API void SetNextWindowPos(const ImVec2 &pos, ImGuiSetCond cond=0)
static std::map< ds_rect_resolutions, int2 > resolutions_list
IMGUI_API void PushFont(ImFont *font)
IMGUI_API bool DragFloat(const char *label, float *v, float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *display_format="%.3f", float power=1.0f)
GLenum GLenum GLsizei void * table
@ ImGuiWindowFlags_NoSavedSettings
bool supports(rs2_camera_info info) const
IMGUI_API bool IsWindowHovered()
void set(const char *key, const char *value)
IMGUI_API void SetCursorPosY(float y)
IMGUI_API bool BeginPopupModal(const char *name, bool *p_open=NULL, ImGuiWindowFlags extra_flags=0)
IMGUI_API bool IsItemHovered()
void draw_float(std::string name, float &x, const float &orig, bool &changed)
T get_or_default(const char *key, T def) const
static const ImVec4 sensor_bg
static const ImVec4 white
IMGUI_API void SetTooltip(const char *fmt,...) IM_PRINTFARGS(1)
static const ImVec4 regular_blue
GLdouble GLdouble GLdouble w
std::weak_ptr< notifications_model > _not_model
uint32_t calc_crc32(const uint8_t *buf, size_t bufsize)
Calculate CRC code for arbitrary characters buffer.
IMGUI_API bool Checkbox(const char *label, bool *v)
IMGUI_API void Text(const char *fmt,...) IM_PRINTFARGS(1)
IMGUI_API bool BeginChild(const char *str_id, const ImVec2 &size=ImVec2(0, 0), bool border=false, ImGuiWindowFlags extra_flags=0)
GLuint const GLchar * name
IMGUI_API void SetCursorScreenPos(const ImVec2 &pos)
std::vector< uint8_t > _calibration
@ ImGuiStyleVar_WindowRounding
IMGUI_API void PopStyleVar(int count=1)
IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4 &col)
IMGUI_API ImVec2 CalcTextSize(const char *text, const char *text_end=NULL, bool hide_text_after_double_hash=false, float wrap_width=-1.0f)
IMGUI_API bool Combo(const char *label, int *current_item, const char **items, int items_count, int height_in_items=-1, bool show_arrow_down=true)
calibration_model(rs2::device dev, std::shared_ptr< notifications_model > not_model)
IMGUI_API void PopItemWidth()
IMGUI_API float GetCursorPosY()
static const char * enable_writing
IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val)
@ ImGuiWindowFlags_NoCollapse
@ ImGuiStyleVar_WindowPadding
@ max_ds_rect_resolutions
const char * get_info(rs2_camera_info info) const
IMGUI_API void CloseCurrentPopup()
@ ImGuiWindowFlags_NoTitleBar
@ ImGuiWindowFlags_NoResize
IMGUI_API void EndChild()
IMGUI_API void OpenPopup(const char *str_id)
std::vector< sensor > query_sensors() const
@ RS2_CAMERA_INFO_PRODUCT_LINE
std::string get(const char *key, const char *def) const
IMGUI_API void EndPopup()
void update(ux_window &window, std::string &error_message)
IMGUI_API void SetCursorPosX(float x)
static const ImVec4 black
def get_calibration_table(d435_imu_calib_table)
void draw_float4x4(std::string name, float3x3 &feild, const float3x3 &original, bool &changed)
const char * file_dialog_open(file_dialog_mode flags, const char *filters, const char *default_path, const char *default_name)
librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Fri Aug 2 2024 08:30:01