File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed
pio_workspace/test/thruster_tests/Docker/catkin_ws/src/propulsion/src Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change 21
21
pwm_array = [1500 ] * 8
22
22
23
23
# Ascending sequence
24
- for pwm in range (1520 , 1901 , 20 ):
24
+ for pwm in range (1508 , 1901 , 8 ): # Changed step to 8
25
25
pwm_array [thruster_num ] = pwm
26
26
pub .publish (ThrusterMicroseconds (pwm_array ))
27
27
print (f"Sent PWM { pwm } to thruster { thruster_num + 1 } " )
28
- time .sleep (1.5 )
28
+
29
+ # Sleep for 3.5 seconds if not 1500, otherwise 15 seconds
30
+ if pwm != 1500 :
31
+ time .sleep (3.5 )
32
+ else :
33
+ time .sleep (15 )
29
34
30
35
# Set back to neutral
31
36
pwm_array [thruster_num ] = 1500
32
37
pub .publish (ThrusterMicroseconds (pwm_array ))
33
- time .sleep (1.5 )
38
+
39
+ # Sleep for 3.5 seconds when going back to neutral (1500)
40
+ time .sleep (15 )
34
41
35
42
# Descending sequence
36
- for pwm in range (1480 , 1099 , - 20 ):
43
+ for pwm in range (1492 , 1099 , - 8 ): # Changed step to 8
37
44
pwm_array [thruster_num ] = pwm
38
45
pub .publish (ThrusterMicroseconds (pwm_array ))
39
46
print (f"Sent PWM { pwm } to thruster { thruster_num + 1 } " )
40
- time .sleep (1.5 )
47
+
48
+ # Sleep for 3.5 seconds if not 1500, otherwise 15 seconds
49
+ if pwm != 1500 :
50
+ time .sleep (3.5 )
51
+ else :
52
+ time .sleep (15 )
41
53
42
54
# Set back to neutral
43
55
pwm_array [thruster_num ] = 1500
44
56
pub .publish (ThrusterMicroseconds (pwm_array ))
45
- time .sleep (1.5 )
57
+
58
+ # Sleep for 3.5 seconds when going back to neutral (1500)
59
+ time .sleep (15 )
46
60
47
61
print ("Thruster test complete." )
48
-
You can’t perform that action at this time.
0 commit comments