22 template <
typename scalar_t>
24 scalar_t *transformation_ptr,
const scalar_t *pose_ptr) {
25 transformation_ptr[0] = cos(pose_ptr[2]) * cos(pose_ptr[1]);
26 transformation_ptr[1] =
27 -1 * sin(pose_ptr[2]) * cos(pose_ptr[0]) +
28 cos(pose_ptr[2]) * sin(pose_ptr[1]) * sin(pose_ptr[0]);
29 transformation_ptr[2] =
30 sin(pose_ptr[2]) * sin(pose_ptr[0]) +
31 cos(pose_ptr[2]) * sin(pose_ptr[1]) * cos(pose_ptr[0]);
32 transformation_ptr[4] = sin(pose_ptr[2]) * cos(pose_ptr[1]);
33 transformation_ptr[5] =
34 cos(pose_ptr[2]) * cos(pose_ptr[0]) +
35 sin(pose_ptr[2]) * sin(pose_ptr[1]) * sin(pose_ptr[0]);
36 transformation_ptr[6] =
37 -1 * cos(pose_ptr[2]) * sin(pose_ptr[0]) +
38 sin(pose_ptr[2]) * sin(pose_ptr[1]) * cos(pose_ptr[0]);
39 transformation_ptr[8] = -1 * sin(pose_ptr[1]);
40 transformation_ptr[9] = cos(pose_ptr[1]) * sin(pose_ptr[0]);
41 transformation_ptr[10] = cos(pose_ptr[1]) * cos(pose_ptr[0]);
46 template <
typename scalar_t>
48 scalar_t *pose_ptr,
const scalar_t *transformation_ptr) {
49 const scalar_t sy = sqrt(transformation_ptr[0] * transformation_ptr[0] +
50 transformation_ptr[4] * transformation_ptr[4]);
52 pose_ptr[0] = atan2(transformation_ptr[9], transformation_ptr[10]);
53 pose_ptr[1] = atan2(-transformation_ptr[8], sy);
54 pose_ptr[2] = atan2(transformation_ptr[4], transformation_ptr[0]);
56 pose_ptr[0] = atan2(-transformation_ptr[6], transformation_ptr[5]);
57 pose_ptr[1] = atan2(-transformation_ptr[8], sy);
62 #ifdef BUILD_CUDA_MODULE
67 template <
typename scalar_t>
68 void PoseToTransformationCUDA(scalar_t *transformation_ptr,
69 const scalar_t *pose_ptr);
75 template <
typename scalar_t>
76 void TransformationToPoseCUDA(scalar_t *pose_ptr,
77 const scalar_t *transformation_ptr);
#define OPEN3D_HOST_DEVICE
Definition: CUDAUtils.h:44
OPEN3D_HOST_DEVICE void TransformationToPoseImpl(scalar_t *pose_ptr, const scalar_t *transformation_ptr)
Definition: TransformationConverterImpl.h:47
OPEN3D_HOST_DEVICE void PoseToTransformationImpl(scalar_t *transformation_ptr, const scalar_t *pose_ptr)
Shared implementation for PoseToTransformation function.
Definition: TransformationConverterImpl.h:23
Definition: PinholeCameraIntrinsic.cpp:16