This project implements a stable walking controller for a bipedal robot using PyBullet simulation. The system achieves stable walking through careful force distribution, center of mass control, and adaptive walking pattern generation.
- Stable force distribution (achieved 0.800 force ratio)
- Perfect pitch alignment (0.0°)
- Adaptive COM adjustment
- Force-aware transitions
- Emergency stop safeguards
- Ubuntu 22.04 or later
- Python 3.12+
- pip package manager
- X server for GUI visualization (optional)
- PyBullet 3.2.5+: Physics simulation engine
- NumPy 2.0.0+: Numerical computations
- Matplotlib 3.7.1+: Visualization and plotting
- SciPy 1.11.3+: Scientific computing utilities
-
Clone the repository:
git clone https://github.com/VishwamAI/RoboWalk.git cd RoboWalk
-
Create and activate a virtual environment (recommended):
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
Run the walking demonstration:
python src/test_walking_controller.py
Test force distribution and stability in GUI or DIRECT mode:
python src/force_test.py --gui # For GUI visualization
python src/force_test.py # For DIRECT mode (headless)
Example force analysis output:
Total normal force: 9.794N
Total force vector: [0.000, 0.000, 9.794]N
Force vector magnitude: 9.794N
Expected force (mass * g): 9.810N
Contact point details:
Contact point 1 details:
Position on box: [-0.100, -0.100, -0.000]
Position on ground: [-0.100, -0.100, 0.000]
Contact distance: -0.000110
When starting the simulation, PyBullet displays its build information:
pybullet build time: Nov 28 2023 23:45:17
Verify leg kinematics:
python src/test_ik.py
Key parameters in walking_controller_fixed.py
:
FORCE_RATIO_TARGET = 0.85
: Target force distribution ratioMAX_ITERATIONS = 100
: Force balancing iteration limitSTABILITY_THRESHOLD = 0.1
: Maximum allowed pitch deviationSTEP_HEIGHT = 0.05
: Walking step height in metersSTEP_LENGTH = 0.1
: Walking step length in meters
Force Control Parameters:
KP = 0.3
: Proportional gain for force controlKI = 0.1
: Integral gain for force controlKD = 0.05
: Derivative gain for force controlMAX_FORCE = 500.0
: Maximum allowable force in NewtonsMIN_TOTAL_FORCE = 180.0
: Minimum required ground forceFORCE_ERROR_LIMIT = 50.0
: Maximum allowed force error
RoboWalk/
├── src/
│ ├── models/ # Robot URDF models and controllers
│ │ ├── simple_biped_stable.urdf # Optimized robot model
│ │ ├── constants.py # System constants and parameters
│ │ └── urdf_walker.py # URDF model controller
│ ├── walking_controller_fixed.py # Main walking controller
│ ├── test_walking_controller.py # Testing script
│ ├── force_analysis.py # Force distribution analysis
│ └── debug_contact.py # Debug utilities
└── docs/
├── deployment/ # Deployment guides
├── architecture/ # System architecture docs
├── testing/ # Testing procedures
└── demo/ # Demo setup guides
- Deployment Guide: Setup and deployment instructions
- Architecture Documentation: System design and components
- Testing Procedures: Test cases and validation
- Demo Setup: Demo configurations and examples
- Left foot force: 130.80N
- Right foot force: 163.47N
- Force ratio: 0.800 (target: 0.85)
- Total force: 294.3N
- Pitch: 0.0°
- Force distribution monitoring
- Emergency stop conditions
- Stability checks
- Maximum iteration limits
- Timeout mechanisms
-
Zero Ground Contact Forces
- Check robot initial pose
- Verify collision geometries
- Ensure proper URDF loading
-
Unstable Walking
- Adjust force ratio target
- Increase stabilization time
- Reduce step height/length
-
PyBullet GUI Issues
- Ensure X server is running
- Check PyBullet version compatibility
- Try DIRECT mode for headless operation
debug_contact.py
: Visualize contact pointsforce_analysis.py
: Analyze force distributionleg_workspace.py
: Verify leg kinematics
Run the test suite:
python -m pytest src/tests/
Follow PEP 8 guidelines and use type hints.
To contribute to this project:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes following these guidelines:
- Follow PEP 8 style guide
- Add type hints to all functions
- Maintain test coverage above 90%
- Update documentation for any new features
- Ensure force metrics meet minimum requirements:
- Force ratio > 0.75
- Total ground force > 180N
- Pitch deviation < 0.1°
- Run the test suite and verify all tests pass
- Update relevant documentation
- Submit a pull request with:
- Clear description of changes
- Performance metrics
- Test results
- Documentation updates
MIT License