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

Added ability to retrieve camera cal during log playback #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion camera/camera_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ std::optional<int> CameraManager::follow_v4l_path(const std::string& path) const
const std::string v4l_path = fs::canonical(path, ec).string();
const int index = v4l_path.back() - '0'; // note that this will break for >10 cameras
if (ec) {
return std::nullopt;
if (getenv("LOG_PATH")) { // if LOG_PATH is set, we can assume that we're in playback mode and the video index won't be used
Copy link
Member

Choose a reason for hiding this comment

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

JAZ!@!!!!!!

Copy link
Member

Choose a reason for hiding this comment

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

Some thoughts:

  • Ideally, all of the code paths would be the same, online and offline, so they can't accidentally diverge
  • Most consumers of the calibration don't need to actually interact with the camera, and the camerabq never needs the calibration -- those could be two different access paths
  • Apparently you can directly open captures via the v4l path, so you may be able to remove the camera number munging

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, I'll take closer look when I'm back in town!

return 0;
} else {
return std::nullopt;
}
} else {
return index;
}
Expand Down