Skip to main content

A modular navigation system for robot navigation in OmniGibson environments.

Project description

OG Nav - Modular Navigation System

Python PyPI License: MIT OmniGibson

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 framework
  • torch - Deep learning framework (used for tensor operations)
  • numpy - Numerical computing
  • opencv-python - Computer vision and image processing
  • matplotlib - Plotting and visualization
  • pyyaml - 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:

  1. Constructor Arguments - Highest priority
  2. YAML Configuration - Medium priority
  3. 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

๐Ÿค Contributing

We welcome contributions! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes following the existing code style
  4. Add tests if applicable
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. 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

๐Ÿ”— Links


Built with โค๏ธ for the robotics community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

og_nav-0.1.1.dev0.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

og_nav-0.1.1.dev0-py3-none-any.whl (482.8 kB view details)

Uploaded Python 3

File details

Details for the file og_nav-0.1.1.dev0.tar.gz.

File metadata

  • Download URL: og_nav-0.1.1.dev0.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for og_nav-0.1.1.dev0.tar.gz
Algorithm Hash digest
SHA256 caf6202588fad1ff731bbd877b3ce3d7ba9cd750cc55bdf332359cc1c1fbe456
MD5 e4bbc80419e38a92d2af5f242beef8f4
BLAKE2b-256 f5cc1f43e90e1f6478b6d3069059c99513e7270115364f631c13fa9c157979e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for og_nav-0.1.1.dev0.tar.gz:

Publisher: publish-to-pypi.yml on Gonglitian/og_nav

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file og_nav-0.1.1.dev0-py3-none-any.whl.

File metadata

  • Download URL: og_nav-0.1.1.dev0-py3-none-any.whl
  • Upload date:
  • Size: 482.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for og_nav-0.1.1.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac67678edb0e023bc7a9415e46c48228347265ee8656b4e39cd0f5912e58593a
MD5 6f65345303d9890157f6b3b089979b82
BLAKE2b-256 e9085ce32150ae3bcc4519849c68ffa7a69416fae4437299129c6efb937a648e

See more details on using hashes here.

Provenance

The following attestation bundles were made for og_nav-0.1.1.dev0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on Gonglitian/og_nav

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page