From bc84f7e8eb8d8f921ede1419d087ec144749da1f Mon Sep 17 00:00:00 2001 From: JackM323 Date: Wed, 29 Jul 2026 20:38:30 +0200 Subject: [PATCH] cleanup --- EspCommunication (2).py | 80 ----------------------------------------- README.md | 18 +++++----- config.py | 2 +- 3 files changed, 10 insertions(+), 90 deletions(-) delete mode 100644 EspCommunication (2).py diff --git a/EspCommunication (2).py b/EspCommunication (2).py deleted file mode 100644 index 6e664a6..0000000 --- a/EspCommunication (2).py +++ /dev/null @@ -1,80 +0,0 @@ -import socket -import struct - -PACKET_VERSION = 1 -FLOAT_COUNT = 30 * 6 * 3 - -PACKET_FMT = f"" - print(f"Gesendete Daten:\n{formatted_data}") - self._write(formatted_data) - - def wait4esp32(self, expected_message): - while True: - try: - data = self.sock.recv(1024).decode('utf-8').strip() - print(f"Empfangene Daten: {data}") - if data == expected_message: - print("Bewegung abgeschlossen!") - break - except socket.timeout: - time.sleep(0.05) - - def _write(self, message): - self.sock.sendall(message.encode('utf-8')) - - def stop(self): - self.running.clear() - self.join() - self.sock.close() diff --git a/README.md b/README.md index 5fe12a2..8453099 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,7 @@ **Purpose** - **Overview**: JackBot is a Python project for controlling and simulating a six-legged (hexapod) robot. It computes foot trajectories, runs inverse kinematics against a URDF model, and sends joint commands to either a hardware controller (ESP32 / Arduino) or a PyBullet simulation. -**Quick Start** -- **Simulation**: enable the simulator in `config.py` by setting `sim = True`, then run: - -```bash -python3 main.py -``` -- **Hardware**: set `sim = False` in `config.py` and choose `arduinoConnection = True` or provide your ESP32 settings. Verify `port`, `baudrate`, `esp32_ip`, and `esp32_port` in `config.py`. - -**Dependencies** +**Setup Dependencies and Virtual Enviroment** - **Python packages**: At minimum the project uses `numpy`, `pygame`, `ikpy`, `pybullet`, `pyserial`, and `matplotlib`. - **Install** (recommended inside a venv): @@ -22,6 +14,14 @@ source .venv/bin/activate pip install numpy pygame ikpy pybullet pyserial matplotlib ``` +**Quick Start** +- **Simulation**: enable the simulator in `config.py` by setting `sim = True`, then run: + +```bash +python3 main.py +``` +- **Hardware**: set `sim = False` in `config.py` and choose `arduinoConnection = True` or provide your ESP32 settings. Verify `port`, `baudrate`, `esp32_ip`, and `esp32_port` in `config.py`. + **Project structure (key files)** - **Entry point**: [main.py](main.py) — starts the controller and state loop. - **Controller**: [Controller.py](Controller.py) — joystick input and `ControlIntent` updates. diff --git a/config.py b/config.py index cd77de2..1c6bf42 100644 --- a/config.py +++ b/config.py @@ -7,7 +7,7 @@ esp32_port = 3323 timeout = 2.0 -sim: bool = False +sim: bool = True arduinoConnection: bool = False urdf_path = "JackBotUrdf.urdf"