This repository includes the code to simulate the Hexapod. It includes code to visualize and interact with the robot in Viser and code to simulate it in a PyBullet environment.
![]() |
![]() |
![]() |
![]() |
For a complete overview of the project, refer to the main Hexapod repository.
Before you start, ensure mamba is properly installed on the machine you are using for the simulation.
-
Clone the repository:
git clone --recursive https://github.com/ggldnl/Hexapod-Simulation.git
The Hexapod-Controller and Hexapod-Hardware repositories are configured as submodules and are automatically downloaded. If for some reason you need to update the submodules in the future:
# Update the submodules if something changes in the future git submodule update --recursive --remote -
Create a mamba environment:
cd Hexapod-Simulation mamba env create -f environment.yml mamba activate hexapod-simThe Hexapod-Controller code will be automatically installed as a package. After this, from within the
hexapod-simmamba environment, you will be able to do something like this:from controller import HexapodController
-
viser/main.pywill open a Viser-based Hexapod demo, showing the Hexapod moving forward and performing some adjustments along the way (body height, yaw, speed, ...).python simulation/viser/main.py
-
bullet/main.pywill open a PyBullet Hexapod simulation, showing how the robot behaves when physics is involved. I used the actual stall torque the servos are rated for to simulate the motors.python simulation/bullet/main.py
Feel free to contribute by opening issues or submitting pull requests. For further information, check out the main Hexapod repository. Give a ⭐️ to this project if you liked the content.



