JackM323 1e660fcdb6 Add copy methods, fix state imports, pass lock
Add copy() to PosArray, DegArray and RadArray to allow easy shallow copies. Change RobotState imports in idle.py and walking.py to use explicit 'from RobotState.RobotState import RobotState' to avoid import issues. In main.py create a threading.Lock and pass it into the controller thread args to prepare for synchronized access in controller_loop.
2026-07-29 22:17:28 +02:00
2026-07-29 19:23:45 +02:00
2026-07-29 19:23:45 +02:00
2026-07-29 19:23:45 +02:00
2026-07-29 19:23:45 +02:00
2026-07-29 20:38:30 +02:00
2026-07-29 19:23:45 +02:00
2026-07-29 19:23:45 +02:00
2026-07-29 19:23:45 +02:00
2026-07-29 19:23:45 +02:00
2026-07-29 19:23:45 +02:00
2026-07-29 21:52:19 +02:00
2026-07-29 19:23:45 +02:00

JackBot — Hexapod Control & Simulation

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.

Setup Dependencies and Virtual Enviroment

  • Python packages: At minimum the project uses numpy, pygame, ikpy, pybullet, pyserial, and matplotlib.
  • Install (recommended inside a venv):

Linux / macOS (Bash):

python3 -m venv .venv
source .venv/bin/activate
pip install numpy pygame ikpy pybullet pyserial matplotlib

Windows (PowerShell):

python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install numpy pygame ikpy pybullet pyserial matplotlib

If PowerShell blocks activation, run:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
.\.venv\Scripts\Activate.ps1

Quick Start

  • Simulation: enable the simulator in config.py by setting sim = True, then run:
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)

How it works

  • main.py creates a ControlIntent and RobotContext, starts the controller thread, and runs a state loop. The WalkingState computes per-leg foot paths (Bezier/linear), converts positions to joint angles with kinematics.ikpyInverse(), then sends commands to hardware or updates the simulator.

Configuration notes

  • URDF: the robot description file is JackBotUrdf.urdf; ensure the path in config.py (urdf_path) is correct.
  • Timing: step timing and tick rate are configured in config.py (standard_duration, standard_tickpersec).

Suggested next steps

  • Add a requirements.txt or pyproject.toml for reproducible installs.
  • Document hardware wiring and expected serial/ESP packet formats if you plan to use hardware.
  • Provide an example config.py for common setups (sim vs hardware).

License & Contributing

  • No license file included. Add LICENSE if you want to publish or share.
  • Contributions: open an issue or PR with improvements; add tests for kinematics if possible.
S
Description
Running Hexapod to annoy my cat
Readme 1.7 MiB
Languages
Python 100%