From 0d84232a56ab7b2de651516f809d11db1b61364a Mon Sep 17 00:00:00 2001 From: Cole Deck Date: Wed, 10 May 2023 13:38:54 -0500 Subject: [PATCH] update code --- software/android/.idea/kotlinc.xml | 6 ++++ software/raspberry pi/adafruit_servokit.py | 4 +-- software/raspberry pi/config.json | 40 +++++++++++----------- software/raspberry pi/hexapod.py | 12 +++---- 4 files changed, 34 insertions(+), 28 deletions(-) create mode 100644 software/android/.idea/kotlinc.xml diff --git a/software/android/.idea/kotlinc.xml b/software/android/.idea/kotlinc.xml new file mode 100644 index 0000000..7e340a7 --- /dev/null +++ b/software/android/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/software/raspberry pi/adafruit_servokit.py b/software/raspberry pi/adafruit_servokit.py index 531d3a6..ae1931b 100644 --- a/software/raspberry pi/adafruit_servokit.py +++ b/software/raspberry pi/adafruit_servokit.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: MIT # # MODIFIED to use pololu motor drivers, but compatible with adafruit_servokit driver layout -# by Cole Deck +# by Amelia Deck # Based on adafruit_motor.py as well """ @@ -152,7 +152,7 @@ class pololuservo: self._duty_range = max_pulse - min_pulse self.duty_cycle = 0 print("init servo", ch) - pca.setAccel(ch, 10) + pca.setAccel(ch, 15) pca.setTarget(ch, int((max_pulse-min_pulse)/2 + min_pulse)) # set midpoint time.sleep(0.1) pca.setAccel(ch, 0) diff --git a/software/raspberry pi/config.json b/software/raspberry pi/config.json index 7654bb3..439ea0a 100644 --- a/software/raspberry pi/config.json +++ b/software/raspberry pi/config.json @@ -38,9 +38,9 @@ "movementInterval": 5, "movementSwitchDuration": 150, "leg0Offset": [ - 0, 10, - 25 + 10, + 30 ], "leg0Scale": [ 1, @@ -48,29 +48,29 @@ -1 ], "leg1Offset": [ - -1.0, - 8, - -6 + 15, + -20, + 35 ], "leg1Scale": [ 1, - 1, - 1 + -1, + -1 ], "leg2Offset": [ - 1.0, - 12.0, - 1.0 + -3, + 10, + 20 ], "leg2Scale": [ 1, - 1, - 1 + -1, + -1 ], "leg3Offset": [ - -3, - 12.0, - -6.0 + 7, + 15, + -10 ], "leg3Scale": [ 1, @@ -78,9 +78,9 @@ 1 ], "leg4Offset": [ - -6, - 2, - -6.0 + 15, + 10, + 5 ], "leg4Scale": [ 1, @@ -88,9 +88,9 @@ 1 ], "leg5Offset": [ - 0, + -7, 10, - -40 + -30 ], "leg5Scale": [ 1, diff --git a/software/raspberry pi/hexapod.py b/software/raspberry pi/hexapod.py index 3e62cb0..46d97d7 100644 --- a/software/raspberry pi/hexapod.py +++ b/software/raspberry pi/hexapod.py @@ -132,18 +132,18 @@ class Hexapod(Thread): correction=self.config.get('leg1Offset', [0, 0, 0]), scale=self.config.get('leg1Scale', [1, 1, 1])), # rear right Leg(2, - [self.pca_left.servo[12], self.pca_left.servo[13], - self.pca_left.servo[14]], + [self.pca_left.servo[14], self.pca_left.servo[13], + self.pca_left.servo[12]], correction=self.config.get('leg2Offset', [0, 0, 0]), scale=self.config.get('leg2Scale', [1, 1, 1])), # rear left Leg(3, - [self.pca_right.servo[15], self.pca_right.servo[16], - self.pca_right.servo[17]], + [self.pca_right.servo[17], self.pca_right.servo[16], + self.pca_right.servo[15]], correction=self.config.get('leg3Offset', [0, 0, 0]), scale=self.config.get('leg3Scale', [1, 1, 1])), # center left Leg(4, - [self.pca_right.servo[9], self.pca_right.servo[10], - self.pca_right.servo[11]], + [self.pca_right.servo[11], self.pca_right.servo[10], + self.pca_right.servo[9]], correction=self.config.get('leg4Offset', [0, 0, 0]), scale=self.config.get('leg4Scale', [1, 1, 1])), # front left Leg(5,