update code

master
Cole Deck 2 years ago
parent e329c893d7
commit 0d84232a56

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.6.21" />
</component>
</project>

@ -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)

@ -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,

@ -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,

Loading…
Cancel
Save