From f1ad51199b480737c5868e2b7b045e5664cd76b1 Mon Sep 17 00:00:00 2001 From: Zhengyu Peng Date: Mon, 7 Mar 2022 22:40:22 -0500 Subject: [PATCH] Update hexapod.py --- software/raspberry pi/hexapod.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/software/raspberry pi/hexapod.py b/software/raspberry pi/hexapod.py index 2d92eb3..e907e3b 100644 --- a/software/raspberry pi/hexapod.py +++ b/software/raspberry pi/hexapod.py @@ -333,6 +333,11 @@ class Hexapod(Thread): angle = float(data_array[3]) if op == 'angle': self.legs[leg_idx].set_angle(joint_idx, angle) + elif op == 'offset': + config_str = 'leg'+str(leg_idx)+'Offset' + self.legs[leg_idx].correction[joint_idx] = angle + self.config[config_str] = self.legs[leg_idx].correction + self.legs[leg_idx].reset(calibrated=True) def run(self): while True: