8
8
from common .serialtypes import FLOAT , STRING , INT
9
9
10
10
class RecupPlante :
11
- def __init__ (self , wheeledbase : WheeledBase , barriere :Barriere , robot , pos_depose , pos_plante , final ) -> None :
11
+ def __init__ (self , wheeledbase : WheeledBase , barriere :Barriere , robot , pos_depose , pos_plante , final , sensors ) -> None :
12
12
self .wb = wheeledbase
13
13
self .robot = robot
14
14
self .pos = np .flip (np .array (pos_plante ))
@@ -20,6 +20,7 @@ def __init__(self, wheeledbase: WheeledBase, barriere:Barriere, robot, pos_depos
20
20
self .actionpoint_precision = None
21
21
self .endPoint = np .flip (np .array (pos_depose ))
22
22
self .final = final
23
+ self .sensors = sensors
23
24
24
25
"""
25
26
def calc_point_approche(self, pos_plante, theta_normal):
@@ -50,13 +51,13 @@ def procedure(self):
50
51
print (length - self .radiusRobot )
51
52
#print(self.wb.wheeledbase.getuuid())
52
53
if (length - self .radiusRobot > 0 ):
53
- self .wb .goto_stop (stop [0 ],stop [1 ],theta = ang )
54
+ self .wb .goto_stop (stop [0 ],stop [1 ],self . sensors , theta = ang )
54
55
55
56
######On prends
56
57
self .barriere .nicole_oouuuuuvre ()
57
58
58
59
stop = vecPos / length * (length - self .radiusPince )+ rPos
59
- self .wb .goto_stop (stop [0 ],stop [1 ], theta = ang , linvelmax = POSITIONCONTROL_LINVELMAX_VALUE * 0.15 )
60
+ self .wb .goto_stop (stop [0 ],stop [1 ],self . sensors , theta = ang , linvelmax = POSITIONCONTROL_LINVELMAX_VALUE * 0.15 )
60
61
61
62
self .wb .set_parameter_value (POSITIONCONTROL_LINVELMAX_ID , POSITIONCONTROL_LINVELMAX_VALUE , FLOAT )
62
63
@@ -77,19 +78,19 @@ def procedure(self):
77
78
print (theta )
78
79
print (ang )
79
80
80
- self .wb .goto_stop (rPos [0 ],rPos [1 ], theta = ang , angvelmax = POSITIONCONTROL_ANGVELMAX_VALUE * 0.05 )
81
- self .wb .goto_stop (stop [0 ],stop [1 ],theta = ang , angvelmax = POSITIONCONTROL_ANGVELMAX_VALUE , linvelmax = POSITIONCONTROL_LINVELMAX_VALUE * 0.3 )
81
+ self .wb .goto_stop (rPos [0 ],rPos [1 ],self . sensors , theta = ang , angvelmax = POSITIONCONTROL_ANGVELMAX_VALUE * 0.05 )
82
+ self .wb .goto_stop (stop [0 ],stop [1 ],self . sensors , theta = ang , angvelmax = POSITIONCONTROL_ANGVELMAX_VALUE , linvelmax = POSITIONCONTROL_LINVELMAX_VALUE * 0.3 )
82
83
83
84
#On recule pour le prochains
84
85
if (not self .final ):
85
86
self .barriere .nicole_oouuuuuvre ()
86
87
stop [0 ]= stop [0 ]- 150 * np .cos (ang )
87
88
stop [1 ]= stop [1 ]- 150 * np .sin (ang )
88
- self .wb .goto_stop (stop [0 ],stop [1 ],theta = ang + np .pi )
89
+ self .wb .goto_stop (stop [0 ],stop [1 ],self . sensors , theta = ang + np .pi )
89
90
else :
90
91
stop [0 ]= stop [0 ]- 50 * np .cos (ang )
91
92
stop [1 ]= stop [1 ]- 50 * np .sin (ang )
92
- self .wb .goto_stop (stop [0 ],stop [1 ],theta = ang )
93
+ self .wb .goto_stop (stop [0 ],stop [1 ],self . sensors , theta = ang )
93
94
self .barriere .nicole_oouuuuuvre ()
94
95
95
96
0 commit comments