CalibrateCameraIntrinsics Class
Calibrates a camera's intrinsics from the board corners in the collected samples, and checks the intrinsics the camera published against the same corners. More...
Declaration
Included Headers
Base class
| class | AsyncBehaviorBase |
|
A base class for behaviors which need to asynchronously run a function that might take a long time to complete. More... | |
Public Constructors Index
| CalibrateCameraIntrinsics (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources) | |
Private Member Functions Index
| tl::expected< bool, std::string > | doWork () override |
|
User-implemented function which handles executing the potentially-long-running process. More... | |
| std::shared_future< tl::expected< bool, std::string > > & | getFuture () override |
|
Gets the shared future which is used to monitor the progress of the async process. More... | |
Private Member Attributes Index
| std::shared_future< tl::expected< bool, std::string > > | future_ |
Public Static Functions Index
| static BT::PortsList | providedPorts () |
| static BT::KeyValueVector | metadata () |
Description
Calibrates a camera's intrinsics from the board corners in the collected samples, and checks the intrinsics the camera published against the same corners.
Runs the calibration library's intrinsic solve over every recorded view of the named camera and outputs the result as a CameraInfo message ready to replace the camera's own. The samples carry the intrinsics the camera published. The Behavior fits those to the same views and compares them with the calibrated ones at the observed board corners, where the solved distortion is measured. The summary reports the solved fit and how far apart the two sets are at worst. A warning fires when the published set disagrees by more than the threshold and by more than a fixed multiple of the calibration's uncertainty. Coverage of the image by the corners is reported too, with a warning below its threshold, because distortion is extrapolated wherever the board was not seen.
Asynchronous because the solve and the two fits grow with the number of views and take tens of milliseconds for a dozen. Halting waits for the running solve, one bounded optimization.
| Data Port Name | Port Type | Object Type |
|---|---|---|
| samples | input | std::vector<moveit_pro::hand_eye_calibration::CalibrationSample> |
| camera_name | input | std::string |
| camera_info | input | sensor_msgs::msg::CameraInfo |
| distortion_model | input | std::string |
| rms_reprojection_warn_px | input | double |
| recorded_disagreement_warn_px | input | double |
| min_coverage | input | double |
| calibrated_camera_info | output | sensor_msgs::msg::CameraInfo |
| rms_reprojection_px | output | double |
| recorded_rms_reprojection_px | output | double |
| recorded_disagreement_px | output | double |
| used_view_count | output | int |
| coverage | output | double |
Definition at line 87 of file calibrate_camera_intrinsics.hpp.
Public Constructors
CalibrateCameraIntrinsics()
|
Declaration at line 90 of file calibrate_camera_intrinsics.hpp, definition at line 260 of file calibrate_camera_intrinsics.cpp.
Private Member Functions
doWork()
| virtual |
User-implemented function which handles executing the potentially-long-running process.
This function is called within an async process in a separate thread.
- Returns
A tl::expected which contains a bool indicating task success if the process completed successfully or was canceled, or an error message if the process failed unexpectedly.
Declaration at line 98 of file calibrate_camera_intrinsics.hpp, definition at line 323 of file calibrate_camera_intrinsics.cpp.
getFuture()
| inline virtual |
Gets the shared future which is used to monitor the progress of the async process.
Classes derived from AsyncBehaviorBase must implement getFuture() so that it returns a shared_future class member.
This exists to prevent destruction of the derived class while the async process is still in-progress. If the derived class is destroyed, the definitions of the functions used within doWork() will be destroyed too, which will result in the virtual functions in the base class being called instead and cause a fault.
This function will force derived classes to add an instance of this type and return a reference to it. The base class can then use this virtual function to access the shared future in functions like onStart.
By adding this virtual function we're properly demonstrating how this future depends on things from the derived class and the natural flow of object lifetimes will do the hard work for us. The std::shared_future destructor will get the value of the future before the derived class is destructed assuming it's the last reference to the shared state. Doing it this way means neither the base nor derived class should need to implement a destructor which is a nice property to have.
- Returns
Returns the shared_future, which should be owned by the child class.
Definition at line 100 of file calibrate_camera_intrinsics.hpp.
Private Member Attributes
future_
|
Definition at line 105 of file calibrate_camera_intrinsics.hpp.
Public Static Functions
metadata()
| static |
Declaration at line 95 of file calibrate_camera_intrinsics.hpp, definition at line 317 of file calibrate_camera_intrinsics.cpp.
providedPorts()
| static |
Declaration at line 93 of file calibrate_camera_intrinsics.hpp, definition at line 266 of file calibrate_camera_intrinsics.cpp.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.