Spaces:
Running
on
Zero
Running
on
Zero
enhance logging for helper keyframes with detailed position and rotation data
Browse files- visualization/logger.py +24 -15
visualization/logger.py
CHANGED
@@ -143,19 +143,28 @@ class SimulationLogger:
|
|
143 |
if not helper_keyframes:
|
144 |
return
|
145 |
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
])
|
150 |
-
rr.log(
|
151 |
-
"world/helper_keyframes",
|
152 |
-
rr.Points3D(
|
153 |
-
helper_positions,
|
154 |
-
colors=np.full((len(helper_positions), 4),
|
155 |
-
[1.0, 1.0, 0.0, 1.0])
|
156 |
-
),
|
157 |
-
timeless=True
|
158 |
-
)
|
159 |
|
160 |
-
|
161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
if not helper_keyframes:
|
144 |
return
|
145 |
|
146 |
+
for frame_idx, helper_frame in enumerate(helper_keyframes):
|
147 |
+
try:
|
148 |
+
rr.set_time_sequence("frame_idx", frame_idx)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
|
150 |
+
position = vector3_to_numpy(helper_frame['position'])
|
151 |
+
rotation_q = euler_to_quaternion(helper_frame['angle'])
|
152 |
+
|
153 |
+
rr.log(
|
154 |
+
"world/helper",
|
155 |
+
rr.Transform3D(
|
156 |
+
translation=position,
|
157 |
+
rotation=rr.Quaternion(xyzw=rotation_q)
|
158 |
+
)
|
159 |
+
)
|
160 |
+
|
161 |
+
rr.log(
|
162 |
+
"world/helper/indicator",
|
163 |
+
rr.Points3D(
|
164 |
+
points=np.array([position]),
|
165 |
+
colors=np.array([[1.0, 1.0, 0.0, 1.0]]), # Yellow
|
166 |
+
)
|
167 |
+
)
|
168 |
+
|
169 |
+
except Exception as e:
|
170 |
+
print(f"Error logging helper keyframe {frame_idx}: {str(e)}")
|