-
Notifications
You must be signed in to change notification settings - Fork 3
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
Implement get_sensor_info() for Pylon (single and tri) and PyBullet drivers #40
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add executable `single_camera_backend` and add `--multi-processing` flag to `demo_camera` for easier of the multi-process camera data with only a single camera.
Add a CameraInfo struct which contains the calibration parameters as well as the frame rate. Use this as output for `get_sensor_info()`. This requires to provide the calibration file to the constructor of the driver. The old constructor is still kept for backward compatibility. In this case, the calibration parameter fields are set to zero. Frame rate and image size are queried from the camera directly, so these fields are always set.
Add an overloaded constructor to PylonDriver that expects the path to a camera info file (including name and the calibration coefficients). If used, the data from the file is used to fill the CameraInfo object returned by get_sensor_info().
Check if the image size provided in the calibration file matches with what is reported by the camera. If they don't match, this is likely due to the wrong calibration file being used, so raise an error. If initialized without calibration file, the width/height in camera_info_ should be default-initialized to zero, so skip the check in that case.
The OpenCV driver is anyway only for testing, so don't bother to add sensor info there.
Get the calibration parameters from the simulated camera instance (need to distinct between simple `Camera` and `CalibratedCamera`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In open-dynamic-robot-initiative/robot_interfaces#133, robot_interfaces adds an option to provide static sensor information. Use this to provide information about frame rate and intrinsic/extrinsic camera parameters to the user.
This PR adds a
CameraInfo
struct which extendsCameraParameters
by also adding frame rate information. This is used as sensor info in thePylonDriver
.TriCameraInfo
, used byTriCameraDriver
and thePyBulletTriCameraDriver
, simply holds an array with aCameraInfo
instance for each camera.Note that in this case the frame rate is stored for each camera separately (but all to the same value), which is maybe not super-nice but adding a more specific struct for TriCamera setup seemed a bit overkill to me.
No sensor info is provided for the OpenCV driver, which I think is not really used anywhere (it was just implemented for easy testing of the pipeline).
For testing this, I also made some adjustments to the demo scripts and added scripts to easily run a camera backend.
Do not merge before