MCPcopy Create free account
hub / github.com/SHAILAB-IPEC/OpenFly-Platform / transform_to_camera_frame

Method transform_to_camera_frame

train/eval.py:332–346  ·  view source on GitHub ↗
(self, roll, pitch, yaw)

Source from the content-addressed store, hash-verified

330 ])
331
332 def transform_to_camera_frame(self, roll, pitch, yaw):
333 R_roll = self.rotation_matrix_roll(roll)
334 R_pitch = self.rotation_matrix_pitch(pitch)
335 R_yaw = self.rotation_matrix_yaw(yaw)
336 R_combined = np.dot(R_pitch, np.dot(R_yaw, R_roll))
337 QW, QX, QY, QZ = rotation_matrix_to_quaternion(R_combined)
338 print(f"QW: {QW}, QX: {QX}, QY: {QY}, QZ: {QZ}")
339 transformation_matrix = np.array([
340 [0, -1, 0],
341 [0, 0, -1],
342 [1, 0, 0]
343 ])
344 new_R = np.dot(transformation_matrix, R_combined)
345 QW_new, QX_new, QY_new, QZ_new = rotation_matrix_to_quaternion(new_R)
346 return QW_new, QX_new, QY_new, QZ_new
347
348 def set_camera_pose(self, x, y, z, pitch, yaw, roll, path_params):
349 yaw = -yaw

Callers 1

set_camera_poseMethod · 0.95

Calls 4

rotation_matrix_rollMethod · 0.95
rotation_matrix_pitchMethod · 0.95
rotation_matrix_yawMethod · 0.95

Tested by

no test coverage detected