c34449aac565c5fafb80eeb56ecadafa2870e9ca
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.
Quick Start
- Simulation: enable the simulator in
config.pyby settingsim = True, then run:
python3 main.py
- Hardware: set
sim = Falseinconfig.pyand choosearduinoConnection = Trueor provide your ESP32 settings. Verifyport,baudrate,esp32_ip, andesp32_portinconfig.py.
Dependencies
- Python packages: At minimum the project uses
numpy,pygame,ikpy,pybullet,pyserial, andmatplotlib. - Install (recommended inside a venv):
python3 -m venv .venv
source .venv/bin/activate
pip install numpy pygame ikpy pybullet pyserial matplotlib
Project structure (key files)
- Entry point: main.py — starts the controller and state loop.
- Controller: Controller.py — joystick input and
ControlIntentupdates. - Kinematics: kinematics.py — URDF-based forward/inverse kinematics using IKPy.
- Simulation: simulation.py — PyBullet visualization and joint control.
- Hardware comms: EspCommunication.py and ArduinoCommunication.py — send commands to ESP32 or Arduino.
- Runtime globals: GlobalVariables.py — central runtime objects and flags.
- Types: DataTypes.py —
PosArray,DegArray,RadArray,ControlIntent. - States: RobotState/idle.py and RobotState/walking.py — state machine implementations.
- Config: config.py — ports, flags (
sim,arduinoConnection), URDF path, timing values.
How it works
main.pycreates aControlIntentandRobotContext, starts the controller thread, and runs a state loop. TheWalkingStatecomputes per-leg foot paths (Bezier/linear), converts positions to joint angles withkinematics.ikpyInverse(), then sends commands to hardware or updates the simulator.
Configuration notes
- URDF: the robot description file is
JackBotUrdf.urdf; ensure the path inconfig.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.txtorpyproject.tomlfor reproducible installs. - Document hardware wiring and expected serial/ESP packet formats if you plan to use hardware.
- Provide an example
config.pyfor common setups (sim vs hardware).
License & Contributing
- No license file included. Add
LICENSEif you want to publish or share. - Contributions: open an issue or PR with improvements; add tests for kinematics if possible.
Description
Languages
Python
100%