A modular navigation system for robot navigation in OmniGibson environments.
Project description
OG Nav - Modular Navigation System
A comprehensive, modular navigation system designed for robot navigation in OmniGibson environments. This package provides a clean, well-structured interface for path planning, robot control, occupancy grid mapping, and visualization.
๐ Features
๐งญ Unified Navigation Interface
- Clean, intuitive API for seamless robot navigation
- Automatic path planning and goal tracking
- Real-time navigation state management
- Interactive keyboard controls for manual path planning
๐บ๏ธ Advanced Path Planning
- Integration with OmniGibson's built-in path planning
- Point availability validation and collision checking
- Visual waypoint markers with interactive controls
- Automatic nearest available point finding
๐ฎ Sophisticated Control Systems
- Pure Pursuit Algorithm: Advanced path following with configurable lookahead
- PID Controllers: Precise velocity and heading control
- Dynamic Action Management: Automatic action tensor generation for Tiago robot
- Support for both base movement and arm pose management
๐บ๏ธ Occupancy Grid Mapping
- Real-time occupancy grid generation using OmniGibson
- Configurable map resolution and update strategies
- Automatic robot occlusion handling for accurate mapping
- Export capabilities for various map formats
๐จ Rich Visualization
- Interactive 3D markers for start/goal/waypoints
- Real-time path visualization in OmniGibson viewer
- Keyboard shortcuts for intuitive navigation control
- Customizable marker colors and sizes
โ๏ธ Flexible Configuration System
- YAML-based configuration with intelligent defaults
- Module-specific configurations with override hierarchy
- Constructor arguments > YAML config > Module defaults
- Automatic visualization marker generation
๐ ๏ธ Installation
Prerequisites
- Python 3.8 or higher
- OmniGibson (latest version)
- NVIDIA GPU with CUDA support (recommended)
Install from PyPI (Recommended)
pip install og_nav
Development Installation
# Clone the repository
git clone https://github.com/Gonglitian/og_nav.git
cd og_nav
# Install in development mode
pip install -e .
Dependencies
The package automatically installs the following dependencies:
omnigibson- Physics simulation and robotics frameworktorch- Deep learning framework (used for tensor operations)numpy- Numerical computingopencv-python- Computer vision and image processingmatplotlib- Plotting and visualizationpyyaml- YAML configuration file support
๐ Quick Start
Basic Navigation Example
import omnigibson as og
from og_nav import NavigationInterface
from og_nav.core.config_loader import NavigationConfig
# Create environment
config_path = "og_nav/configs/navigation_config.yaml"
nav_config = NavigationConfig(config_path=config_path)
env = og.Environment(configs=nav_config.get_omnigibson_config())
robot = env.robots[0]
# Initialize navigation system
navigator = NavigationInterface(env, robot, nav_config.og_nav_config)
# Set navigation goal
navigator.set_goal((2.0, 3.0)) # Move to position (2.0, 3.0)
# Main navigation loop
while not navigator.is_arrived():
navigator.update()
env.step([])
print("๐ Navigation completed!")
Advanced Usage with Custom Configuration
from og_nav import NavigationInterface, NavigationConfig
from og_nav.planning import PathPlanner
from og_nav.control import PathTrackingController
from og_nav.mapping import OGMGenerator
# Custom configuration
custom_config = {
'controller': {
'lookahead_distance': 0.8,
'cruise_speed': 0.7,
'max_angular_vel': 0.3
},
'ogm': {
'resolution': 0.05
},
'visualization': {
'enable': True,
'n_waypoints': 100
}
}
# Initialize with custom config
navigator = NavigationInterface(env, robot, custom_config)
# Use individual components
planner = PathPlanner(env, robot, config=custom_config.get('planning', {}))
controller = PathTrackingController(robot, config=custom_config['controller'])
mapper = OGMGenerator(config=custom_config['ogm'])
๐ฏ Interactive Controls
When running with visualization enabled, use these keyboard shortcuts in the OmniGibson viewer:
- Z - Set start point at camera position
- X - Set goal point at camera position
- V - Plan path between start and goal
- C - Clear all waypoints and markers
๐ Project Structure
og_nav/
โโโ __init__.py # Main package interface
โโโ core/ # Core navigation components
โ โโโ navigation.py # Main NavigationInterface class
โ โโโ config_loader.py # Unified configuration management
โ โโโ constants.py # System constants
โโโ planning/ # Path planning algorithms
โ โโโ path_planning.py # PathPlanner with OmniGibson integration
โ โโโ utils.py # Planning utilities
โโโ control/ # Robot control systems
โ โโโ controllers.py # Pure Pursuit and PID controllers
โ โโโ control_utils.py # Joint and action management utilities
โโโ mapping/ # Occupancy grid mapping
โ โโโ occupancy_grid.py # OGMGenerator for real-time mapping
โโโ demos/ # Example demonstrations
โ โโโ navigation_demo.py # Complete navigation demo
โโโ configs/ # Configuration files
โ โโโ navigation_config.yaml # Main navigation configuration
โ โโโ config.example.yaml # Example configuration template
โโโ ogm_cv2_window/ # OpenCV visualization tools
โ โโโ ui.py # Interactive UI components
โโโ assets/ # Documentation and resources
โโโ *.png # Example images
โโโ *.md # Technical documentation
โ๏ธ Configuration
YAML Configuration Structure
og_nav:
# Occupancy Grid Mapping
ogm:
resolution: 0.1 # Map resolution in meters
# Path Planning
planning:
# Algorithm-specific parameters
# Path Tracking Controller
controller:
lookahead_distance: 0.5 # Pure pursuit lookahead (m)
cruise_speed: 0.5 # Forward speed (m/s)
max_angular_vel: 0.2 # Max rotation speed (rad/s)
waypoint_threshold: 0.2 # Arrival threshold (m)
# Robot Configuration
robot:
nav_arm_pose: [1.5, 1.5, 0, 2.3, 0, -1.4, 0] # Arm pose during navigation
# Visualization
visualization:
enable: true
n_waypoints: 50 # Number of waypoint markers
start_marker_color: [0, 1, 0, 1] # Green
goal_marker_color: [1, 0, 0, 1] # Red
waypoint_color: [0, 0, 1, 1] # Blue
# Standard OmniGibson configuration
scene:
type: InteractiveTraversableScene
scene_model: Pomaria_1_int
robots:
- type: Tiago
position: [-2, -0.3, 0]
# ... robot configuration
Configuration Priority
The system follows a clear configuration priority hierarchy:
- Constructor Arguments - Highest priority
- YAML Configuration - Medium priority
- Module Defaults - Fallback defaults
๐ค Robot Support
Currently optimized for Tiago robot with:
- Differential drive base control
- Dual-arm manipulation capabilities
- Automatic arm pose management during navigation
- Base action tensor management (indices 0-2 for x, y, rotation)
Support for additional robots can be added by extending the base controller classes.
๐งช Running Demos
Explore the package capabilities with included demonstrations:
# Basic navigation demo with sequential goal visiting
python -m og_nav.demos.navigation_demo
# Test configuration system
python -c "from og_nav.core.config_loader import NavigationConfig; print('Config system working!')"
# Test with custom YAML config
python -c "from og_nav.core.config_loader import NavigationConfig; config = NavigationConfig(config_path='og_nav/configs/navigation_config.yaml'); print('YAML config loaded successfully!')"
๐๏ธ Development
Code Architecture Philosophy
- Modular Design: Clean separation between planning, control, mapping, and visualization
- Configuration-Driven: All behavior configurable through YAML files or code
- Extensible: Easy to add new planners, controllers, or robot types
- Type-Safe: Comprehensive type hints throughout the codebase
- Well-Documented: Detailed docstrings and inline documentation
Adding New Components
To add a new path planner:
from og_nav.planning.path_planning import PathPlanner
class MyCustomPlanner(PathPlanner):
@staticmethod
def get_default_cfg():
return {
'algorithm': 'my_algorithm',
'param1': 1.0,
'param2': True
}
def __init__(self, env, robot=None, config=None):
super().__init__(env, robot, config)
# Your custom initialization
def plan_path(self):
# Your custom planning logic
pass
Testing
# Run configuration tests
python -c "from og_nav.core.config_loader import NavigationConfig; NavigationConfig().test_config_system()"
# Run demo to test complete pipeline
python -m og_nav.demos.navigation_demo
๐ Documentation
- CLAUDE.md - Comprehensive architecture documentation for AI development
- og_nav/README.md - Package-specific technical documentation
- og_nav/assets/ - Technical analysis and robot documentation
๐ค Contributing
We welcome contributions! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes following the existing code style
- Add tests if applicable
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Code Standards
- Type Hints: All public functions must include type annotations
- Docstrings: Comprehensive documentation for all public APIs
- Configuration: All behavior should be configurable
- Error Handling: Robust error handling with informative messages
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- OmniGibson - Physics simulation framework
- Stanford Vision and Learning Lab - OmniGibson development team
- PyTorch - Deep learning framework used for tensor operations
๐ Links
- Homepage: https://github.com/Gonglitian/og_nav
- Documentation: og_nav/README.md
- Issues: https://github.com/Gonglitian/og_nav/issues
- OmniGibson: https://github.com/StanfordVL/OmniGibson
Built with โค๏ธ for the robotics community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters