This document covers the interactive calibration flow that starts from grasping_control/config/workspace_empty.yaml and saves named workspace YAML files on demand.
For how the runtime system consumes that file, see arm_control.md.
The calibration workflow stores robot-referenced workspace data for two different runtime uses.
objects: collision geometry thatmotion_execution_nodeloads into the MoveIt planning sceneworkspace_area: an optional square work zone used to reject out-of-bounds target poses before planning
The calibration node records manual samples around the robot, preserves the raw capture data, and derives simple planning primitives from those samples.
The node depends on:
- Manipulator's
joint_state_topic, default/joint_states - TF between
base_frameandtool_frame shape_definitions.yamlfor the supported object-capture layouts
During capture, each saved sample includes:
- a point label
- capture timestamp
- tool pose in the base frame
- a snapshot of the latest joint state
The current flow supports:
- a square workspace area derived from four captured corner points
- rectangular prisms derived from four top-face corners
- cylinders derived from one center point and four rim points
Shape requirements are defined in grasping_control/config/shape_definitions.yaml, so new capture patterns can be added without rewriting the interactive loop.
When the node starts, it loads workspace_empty.yaml by default, unless workspace_config_path explicitly points somewhere else, and then enters a CLI session.
The top-level menu lets the operator:
- review the currently saved workspace area
- review existing objects
- add a new object
- update an existing object
- save the in-memory calibration to a named YAML file with the
soption - calibrate the workspace area with the
woption - quit without saving
The node keeps calibration changes in memory until you explicitly choose save.
Top-level fields written by the calibration flow:
versionupdated_atbase_frametool_frameground_plane_zworkspace_areaobjects
The workspace_area field is either null or a dictionary containing:
type: currentlyworkspace_areacreated_atupdated_atbase_frametool_frameground_plane_zcapture_samplesgeometry
Its derived geometry block contains:
type:squaredimensions.side_length: average side length from the four captured edgesdimensions.height_from_ground: average captured Z minusground_plane_zpose.position: average center of the four cornerscorner_points: the four saved corner points in capture order
Each object entry contains:
nameshapecreated_atupdated_atbase_frametool_frameground_plane_zcapture_samplesgeometry
The derived geometry block is what runtime planning uses.
Supported derived runtime geometry types are:
boxcylinder
Use the w option in the calibration menu to record the robot working area.
- Move the tool to the first workspace corner and press Enter.
- Continue around the boundary in order for corners 2 through 4.
- The node stores the raw samples and derives a square-like area geometry.
motion_execution_nodelater uses those saved corners for its planar inside/outside test.
The capture order matters. The runtime area filter assumes the four corners are recorded in order around the boundary.
You may start from any corner, but after that you must keep moving around the perimeter in a single direction.
- Clockwise is valid.
- Anticlockwise is also valid.
- Zigzagging across the square is invalid.
Example valid sequence:
- corner_1 = near-left
- corner_2 = far-left
- corner_3 = far-right
- corner_4 = near-right
Example invalid sequence:
- corner_1 = near-left
- corner_2 = far-right
- corner_3 = far-left
- corner_4 = near-right
There is no special requirement such as "top-left first". The important rule is that consecutive captured points must be neighboring corners on the workspace boundary.
The workspace area is not added to the MoveIt planning scene as a collision object.
For top_surface_rectangle:
- Move the tool to each top-face corner in order around the object.
- Capture all four points.
- The node estimates the center, in-plane rotation, and the two planar dimensions from the sampled edges.
- The object height is computed as
top_z - ground_plane_z.
The saved geometry becomes a box whose top face matches the captured rectangle.
For side_face_rectangle:
- Move the tool to each side-face corner in order around the visible face.
- Capture all four points.
- Enter the obstacle depth measured inward from that captured face.
- The node extrudes the captured face by the entered depth to build the box.
For bottom_face_rectangle:
- Move the tool to each bottom-face corner in order around the hanging obstacle.
- Capture all four points.
- Enter the obstacle height above that captured bottom face.
- The node extends the box upward from the captured face by the entered height.
For a cylinder:
- Capture the top-face center.
- Capture four rim points around the top face.
- The node averages the XY distance from the center to the rim points to estimate radius.
- The object height is computed as
top_z - ground_plane_z.
The saved geometry becomes a cylinder aligned with the base frame.
joint_state_topicbase_frametool_frameground_plane_zworkspace_config_pathshape_definitions_path
If you override workspace_config_path, point motion_execution_node at the same file so both nodes use the same calibrated scene.
If you do not override workspace_config_path, workspace_creation starts from workspace_empty.yaml. When you choose save, it asks for a file name and writes that YAML into the colcon workspace root.
- Start the ur10 arm with gripper in servo mode. As an example,
source install/setup.bash
ros2 launch ur10_soft_two_fingers_moveit_config hardware_with_moveit.launch.py launch_servo:=true- Start workspace calibration:
source install/setup.bash
ros2 run grasping_control workspace_creation- Modify an existing workspace calibration:
source install/setup.bash
ros2 run grasping_control workspace_creation --ros-args -p workspace_config_path:=/home/ubuntu/colcon_ws/src/grasping/grasping_control/config/crlab_table.yaml- Move the arm with the following servo controller to a relevant point in space
source install/setup.bash
ros2 run grasping_control servo_teleopFollow the onscreen guidelines to add/edit workspace and objects.
- Run
workspace_creation. - Press
wto calibrate the workspace area if needed. - Capture the four workspace corners in order.
- Add or update collision objects as needed.
- Press
sand enter a file name to save the updatedworkspace_areaandobjectsinto the workspace root.