main
old code was uploaded in the initial upload changed everything with working programm and updated the readme
JackBot — Hexapod Control & Simulation
JackBot is a Python project for controlling and simulating a six-legged hexapod robot. It uses IKPy for inverse kinematics, PyBullet for optional simulation, and can send joint commands to ESP32 or Arduino hardware.
Requirements
- Python 3.12 recommended on Windows
- Python 3.11 / 3.12 is safest for
pygamecompatibility - Required Python packages:
numpypygameikpypybulletpyserialmatplotlib
Setup
Linux / macOS (Bash)
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip setuptools wheel
pip install numpy pygame ikpy pybullet pyserial matplotlib
Windows (PowerShell)
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip setuptools wheel
pip install numpy pygame ikpy pybullet pyserial matplotlib
If PowerShell blocks activation:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
.\.venv\Scripts\Activate.ps1
Run
From the repository root:
python main.py
or on Linux/macOS:
python3 main.py
Configuration
Edit config.py before running:
sim = Trueto enable PyBullet simulationsim = Falseto use hardware controlarduinoConnection = Trueto use ArduinoarduinoConnection = Falseto use ESP32portandbaudratefor Arduinoesp32_ipandesp32_portfor ESP32urdf_path = "JackBotUrdf.urdf"
Project structure
main.py— main application entry pointController.py— Pygame-based controller and input displaykinematics.py— IKPy forward/inverse kinematicssimulation.py— PyBullet simulation wrapperGlobalVariables.py— shared runtime state and commsDataTypes.py— typed arrays and control intentRobotState/idle.py— idle robot stateRobotState/walking.py— walking robot stateEspCommunication.py— ESP32 communicationArduinoCommunication.py— Arduino communicationJackBotUrdf.urdf— robot model file
Notes
GlobalVariables.pyinitializes eitherSimulation()or the selected hardware comm class.DataTypes.pydeclaresPosArray,DegArray,RadArray,RobotCommand, andControlIntent.Controller.pyupdatesgv.vector_dirmovandgv.robot_statefrom joystick input.kinematics.pyloads leg chains fromJackBotUrdf.urdfand computes IK.
Troubleshooting
- If
pygameinstallation fails on Windows, use Python 3.12 and upgradepip setuptools wheelfirst. - If
pythonis not found on Windows, install Python and enable "Add Python to PATH". - If the program crashes on startup, verify
JackBotUrdf.urdfpath andconfig.pysettings.
Suggested improvements
- Add a
requirements.txtorpyproject.toml. - Add a
LICENSEfile before sharing the project. - Document hardware wiring and packet formats for ESP32/Arduino.
Description
Languages
Python
100%