File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,15 @@ def group_id(self) -> int:
263263 )
264264 return - 1
265265
266+ @property
267+ def is_attached (self ) -> bool :
268+ """Check if the camera is attached to a parent entity.
269+
270+ Returns:
271+ bool: True if the camera is attached to a parent entity, False otherwise.
272+ """
273+ return self .cfg .extrinsics .parent is not None
274+
266275 def update (self , ** kwargs ) -> None :
267276 """Update the sensor data.
268277
Original file line number Diff line number Diff line change @@ -213,8 +213,9 @@ def run_keyboard_control_for_camera(
213213 log_info ("Reset to initial pose" )
214214 elif key == ord ("p" ):
215215 new_pose_print = new_pose .copy ()
216- new_pose_print [:3 , 1 ] = - new_pose_print [:3 , 1 ]
217- new_pose_print [:3 , 2 ] = - new_pose_print [:3 , 2 ]
216+ if sensor .is_attached is False :
217+ new_pose_print [:3 , 1 ] = - new_pose_print [:3 , 1 ]
218+ new_pose_print [:3 , 2 ] = - new_pose_print [:3 , 2 ]
218219 translation = new_pose_print [:3 , 3 ]
219220 rot = R .from_matrix (new_pose_print [:3 , :3 ])
220221 quaternion = rot .as_quat ()
You can’t perform that action at this time.
0 commit comments