Info |
---|
The below describes the calibration method for Beta RapidSense RapidSense’s beta release. This requires some manual work and ensuring the cal.json file is configured and stored in the directory: ~/.config/rapidsense. In the future RapidSense release, the process will include a GUI and be much more user friendly. |
...
The current method uses the robot to calibrate the sensors. The robot will need to hold a calibration tag and move through positions with the tag in the sensors field of view during the calibration process. The positions will need to be are set by the user. Optionally, a calibration tag will also need to may be mounted as a stationary tag in the scene (not attached to a robot) in the field of view of the sensors in order for the system to be able to detect if the sensors have shifted out of calibration.
...
The requirements for calibration are:
Aruco tag mounted off of the robot faceplate on the user created mount, attached to the robot. The details of Aruco tags can be found in this user manual under System Setup - Hardware Requirements - Calibration Tag Details.
(Optional)Static Stationary Aruco tag placed in the scene which is easily clearly visible to the sensor(s)
Calibration preset in RPC called “Calibration” with accurate TCP frame located at the center of the Aruco tag.
For calibrating, create a frame on the aruco Aruco tag face center centered with its X axis (Red) pointing to the right, Y (Green) pointing upwards and Z (Blue) coming out of the face. Something like this:
...
cal.json file which has all the camera serial_numbers and each sensor’s corresponding robot target position for calibration which have the Aruco tag on the robot in the sensor field of view
markers.json file which has the Aruco marker’s ID, length, and name of the robot to which the marker was mounted.
A home robot target position with the following naming convention: robotname_home.
The calibration robot target positions present in cal.json should be connected on Roadmap to the home target in RPC project in order for the calibration to succeed.
Setup and Running Calibration Process Manually
To easily generate the RapidSense generates a default cal.json
file and save it in ~/.config/rapidsense, there is a calibration_generator.py script which prompts the user for all the necessary information and generates the cal.json file. Run the calibration_generator.py script by typing “calibration_generator.py” in the command line of the terminal and follow the prompts to create a cal.json file. The below is an example of the prompts to the user and responses.
...
upon running with all the detected sensors listed. It is important you have all the sensors you wish to use connected BEFORE starting RapidSense. If you want to add sensors later, you must remove your existing cal.json
and restart RapidSense and reconfigure the file.
After the cal.json
file has been generated, run the calibration_service.py
script and go open a browser to localhost:9000/calibration
to calibrate all the cameras after rapidsense
and rtr_rapidsense_proxy
services applications are running or go to alternatively, you can also use the RapidSense Monitor interface UI (see below) to perform calibration. The calibration script will pull in information from the cal.json
file and make move the robots move to the cal_their targets sequentially, extrinsically calibrating all corresponding cameras. The robot will then return to the home location and all the cameras will save the pose of the static marker stationary tag if placed in the scene. After a successful calibration, all the values will be automatically updated in the cal.json
file. Current calibration implementation looks like this and follows these states:
Code Block |
---|
from state import *
from statemachine import StateMachine
from controller import Controller
class CalibrationSequence(StateMachine):
def __init__(self, steps, robot_name):
states = list()
for data in steps:
states.append(MoveToTarget(data["cal_target"]))
states.append(Calibrate(data["serial_number"]))
states.append(MoveToTarget(robot_name + "_home"))
states.append(StaticCalibrate("stationary"))
StateMachine.__init__(self, states, robot_name)
|
Info |
---|
The following prerequisites should be met before running calibration:
|
Running Calibration from RapidSense Monitor UI
In the Settings page of the RapidSense Monitor UI, there is a button available which will run initiate the calibration service and process. A user will need to make sure that the robot is at the “[robotname]_home” target position before being able to run the process. A warning message will pop up to warn a user to ensure the calibration tag is attached to the robot and that the robot will move once it is confirmed to calibrate.
...
...
Code Block |
---|
'topic': 'Calibrate', 'data': { 'serial_number' : serial_number, 'tcp_pose' : tcp_pose } |
The calibration ASCII command { 'topic': 'Calibrate', 'data': { 'serial_number' : serial_number, 'tcp_pose' : tcp_pose } } is used where the serial_number is the camera to be calibrated and the TCP_pose is for the associated robot with the tag mounted on it. These values are sent over the proxy to rapidsense where Aruco detection algorithm finds the markers which allows for calibration of the sensors to occur. Before sending this command, the proper calibration robot preset must be active.
After successful calibration, the pose of the static marker is found and saved in the file cal.json. GetRapidSenseStatus is set as true for the is_calibrated for the corresponding sensor.
Continuous Calibration Checking Functionality
During the calibration process, the static Aruco tag in the scene is found and the image is cached to compare against during system running in order to detect when the sensors may have been shifted out of calibration. When it is detected that a sensor may have been shifted out of calibration, GetRapidSenseStatus is set to false for Is_calibrated for that particular sensor in order to warn the user that the calibration needs to be adjusted and run again.
Check the configuration
...
Check the configuration
After calibration is completed successfully, confirm calibration succeeded by issuing a ScanScene command to show obstacles detected by RapidSense. Verify Visually inspect that the objects in the detected obstacles match the actual cells. Incorrect orientation of the calibration tag may volume match expectation. Unsuccessful calibration could result in the following.
...
If calibration fails, verify the tag(s) are properly mounted to the robots (i.e., their orientation is correct, etc).
Sample cal.json File for (
...
3) Sensors
...
Code Block |
---|
{ "calibration": [ { "serial_number": "xyz", "extrinsics": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ], "seriallast_calibrated": "xyz2024-03-27 21:40:10.549000000", "marker": { "robot_mounted": { "id": 18, "lengthcal_target": 1.0, "robot": "Fanuc","xyz_cal" } "cal_target": "fanuc_cal" } }, { } }, "serial_number": "abc", { "extrinsics": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ], "seriallast_calibrated": "abc2024-03-27 21:40:15.218000000", "marker": { "robot_mounted": { "id": 28, "lengthcal_target": 2.0, "abc_cal" } "robot": "UR", } }, "cal_target": "cal_target_UR" { }"serial_number": "123", "stationaryextrinsics": {[ "id": 41.0, 0.0, "length": 0.1, 0.0, "pose": [ 0.0, 10.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 0.0, ], "last_calibrated": "2024-03-27 21:40:20.819000000", 1.0, "marker": { 0.0, "robot_mounted": { 0.0"id": 8, "cal_target": "123_cal" 0.0, } 0.0, } } ] } |
Sample markers.json File associated to the previous cal.json sample
Code Block |
---|
{ "markers": [ 1.0 { ]"id": 8, "length": 0.09, } }"robot": "Fanuc" } ] } |
Demo Video of Calibration
...