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
35import argparse
@@ -102,7 +104,8 @@ def create_charuco_board(
102104def 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(
881885def 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