grid_generator.py
grid_generator.py generates very simple 2D grid of RigidTransform[]
parameters
Section titled “parameters”- Optional: scan_id (autogenerated if not provided)
- Required: center_x, center_y, grid_size_x, grid_size_y, grid_spacing, z_height
relevant schema
Section titled “relevant schema”schema/Scan/Scan.pyschema/RigidTransform/RigidTransform.py
Rotations
Section titled “Rotations”if optional params are provided, the rotations should be applied to each pose in the grid.
For our rotations about Z axis, we will use the following convention: —bracket_range_A_yaw_deg (float) —step_size_A_deg (float)
For our rotations about Y axis, we will use the following convention: —bracket_range_B_pitch_deg (float) —step_size_B_deg (float)
For our rotations about X axis, we will use the following convention: —bracket_range_C_roll_deg (float) —step_size_C_deg (float)
Always apply the A rotation first. For each A position apply the full bracket of B positions. For each AB position apply the full bracket of C positions.
Name each position accordingly to its integer index within the location bracket.
i.e. “pose_x0-y0_A0-B2-C1”
Generating from Kalibr AprilGrid metadata
Section titled “Generating from Kalibr AprilGrid metadata”The AprilGrid metadata file is generated by the Kalibr tool.
{ "description": "AprilGrid placement metadata for Blender. Kalibr origin is bottom-left corner of tag ID 0.", "units": "millimeters", "no_margin": true, "tag_size_mm": 20.0, "spacer_size_mm": 6.0, "tag_pitch_mm": 26.0, "grid_dimensions_mm": { "width": 624.0, "height": 624.0 }, "image_dimensions_mm": { "width": 630.0, "height": 630.0 }, "kalibr_origin_offset_from_image_bottom_left_mm": { "x": 6.0, "y": 6.0 }, "grid_top_right_from_kalibr_origin_mm": { "x": 618.0, "y": 618.0 }, "tags": [ { "id": 0, "bottom_left_mm": { "x": 0.0, "y": 0.0 }, "top_right_mm": { "x": 20.0, "y": 20.0 } }, { "id": 1, "bottom_left_mm": { "x": 26.0, "y": 0.0 }, "top_right_mm": { "x": 46.0, "y": 20.0 } }, ...generate_grid_scan_plan_from_aprilgrid_metadata(metadata_file: Path, z_height: float, ratio_of_target_coverage: float, density_of_poses_relative_fortynine: float, bracket_range_A_yaw_deg: float, step_size_A_deg: float, bracket_range_B_pitch_deg: float, step_size_B_deg: float, bracket_range_C_roll_deg: float, step_size_C_deg: float) -> ScanPlanthis does something sensible.
for example if our target is 1000mm and our ratio_of_target_coverage is 0.5, then we should generate a grid that covers 500mm of the target.
the default grid size is 7x7 poses (49 total). If density_of_poses_relative_fortynine is provided, it should be used to scale the number of poses generated. i.e. if density is 2.0, then we should generate a 14x14 grid (196 total poses).
all of bracket_range_A_yaw_deg: float, step_size_A_deg: float, bracket_range_B_pitch_deg: float, step_size_B_deg: float should default to 10 degrees with 5 degree step size
bracket_range_C_roll_deg: float, step_size_C_deg: float should default to 0 degrees with 5 degree step size