-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add an auto-camera calibration script #48
Open
amalnanavati
wants to merge
13
commits into
main
Choose a base branch
from
amaln/camera_calib
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
amalnanavati
commented
Oct 18, 2024
# save the files to the built package's share directory, which hinders pushing it to Github. | ||
data_dir: "~/Workspaces/ada_ws/src/ada_ros2/ada_calibrate_camera/data" | ||
# Where to save the calibration results | ||
output_calib_name: ~/Workspaces/ada_ws/src/ada_ros2/ada_calibrate_camera/config/calibs/auto.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Change to ~/Workspace
to align with lovelace
Co-authored-by: Ethan K. Gordon <[email protected]>
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
This PR adds an auto-camera calibration script. Through command-line interaction, it interactively guides the user to place a charucoboard in front of the robot (the parameters for the charucoboard should already be specified in
config/calibrate_camera.yaml
). Then, the robot moves the arm in a star around its hardcoded starting configuration, varying roll and pitch as it goes, to gather samples. It then runs eye-in-hand camera calibration using those samples, using the config-specified method (I empirically found that Andreff worked best).Note that when computing the translation and rotation error, we first get the predicted charucoboard pose in robot frame for all of the samples. We then compute the translation/rotation distances between every pair of samples, and take the median of those distances.
This procedure should be re-run every time the eye-in-hand system is modified, e.g., unscrewed/rescrewed, some 3D printed components were replaced, etc.
Testing
config/calibrate_camera.yaml
to your charucoboard as necessary.python3 src/ada_ros2/ada_calibrate_camera/calibrate_camera_start.py
config/calibrate_camera.yaml
to run offline, point it to the new data directory that was created above, and run all the camera calibration methods.ros2 run ada_calibrate_camera calibrate_camera --ros-args --params-file <path/to/ada_ros2>/ada_calibrate_camera/config/calibrate_camera.yaml
python3 src/ada_feeding/start.py