@@ -410,10 +410,10 @@ def _StartBlock_holds(self, state: State,
410410 """Check if domino is the start block (light green)."""
411411 domino , = objects
412412 eps = 1e-3
413- return (abs ( state . get ( domino , "r" ) - self . start_domino_color [ 0 ]) < eps
414- and abs (state .get (domino , "g " ) - self .start_domino_color [1 ]) <
415- eps and abs (state .get (domino , "b " ) -
416- self .start_domino_color [2 ]) < eps )
413+ return (
414+ abs (state .get (domino , "r " ) - self .start_domino_color [0 ]) < eps
415+ and abs (state .get (domino , "g " ) - self . start_domino_color [ 1 ]) < eps
416+ and abs ( state . get ( domino , "b" ) - self .start_domino_color [2 ]) < eps )
417417
418418 def _MovableBlock_holds (self , state : State ,
419419 objects : Sequence [Object ]) -> bool :
@@ -425,14 +425,14 @@ def _MovableBlock_holds(self, state: State,
425425 and abs (state .get (domino , "b" ) - self .domino_color [2 ]) < eps )
426426
427427 def _TargetDomino_holds (self , state : State ,
428- objects : Sequence [Object ]) -> bool :
428+ objects : Sequence [Object ]) -> bool :
429429 """Check if domino is a target (pink or glued red)."""
430430 domino , = objects
431431 eps = 1e-3
432432 return (self ._DominoGlued_holds (state , objects )) or (
433- abs (state .get (domino , "r" ) - self .target_domino_color [0 ]) < eps
434- and abs (state .get (domino , "g" ) - self .target_domino_color [1 ]) < eps
435- and abs (state .get (domino , "b" ) - self .target_domino_color [2 ]) < eps )
433+ abs (state .get (domino , "r" ) - self .target_domino_color [0 ]) < eps and
434+ abs (state .get (domino , "g" ) - self .target_domino_color [1 ]) < eps and
435+ abs (state .get (domino , "b" ) - self .target_domino_color [2 ]) < eps )
436436
437437 def _DominoNotGlued_holds (self , state : State ,
438438 objects : Sequence [Object ]) -> bool :
@@ -513,7 +513,9 @@ def place_domino(self,
513513 "is_held" : 0.0 ,
514514 }
515515
516- def place_pivot_or_target (self , x : float , y : float ,
516+ def place_pivot_or_target (self ,
517+ x : float ,
518+ y : float ,
517519 rot : float = 0.0 ) -> Dict :
518520 """Create a dictionary with placement parameters for a pivot/target."""
519521 return {
@@ -549,23 +551,23 @@ def Toppled(self) -> Predicate:
549551
550552
551553def create_domino_block (
552- color : Tuple [float , float , float , float ],
553- half_extents : Tuple [float , float , float ],
554- mass : float ,
555- friction : float ,
556- position : Pose3D = (0.0 , 0.0 , 0.0 ),
557- orientation : Quaternion = (0.0 , 0.0 , 0.0 , 1.0 ),
558- physics_client_id : int = 0 ,
559- add_top_triangle : bool = False ,
560- * ,
561- restitution : float = 0.02 ,
562- rolling_friction : float = 0.006 ,
563- spinning_friction : Optional [float ] = None ,
564- linear_damping : float = 0.0 ,
565- angular_damping : float = 0.03 ,
566- friction_anchor : bool = True ,
567- ccd : bool = True ,
568- ccd_swept_radius : Optional [float ] = None ,
554+ color : Tuple [float , float , float , float ],
555+ half_extents : Tuple [float , float , float ],
556+ mass : float ,
557+ friction : float ,
558+ position : Pose3D = (0.0 , 0.0 , 0.0 ),
559+ orientation : Quaternion = (0.0 , 0.0 , 0.0 , 1.0 ),
560+ physics_client_id : int = 0 ,
561+ add_top_triangle : bool = False ,
562+ * ,
563+ restitution : float = 0.02 ,
564+ rolling_friction : float = 0.006 ,
565+ spinning_friction : Optional [float ] = None ,
566+ linear_damping : float = 0.0 ,
567+ angular_damping : float = 0.03 ,
568+ friction_anchor : bool = True ,
569+ ccd : bool = True ,
570+ ccd_swept_radius : Optional [float ] = None ,
569571) -> int :
570572 """Create a domino-tuned block with appropriate physics settings."""
571573 block_id = create_pybullet_block (
0 commit comments