@@ -56,6 +56,7 @@ def __init__(self, blackboard, dsd, parameters):
56
56
"""Go to an absolute position on the field"""
57
57
super ().__init__ (blackboard , dsd , parameters )
58
58
self .point = float (parameters .get ("x" , 0 )), float (parameters .get ("y" , 0 )), float (parameters .get ("t" , 0 ))
59
+ self .blocking = parameters .get ("blocking" , True )
59
60
60
61
def perform (self , reevaluate = False ):
61
62
pose_msg = PoseStamped ()
@@ -64,11 +65,26 @@ def perform(self, reevaluate=False):
64
65
65
66
pose_msg .pose .position .x = self .point [0 ]
66
67
pose_msg .pose .position .y = self .point [1 ]
67
- pose_msg .pose .position .z = 0
68
+ pose_msg .pose .position .z = 0.0
68
69
pose_msg .pose .orientation = quat_from_yaw (math .radians (self .point [2 ]))
69
70
70
71
self .blackboard .pathfinding .publish (pose_msg )
71
72
73
+ if not self .blocking :
74
+ self .pop ()
75
+
76
+
77
+ class GoToAbsolutePositionFieldFraction (GoToAbsolutePosition ):
78
+ def __init__ (self , blackboard , dsd , parameters ):
79
+ """Go to an absolute position of the field, specified by the fraction of the field size"""
80
+ super ().__init__ (blackboard , dsd , parameters )
81
+ point = float (parameters .get ("x" , 0 )), float (parameters .get ("y" , 0 )), float (parameters .get ("t" , 0 ))
82
+ self .point = (
83
+ point [0 ] * self .blackboard .world_model .field_length / 2 ,
84
+ point [1 ] * self .blackboard .world_model .field_width / 2 ,
85
+ self .point [2 ],
86
+ )
87
+
72
88
73
89
class GoToOwnGoal (GoToAbsolutePosition ):
74
90
def __init__ (self , blackboard , dsd , parameters ):
@@ -77,7 +93,7 @@ def __init__(self, blackboard, dsd, parameters):
77
93
self .point = (
78
94
self .blackboard .world_model .get_map_based_own_goal_center_xy ()[0 ],
79
95
self .blackboard .world_model .get_map_based_own_goal_center_xy ()[1 ],
80
- parameters ,
96
+ self . point [ 2 ] ,
81
97
)
82
98
83
99
@@ -88,12 +104,12 @@ def __init__(self, blackboard, dsd, parameters):
88
104
self .point = (
89
105
self .blackboard .world_model .get_map_based_opp_goal_center_xy ()[0 ],
90
106
self .blackboard .world_model .get_map_based_opp_goal_center_xy ()[1 ],
91
- parameters ,
107
+ self . point [ 2 ] ,
92
108
)
93
109
94
110
95
111
class GoToCenterpoint (GoToAbsolutePosition ):
96
112
def __init__ (self , blackboard , dsd , parameters ):
97
113
"""Go to the center of the field and look towards the enemy goal"""
98
114
super ().__init__ (blackboard , dsd , parameters )
99
- self .point = 0 , 0 , 0
115
+ self .point = 0.0 , 0.0 , 0. 0
0 commit comments