abreza commited on
Commit
6e1b46b
·
1 Parent(s): 2477854

enhance logging for helper keyframes with detailed position and rotation data

Browse files
Files changed (1) hide show
  1. visualization/logger.py +24 -15
visualization/logger.py CHANGED
@@ -143,19 +143,28 @@ class SimulationLogger:
143
  if not helper_keyframes:
144
  return
145
 
146
- try:
147
- helper_positions = np.array([
148
- vector3_to_numpy(frame['position']) for frame in helper_keyframes
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
- except Exception as e:
161
- print(f"Error logging helper keyframes: {str(e)}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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)}")