From 305f800589ca96dbd281e471ec36392b8b4233d9 Mon Sep 17 00:00:00 2001 From: Iori Yanokura Date: Sun, 11 Feb 2024 13:09:43 +0900 Subject: [PATCH 1/2] Set a baseline threshold value before sending joint angle commands with ref_angle in the wormmodule. --- rcb4/armh7interface.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rcb4/armh7interface.py b/rcb4/armh7interface.py index 2c485c7a..52098805 100644 --- a/rcb4/armh7interface.py +++ b/rcb4/armh7interface.py @@ -164,6 +164,12 @@ def open(self, port='/dev/ttyUSB1', baudrate=1000000, timeout=0.01): self.check_firmware_version() self.copy_worm_params_from_flash() self.search_worm_ids() + # Set a baseline threshold value + # before sending joint angle commands with ref_angle in the WormModule. + self.write_cstruct_slot_v( + WormmoduleStruct, 'thleshold', 30 * np.ones(max_sensor_num)) + self.write_cstruct_slot_v( + WormmoduleStruct, 'thleshold_scale', np.ones(max_sensor_num)) self.search_servo_ids() self.all_jointbase_sensors() return True From a3c98727b93006a7b6e8477ae2984336269c7a4b Mon Sep 17 00:00:00 2001 From: Iori Yanokura Date: Sun, 11 Feb 2024 13:09:56 +0900 Subject: [PATCH 2/2] Rename arm to interface --- rcb4/armh7interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rcb4/armh7interface.py b/rcb4/armh7interface.py index 52098805..82f008e6 100644 --- a/rcb4/armh7interface.py +++ b/rcb4/armh7interface.py @@ -1040,5 +1040,5 @@ def servo_states(self): if __name__ == '__main__': - arm = ARMH7Interface() - print(arm.auto_open()) + interface = ARMH7Interface() + print(interface.auto_open())