File dữ liệu đầu vào:
../data.csv
Thống kê đã kiểm tra:
Số frame: 3977
Số cột: 284
Số cột teleop joint: 27
Thời gian bắt đầu: 0.120286 s
Thời gian kết thúc: 83.270855 s
Tổng thời lượng: 83.150569 s
Median dt: 0.020887 s
FPS xấp xỉ: 47.8769
CSV có các nhóm dữ liệu quan trọng:
time: timestamp của mỗi frame.ts_teleop_pelvis:position_0/1/2: vị trí pelvis/root.ts_teleop_pelvis:quaternion_0/1/2/3: hướng pelvis/root.ts_teleop_*_joint:joint_angular_position: góc joint để puppet robot.
Mapping thân trên:
waist_yaw_joint -> ts_teleop_waist_yaw_joint:joint_angular_position
left_shoulder_pitch_joint -> ts_teleop_left_shoulder_pitch_joint:joint_angular_position
left_shoulder_roll_joint -> ts_teleop_left_shoulder_roll_joint:joint_angular_position
left_shoulder_yaw_joint -> ts_teleop_left_shoulder_yaw_joint:joint_angular_position
left_elbow_pitch_joint -> ts_teleop_left_elbow_pitch_joint:joint_angular_position
left_wrist_yaw_joint -> ts_teleop_left_wrist_yaw_joint:joint_angular_position
left_wrist_roll_joint -> ts_teleop_left_wrist_roll_joint:joint_angular_position
left_wrist_pitch_joint -> ts_teleop_left_wrist_pitch_joint:joint_angular_position
right_shoulder_pitch_joint -> ts_teleop_right_shoulder_pitch_joint:joint_angular_position
right_shoulder_roll_joint -> ts_teleop_right_shoulder_roll_joint:joint_angular_position
right_shoulder_yaw_joint -> ts_teleop_right_shoulder_yaw_joint:joint_angular_position
right_elbow_pitch_joint -> ts_teleop_right_elbow_pitch_joint:joint_angular_position
right_wrist_yaw_joint -> ts_teleop_right_wrist_yaw_joint:joint_angular_position
right_wrist_roll_joint -> ts_teleop_right_wrist_roll_joint:joint_angular_position
right_wrist_pitch_joint -> ts_teleop_right_wrist_pitch_joint:joint_angular_position
Mặc định, root pose của robot lấy từ pelvis trong CSV:
ts_teleop_pelvis:position_0
ts_teleop_pelvis:position_1
ts_teleop_pelvis:position_2
ts_teleop_pelvis:quaternion_0
ts_teleop_pelvis:quaternion_1
ts_teleop_pelvis:quaternion_2
ts_teleop_pelvis:quaternion_3
- Lấy root position mỗi frame.
- Trừ offset XY của frame đầu tiên để robot bắt đầu gần gốc tọa độ.
- Giữ trục Z theo data để robot có độ cao pelvis thật.
- Normalize quaternion để tránh lỗi orientation.
- Nếu quaternion có
w < 0, đổi dấu cả quaternion để biểu diễn nhất quán.
Xử Lý Joint Limit
Một số joint thân trên trong CSV có thể vượt joint limit của model full, đặc biệt:
- shoulder roll
- elbow pitch
Để đảm bảo MuJoCo nhận pose hợp lệ, mỗi giá trị joint được clamp:
value = np.clip(raw_value, lower, upper)
Trong đó lower và upper lấy trực tiếp từ model.jnt_range.