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

D400 On-Chip Calibration #4658

Merged
merged 7 commits into from
Aug 20, 2019
Merged

Conversation

dorodnic
Copy link
Contributor

This PR introduces handling of the new "lightweight" calibration stack in the RealSense Viewer and DQT:

2019-08-1807-11-45 (2)

On-chip calibration depends on firmware 5.13.x that is going to be released soon. Formal white-paper from intelrealsense.com is also expected to be published on the topic

On-Chip Calibration is a set of integrated calibration capabilities designed to make stereo camera calibration process more accessible. It is not a full replacement of Dynamic Calibration Toolchain but can help keep the camera in good health when used regularly. In particular, there may be severe aggregate calibration defects that can be only rectified by the full Dynamic Calibration tool.

On-Chip Calibration does not require any special target, but we recommend pointing the camera at a flat wall when calibrating (ceiling, floor, indoor any white wall will do, outdoor the wall needs to be sufficiently textured)

At the moment, this capability is only provided via the Viewer, but in the future it is likely to be also accessible from the API.

else
ImGui::Text("Firmware updates is underway...\nPlease do not disconnect the device");
Copy link
Collaborator

Choose a reason for hiding this comment

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

updates

to_string() << std::fixed << std::setprecision(1) << timestamp,
"Frame Timestamp is normalized represetation of when the frame was taken.\n"
"It's a property of every frame, so when exact creation time is not provided by the hardware, an approximation will be used.\n"
"Clock Domain feilds helps interpret the meaning of timestamp\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

field helps to interpret

"Timestamp is measured in milliseconds, and is allowed to roll-over (reset to zero) in some situations" });
stream_details.push_back({ "Clock Domain",
to_string() << rs2_timestamp_domain_to_string(timestamp_domain),
"Clock Domain describes the format of Timestamp feild. It can be one of the following:\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

field

"1. System Time - When no hardware timestamp is available, system time of arrival will be used.\n"
" System time benefits from being comparable between device, but suffers from not being able to approximate latency.\n"
"2. Hardware Clock - Hardware timestamp is attached to the frame by the device, and is consistent accross device sensors.\n"
" Hardware timestamp encodes percisely when frame was captured, but cannot be compared across devices\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

precisely

Copy link
Collaborator

Choose a reason for hiding this comment

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

cannot be compared across devices cannot be used for inter-device synchronization.

"2. Hardware Clock - Hardware timestamp is attached to the frame by the device, and is consistent accross device sensors.\n"
" Hardware timestamp encodes percisely when frame was captured, but cannot be compared across devices\n"
"3. Global Time - Global time is provided when the device can both offer hardware timestamp and implements Global Timestamp Protocol.\n"
" Global timestamps encode exact time of capture and at the same time are comparable accross devices." });
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think of adding of disclamer - that the global time is an algorithm-augmented mechanism that may introduce interval fluctuations and therefore is best suited for synchronizing Video ( 100fps<) frames.
In addition it requires an initial settle tile

" Global timestamps encode exact time of capture and at the same time are comparable accross devices." });
stream_details.push_back({ "Frame Number",
to_string() << frame_number, "Frame Number is a rolling ID assigned to frames.\n"
"Most device do not guaranty consequitive frames to have conseuquitive frame numbers\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Most devices do not guarantee consecutive frames to have sequential frame numbers
devices... guarantee

ImGui::SetTooltip("%s","Stream Resolution, Format");
stream_details.push_back({ "Hardware FPS",
to_string() << std::setprecision(2) << std::fixed << fps.get_fps(),
"Hardware FPS captures number of frames per second produced by the device.\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

the number of frames...

ImGui::SameLine();
stream_details.push_back({ "Display Size",
to_string() << size.x << " x " << size.y,
"When Post-Processing is enabled, actual display size of the frame may differ from original capture size" });
Copy link
Collaborator

Choose a reason for hiding this comment

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

the actual display...


std::map<rs2_frame_metadata_value, std::string> descriptions = {
{ RS2_FRAME_METADATA_FRAME_COUNTER , "A sequential index managed per-stream. Integer value" },
{ RS2_FRAME_METADATA_FRAME_TIMESTAMP , "Timestamp set by device clock when data readout and transmit commence. usec" },
Copy link
Collaborator

Choose a reason for hiding this comment

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

Disclamer - the units are mostly usec, but there are exceptions (SR300 with 100nsec units)


if (model->supports_on_chip_calib())
{
// Make sure we don't spam calibration remainers too often:
Copy link
Collaborator

Choose a reason for hiding this comment

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

remainders...

msg, manager, false);

// Recommend calibration once a week per device
if (rawtime - last_time < 60)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The weekly remainder could create a false feeling that the device shall be re-calibrated on a weekly basis.
Setting it to a monthly periods would, imho, mitigate this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why monthly?

if (ImGui::IsItemHovered())
{
win.link_hovered();
ImGui::SetTooltip("Open release notes. Internet connection is required");
Copy link
Collaborator

Choose a reason for hiding this comment

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

the Release Notes...


// Set calibration speed: 0 - slowest, 4 - fastest
// On-Chip Calib manager will reduce speed if needed
void set_speed(int speed) { _speed = speed; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would also check the input for validity

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not user accessible

bool use_new_calib = true;
std::string _error_message = "";
};
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

EOL is missing

intrinsics.fy = rect_params[1] * height / resolutions_list[resolution].y;
intrinsics.ppx = rect_params[2] * width / resolutions_list[resolution].x;
intrinsics.ppy = rect_params[3] * height / resolutions_list[resolution].y;
if (width == 256 && height == 144)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pls put a comment that this shall be used in auto-calibration only

@ev-mp ev-mp merged commit 033df88 into IntelRealSense:development Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants