write_poseT_write_poseWritePoseWritePosewrite_pose (Operator)

Name

write_poseT_write_poseWritePoseWritePosewrite_pose — Write a 3D pose to a text file.

Signature

write_pose( : : Pose, PoseFile : )

Herror T_write_pose(const Htuple Pose, const Htuple PoseFile)

void WritePose(const HTuple& Pose, const HTuple& PoseFile)

void HPose::WritePose(const HString& PoseFile) const

void HPose::WritePose(const char* PoseFile) const

void HPose::WritePose(const wchar_t* PoseFile) const   (Windows only)

static void HOperatorSet.WritePose(HTuple pose, HTuple poseFile)

void HPose.WritePose(string poseFile)

def write_pose(pose: Sequence[Union[int, float]], pose_file: str) -> None

Description

write_posewrite_poseWritePoseWritePoseWritePosewrite_pose is used to write a 3D pose PosePosePosePoseposepose into a text file with the name PoseFilePoseFilePoseFilePoseFileposeFilepose_file. The default HALCON file extension for the 3D pose is 'dat'.

A pose describes a rigid 3D transformation, i.e., a transformation consisting of an arbitrary translation and rotation, with 6 parameters, three for the translation, three for the rotation. With a seventh parameter different pose types can be indicated (see create_posecreate_poseCreatePoseCreatePoseCreatePosecreate_pose).

A file generated by write_posewrite_poseWritePoseWritePoseWritePosewrite_pose looks like the following: # 3D POSE PARAMETERS: rotation and translation # Used representation type: f 0 # Rotation angles [deg] or Rodriguez-vector: r -17.8134 1.83816 0.288092 # Translational vector (x y z [m]): t 0.280164 0.150644 1.7554

Execution Information

Parameters

PosePosePosePoseposepose (input_control)  pose HPose, HTupleSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

3D pose.

Number of elements: 7

PoseFilePoseFilePoseFilePoseFileposeFilepose_file (input_control)  filename.write HTuplestrHTupleHtuple (string) (string) (HString) (char*)

File name of the external camera parameters.

Default value: 'campose.dat' "campose.dat" "campose.dat" "campose.dat" "campose.dat" "campose.dat"

Suggested values: 'campose.dat'"campose.dat""campose.dat""campose.dat""campose.dat""campose.dat", 'campose_initial.dat'"campose_initial.dat""campose_initial.dat""campose_initial.dat""campose_initial.dat""campose_initial.dat", 'campose_final.dat'"campose_final.dat""campose_final.dat""campose_final.dat""campose_final.dat""campose_final.dat"

File extension: .dat

Example (HDevelop)

* Perform hand-eye calibration.
calibrate_hand_eye (CalibDataID, Errors)
* Query the camera parameters and the poses.
get_calib_data (CalibDataID, 'camera', 0, 'params', CamParam)
* Get poses computed by the hand eye calibration.
get_calib_data (CalibDataID, 'camera', 0, 'base_in_cam_pose', BaseInCamPose)
get_calib_data (CalibDataID, 'calib_obj', 0,\
                'obj_in_tool_pose', ObjInToolPose)
* Store the camera parameters to file.
write_cam_par (CamParam, DataNameStart + 'final_campar.dat')
* Save the hand eye calibration results to file.
write_pose (BaseInCamPose, DataNameStart + 'final_pose_cam_base.dat')
write_pose (ObjInToolPose, DataNameStart + 'final_pose_tool_calplate.dat')

Result

write_posewrite_poseWritePoseWritePoseWritePosewrite_pose returns TRUE if all parameter values are correct and the file has been written successfully. If necessary an exception is raised.

Possible Predecessors

camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibrationcamera_calibration, get_calib_dataget_calib_dataGetCalibDataGetCalibDataGetCalibDataget_calib_data, hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPoseHomMat3dToPosehom_mat3d_to_pose

See also

create_posecreate_poseCreatePoseCreatePoseCreatePosecreate_pose, find_marks_and_posefind_marks_and_poseFindMarksAndPoseFindMarksAndPoseFindMarksAndPosefind_marks_and_pose, camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibrationcamera_calibration, disp_caltabdisp_caltabDispCaltabDispCaltabDispCaltabdisp_caltab, sim_caltabsim_caltabSimCaltabSimCaltabSimCaltabsim_caltab, read_poseread_poseReadPoseReadPoseReadPoseread_pose, pose_to_hom_mat3dpose_to_hom_mat3dPoseToHomMat3dPoseToHomMat3dPoseToHomMat3dpose_to_hom_mat3d, hom_mat3d_to_posehom_mat3d_to_poseHomMat3dToPoseHomMat3dToPoseHomMat3dToPosehom_mat3d_to_pose

Module

Foundation