This module is used for calibrating frames of cameras to be used in the frame system.
This model is used to determine the frame of a camera mounted on an arm to be consumed by the frame system.
To use this model, take the following steps:
- Configure a posetracker component to use for calibration. The recommended module is the apriltag module.
- Print out an apriltag family to use with calibration. Other kinds of posetrackers may use a different object for tracking. The frame calibration github repo has an example apriltag family to use.
- Configure the
camera-on-arm
model with an arm and pose tracker, along with any other optional settings that you want to include. - Move the arm into a position where the camera can see all of the expected poses. You can use the
checkTags
DoCommand to see the number of visible tags. - Use the
saveCalibrationPosition
DoCommand to add this position to your config. - Repeat steps 4 and 5 until you have 6-8 different arm positions. Try to select positions that cover different viewpoints while still having a straightforward motion plan.
- use the
runCalibration
DoCommand to start calibration. Have this calibration multiple times to try getting a better result. Also make sure the numbers make sense! - Copy the calibration result into your camera's frame config.
- (Optional) Use the
saveCalibration
DoCommand to save the calibration guess. This will add the calibration result to thecamera-on-arm
config, which will be used for future calibrations.
The following attribute template can be used to configure this model:
{
"arm": <string>,
"tracker": <string>,
"joint_positions": [][]<float>,
}
The following attributes are available for this model:
Name | Type | Inclusion | Description |
---|---|---|---|
arm |
string | Required | arm the camera is mounted on |
tracker |
string | Required | pose tracker configured to detect poses from a camera |
motion |
string | Optional | optional motion service to move the arm with. The builtin motion service is always available to configure here. |
arm_parent |
string | Optional | parent frame of the arm to use with motion planning. Required if motion is configured. world is usually a good frame to start with. |
sleep_seconds |
float64 | Optional | number of seconds for the arm to sleep between moves. Default is 1 second |
num_expected_tags |
int | Optional | number of poses that the camera/pose tracker should be able to see. Default is 24 tags. |
joint_positions |
[][]float | Required | joint positions that the arm should move through. Positions are in radians |
guess |
FrameConfig | Optional | the current guess of where the camera is mounted on the arm. Use the saveGuess DoCommand to store the latest calibration result here. |
{
"arm": "my-arm",
"tracker": "my-tracker",
"motion": "builtin",
"arm_parent": "world",
"joint_positions": [
[0.1, 0.2, 0.3, 0.4, 0.5, 0.6],
[0, 0, 0, 0, 0, 0],
]
}
Please use the erh:vmodutils:obstacle model to add obstacles for the arm to plan around.
runCalibration
will run calibration using the currently defined positions, running calibration the specified amount of times. Returns the calibrated frame and associated cost from the optimization.
{
"runCalibration": <int>
}
autoCalibrate
will generate a set of positions for the arm to test based on the current position of the arm, returning the calibration frame. This feature is experimental.
{
"autoCalibrate": ""
}
saveGuess
will add the current calibration result to the config of the camera-on-arm model. This result will be used in future calibrations to help improve the optimization.
{
"saveGuess": ""
}
moveArm
will move the arm through any currently defined positions and takes the time delay between moves as an input. Calibration will not be performed, so this is useful to quickly validate all arm positions can see the expected number of tags.
{
"moveArm": <int>
}
getCalibrationPositions
will return the last saved list of calibration positions.
{
"getCalibrationPositions": ""
}
moveArmToPosition
will move the arm to the specified position and return the number of tags that can be seen.
{
"moveArmToPosition": <int>
}
checkTags
will return the number of tags that can be seen by the camera. This is useful when moving the arm to try and find different positions for calibration.
{
"checkTags": ""
}
saveCalibrationPosition
will save the current arm position into the list of positions to calibrate with and update the viam:frame-calibration:camera-on-arm
's config. Passing in a positive integer will replace the specified index, while other inputs will append the positions at the end of the list. Use the config history feature if you wish to recover the removed positions.
{
"saveCalibrationPosition": <int> or ""
}
deleteCalibrationPosition
will remove the specified set of joint positions from the viam:frame-calibration:camera-on-arm
's config. Use the config history feature if you wish to recover the removed positions.
{
"deleteCalibrationPosition": <int>
}
clearCalibrationPositions
will remove the all joint positions from the viam:frame-calibration:camera-on-arm
's config. Use the config history feature if you wish to recover the removed positions.
{
"clearCalibrationPositions": ""
}