@@ -35,7 +35,7 @@ const long interval = 60000;
35
35
36
36
/* Servo control */
37
37
#include < VarSpeedServo.h>
38
- const int servo_speed = 60 ; // 0-255
38
+ const int servo_speed = 40 ; // default speed range 0-255
39
39
VarSpeedServo p_sv;
40
40
VarSpeedServo y_sv;
41
41
@@ -57,22 +57,22 @@ void servo_cb(const std_msgs::UInt16MultiArray& msg) {
57
57
y_sv.write (y, msg.data [2 ], true );
58
58
}
59
59
else if (msg.data [2 ] >= 255 ) {
60
- p_sv.write (p, 255 , false );
61
- y_sv.write (y, 255 , true );
60
+ p_sv.write (p, servo_speed , false );
61
+ y_sv.write (y, servo_speed , true );
62
62
}
63
63
}
64
64
else if (msg.data_length == 4 ) {
65
65
if (msg.data [2 ] > 0 && msg.data [2 ] < 255 ) {
66
66
p_sv.write (p, msg.data [2 ], false );
67
67
}
68
68
else if (msg.data [2 ] >= 255 ) {
69
- p_sv.write (p, 255 , false );
69
+ p_sv.write (p, servo_speed , false );
70
70
}
71
71
if (msg.data [3 ] > 0 && msg.data [3 ] < 255 ) {
72
72
y_sv.write (y, msg.data [3 ], true );
73
73
}
74
74
else if (msg.data [3 ] >= 255 ) {
75
- y_sv.write (y, 255 , true );
75
+ y_sv.write (y, servo_speed , true );
76
76
}
77
77
}
78
78
active = true ;
0 commit comments