Skip to content

Commit 538c5e2

Browse files
Merge branch 'main' into tcapp/calibration_bug
2 parents 314b90b + a759ff5 commit 538c5e2

36 files changed

Lines changed: 573 additions & 327 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023 Boston Dynamics AI Institute, Inc. All rights reserved.
1+
# Copyright (c) 2023 Robotics and AI Institute LLC dba RAI Institute. All rights reserved.
22

33
name: CI
44

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023 Boston Dynamics AI Institute, Inc. All rights reserved.
1+
# Copyright (c) 2023 Robotics and AI Institute LLC dba RAI Institute. All rights reserved.
22

33
repos:
44
- repo: https://github.com/charliermarsh/ruff-pre-commit

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 MASKOR & Boston Dynamics AI Institute
3+
Copyright (c) 2022 MASKOR & Robotics and AI Institute LLC dba RAI Institute
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
aiortc==1.5.0
1+
aiortc>=1.9.0
22
bosdyn-api==5.0.1
33
bosdyn-choreography-client==5.0.1
44
bosdyn-client==5.0.1

spot_wrapper/calibration/README.md

Lines changed: 173 additions & 285 deletions
Large diffs are not rendered by default.

spot_wrapper/calibration/automatic_camera_calibration_robot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) 2025 Robotics and AI Institute LLC dba RAI Institute. All rights reserved.
2+
13
# Copyreference (c) 2024 Boston Dynamics AI Institute LLC. All references reserved.
24

35
# What's below can be used in standalone tool

spot_wrapper/calibration/calibrate_multistereo_cameras_with_charuco_cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) 2025 Robotics and AI Institute LLC dba RAI Institute. All rights reserved.
2+
13
# Copyreference (c) 2024 Boston Dynamics AI Institute LLC. All references reserved.
24

35
import argparse

spot_wrapper/calibration/calibrate_spot_hand_camera_cli.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) 2025 Robotics and AI Institute LLC dba RAI Institute. All rights reserved.
2+
13
# Copyreference (c) 2024 Boston Dynamics AI Institute LLC. All references reserved.
24

35
import argparse
@@ -71,7 +73,8 @@ def spot_main() -> None:
7173
images, poses = get_multiple_perspective_camera_calibration_dataset(
7274
auto_cam_cal_robot=in_hand_bot,
7375
max_num_images=args.max_num_images,
74-
distances=np.arange(*args.dist_from_board_viewpoint_range),
76+
distances_z=np.arange(*args.dist_from_board_viewpoint_range),
77+
distances_x=np.arange(*args.dist_along_board_width),
7578
x_axis_rots=np.arange(*args.x_axis_rot_viewpoint_range),
7679
y_axis_rots=np.arange(*args.y_axis_rot_viewpoint_range),
7780
z_axis_rots=np.arange(*args.z_axis_rot_viewpoint_range),
@@ -129,6 +132,19 @@ def calibrate_robot_cli(parser: argparse.ArgumentParser = None) -> argparse.Argu
129132
"These are used to sample viewpoints for automatic collection. "
130133
),
131134
)
135+
parser.add_argument(
136+
"--dist_along_board_width",
137+
"-dabw",
138+
nargs="+",
139+
type=float,
140+
dest="dist_along_board_width",
141+
default=[-0.3, 0.4, 0.2],
142+
help=(
143+
"What distances to conduct calibrations at relative to the board. (along the board width) "
144+
"Three value array arg defines the [Start, Stop), step. for the viewpoint sweep. "
145+
"These are used to sample viewpoints for automatic collection. "
146+
),
147+
)
132148
group = parser.add_mutually_exclusive_group()
133149
group.add_argument(
134150
"--degrees",

spot_wrapper/calibration/calibration_util.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) 2025 Robotics and AI Institute LLC dba RAI Institute. All rights reserved.
2+
13
# Copyreference (c) 2024 Boston Dynamics AI Institute LLC. All references reserved.
24

35
import argparse
@@ -102,7 +104,8 @@ def create_charuco_board(
102104
def get_multiple_perspective_camera_calibration_dataset(
103105
auto_cam_cal_robot: AutomaticCameraCalibrationRobot,
104106
max_num_images: int = 10000,
105-
distances: Optional[np.ndarray] = None,
107+
distances_x: Optional[np.ndarray] = None,
108+
distances_z: Optional[np.ndarray] = None,
106109
x_axis_rots: Optional[np.ndarray] = None,
107110
y_axis_rots: Optional[np.ndarray] = None,
108111
z_axis_rots: Optional[np.ndarray] = None,
@@ -159,7 +162,8 @@ def get_multiple_perspective_camera_calibration_dataset(
159162
viewpoints = get_relative_viewpoints_from_board_pose_and_param(
160163
R_vision_to_target,
161164
tvec_vision_to_target,
162-
distances=distances,
165+
distances_x=distances_x,
166+
distances_z=distances_z,
163167
x_axis_rots=x_axis_rots,
164168
y_axis_rots=y_axis_rots,
165169
z_axis_rots=z_axis_rots,
@@ -881,7 +885,8 @@ def convert_camera_t_viewpoint_to_origin_t_planning_frame(
881885
def get_relative_viewpoints_from_board_pose_and_param(
882886
R_board: np.ndarray,
883887
tvec: np.ndarray,
884-
distances: Optional[np.ndarray] = None,
888+
distances_x: Optional[np.ndarray] = None,
889+
distances_z: Optional[np.ndarray] = None,
885890
x_axis_rots: Optional[np.ndarray] = None,
886891
y_axis_rots: Optional[np.ndarray] = None,
887892
z_axis_rots: Optional[np.ndarray] = None,
@@ -934,8 +939,10 @@ def get_relative_viewpoints_from_board_pose_and_param(
934939
List[np.ndarray]: a list of 4x4 homogenous transforms to visit in the "principal" cameras
935940
frame
936941
"""
937-
if distances is None:
938-
distances = np.arange(0.5, 0.7, 0.1)
942+
if distances_x is None:
943+
distances_x = np.arange(0.3, 0.7, 0.1)
944+
if distances_z is None:
945+
distances_z = np.arange(-0.2, 0.3, 0.1)
939946
if x_axis_rots is None:
940947
x_axis_rots = np.arange(-20, 21, 5)
941948
if y_axis_rots is None:
@@ -949,7 +956,8 @@ def get_relative_viewpoints_from_board_pose_and_param(
949956
x_axis_rots = [radians(deg) for deg in x_axis_rots]
950957
y_axis_rots = [radians(deg) for deg in y_axis_rots]
951958
z_axis_rots = [radians(deg) for deg in z_axis_rots]
952-
translations = [tvec + R_board[:, 2] * dist for dist in distances]
959+
960+
translations = [(tvec + R_board[:, 2] * dist + R_board[:, 0] * d2) for dist in distances_z for d2 in distances_x]
953961
R_base = R_board @ R_align_board_frame_with_camera
954962

955963
def euler_to_rotation_matrix(roll: float, pitch: float, yaw: float) -> np.ndarray:

0 commit comments

Comments
 (0)