Skip to content

Commit baedaa0

Browse files
committed
feat: .drive method
1 parent 636687f commit baedaa0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

arduino_alvik.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ def get_line_sensors(self) -> (int, int, int):
146146

147147
return self.left_line, self.center_line, self.right_line
148148

149+
def drive(self, linear_velocity: float, angular_velocity: float):
150+
"""
151+
Drives the robot by linear and angular velocity
152+
:param linear_velocity:
153+
:param angular_velocity:
154+
:return:
155+
"""
156+
self.packeter.packetC2F(ord('V'), linear_velocity, angular_velocity)
157+
uart.write(self.packeter.msg[0:self.packeter.msg_size])
158+
149159
def set_servo_positions(self, a_position: int, b_position: int):
150160
"""
151161
Sets A/B servomotor angle

0 commit comments

Comments
 (0)