From 80b911dd8d47bbfe277a7d8434958cd123172d34 Mon Sep 17 00:00:00 2001 From: Cole Deck Date: Wed, 10 May 2023 19:07:16 -0500 Subject: [PATCH] update paths --- software/raspberry pi/btserver.py | 2 +- software/raspberry pi/hexapod.py | 30 +++++++++++++++--------------- software/raspberry pi/tcpserver.py | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/software/raspberry pi/btserver.py b/software/raspberry pi/btserver.py index fe97562..5fdbf0f 100644 --- a/software/raspberry pi/btserver.py +++ b/software/raspberry pi/btserver.py @@ -49,7 +49,7 @@ class BluetoothServer(Thread): self.cmd_queue = out_cmd_queue - with open('/home/cole/Downloads/hexapod/software/raspberry pi/config.json', 'r') as read_file: + with open('config.json', 'r') as read_file: self.config = json.load(read_file) try: diff --git a/software/raspberry pi/hexapod.py b/software/raspberry pi/hexapod.py index 713a58b..e0637c1 100644 --- a/software/raspberry pi/hexapod.py +++ b/software/raspberry pi/hexapod.py @@ -1,4 +1,4 @@ -#!python +#!/usr/bin/python3 # # 2021 - PRESENT Zhengyu Peng # Website: https://zpeng.me @@ -116,39 +116,39 @@ class Hexapod(Thread): self.mount_position[:, 1] = self.mount_y # Objects - self.pca_right = ServoKit(channels=18, address="/dev/ttyACM0", frequency=0x0c) - self.pca_left = ServoKit(channels=18, address="/dev/ttyACM0", frequency=0x0d) + self.pca_right = ServoKit(channels=18, address="/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0", frequency=0x0c) + self.pca_left = ServoKit(channels=18, address="/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0", frequency=0x0d) #self.pca_left = self.pca_right self.legs = [ # front right Leg(0, - [self.pca_left.servo[2], self.pca_left.servo[1], - self.pca_left.servo[0]], + [self.pca_left.servo[0], self.pca_left.servo[1], + self.pca_left.servo[2]], correction=self.config.get('leg0Offset', [0, 0, 0]), scale=self.config.get('leg0Scale', [1, 1, 1])), # center right Leg(1, - [self.pca_left.servo[8], self.pca_left.servo[7], - self.pca_left.servo[6]], + [self.pca_left.servo[3], self.pca_left.servo[4], + self.pca_left.servo[5]], correction=self.config.get('leg1Offset', [0, 0, 0]), scale=self.config.get('leg1Scale', [1, 1, 1])), # rear right Leg(2, - [self.pca_left.servo[14], self.pca_left.servo[13], - self.pca_left.servo[12]], + [self.pca_left.servo[6], self.pca_left.servo[7], + self.pca_left.servo[8]], correction=self.config.get('leg2Offset', [0, 0, 0]), scale=self.config.get('leg2Scale', [1, 1, 1])), # rear left Leg(3, - [self.pca_right.servo[17], self.pca_right.servo[16], - self.pca_right.servo[15]], + [self.pca_right.servo[6], self.pca_right.servo[7], + self.pca_right.servo[8]], correction=self.config.get('leg3Offset', [0, 0, 0]), scale=self.config.get('leg3Scale', [1, 1, 1])), # center left Leg(4, - [self.pca_right.servo[11], self.pca_right.servo[10], - self.pca_right.servo[9]], + [self.pca_right.servo[3], self.pca_right.servo[4], + self.pca_right.servo[5]], correction=self.config.get('leg4Offset', [0, 0, 0]), scale=self.config.get('leg4Scale', [1, 1, 1])), # front left Leg(5, - [self.pca_right.servo[5], self.pca_right.servo[4], - self.pca_right.servo[3]], + [self.pca_right.servo[0], self.pca_right.servo[1], + self.pca_right.servo[2]], correction=self.config.get('leg5Offset', [0, 0, 0]), scale=self.config.get('leg5Scale', [1, 1, 1]))] # self.leg_0.reset(True) diff --git a/software/raspberry pi/tcpserver.py b/software/raspberry pi/tcpserver.py index a888df4..4ab4fff 100644 --- a/software/raspberry pi/tcpserver.py +++ b/software/raspberry pi/tcpserver.py @@ -47,7 +47,7 @@ class TCPServer(Thread): self.cmd_queue = out_cmd_queue - with open('/home/cole/Downloads/hexapod/software/raspberry pi/config.json', 'r') as read_file: + with open('config.json', 'r') as read_file: self.config = json.load(read_file) self.ip = '0.0.0.0'