From a796d57e0bd3e126d9896e567be9edba569a31de Mon Sep 17 00:00:00 2001 From: Zhengyu Peng Date: Mon, 7 Mar 2022 22:41:10 -0500 Subject: [PATCH] Update hexapod.py --- software/raspberry pi/hexapod.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/software/raspberry pi/hexapod.py b/software/raspberry pi/hexapod.py index e907e3b..401d5db 100644 --- a/software/raspberry pi/hexapod.py +++ b/software/raspberry pi/hexapod.py @@ -334,11 +334,12 @@ class Hexapod(Thread): 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) + config_str = 'leg'+str(leg_idx)+'Offset' + self.config[config_str] = self.legs[leg_idx].correction + def run(self): while True: # if self.current_motion is None: