- Enhance rotation feedback by printing current angle during and after rotation - Adjust angles and add target distance in task 1 execution - Modify stop method in BaseMsg class to use milliseconds for duration
25 lines
634 B
Python
25 lines
634 B
Python
import time
|
|
|
|
class BaseMsg:
|
|
def __init__(self, ctrl, msg):
|
|
self.ctrl = ctrl
|
|
self.msg = msg
|
|
|
|
def stop_force(self):
|
|
self.msg.mode = 0
|
|
self.msg.gait_id = 0
|
|
self.msg.duration = 0
|
|
self.msg.life_count += 1
|
|
self.ctrl.Send_cmd(self.msg)
|
|
self.ctrl.Wait_finish(0, 0)
|
|
|
|
def stop(self, wait_time=200):
|
|
self.msg.mode = 11
|
|
self.msg.gait_id = 26
|
|
self.msg.vel_des = [0, 0, 0]
|
|
self.msg.duration = wait_time
|
|
self.msg.life_count += 1
|
|
self.ctrl.Send_cmd(self.msg)
|
|
if wait_time:
|
|
time.sleep(wait_time / 1000)
|
|
|