Skip to main content

RNL: Robot Navigation Learning Framework

PyPI CI

End-to-end Deep Reinforcement Learning for Real-World Robotics Navigation in PyTorch

Overview

RNL (Robot Navigation Learning) is a comprehensive framework for training autonomous robots to navigate in unknown environments using Deep Reinforcement Learning (DRL). The framework provides a complete pipeline from environment simulation to model deployment, with support for both training and inference phases.

Demo

RNL Framework Demo

Key Features

  • 3D environment
  • Wandb integration
  • LIDAR simulation
  • Robot parameters
  • Differential drive
  • Physics simulation
  • Dynamic maps
  • LLM integration

Installation

Prerequisites

  • Python 3.10+
  • PyTorch 2.5.1+
  • CUDA (optional, for GPU acceleration)

Install from PyPI

pip install rnl

Quick Start

1. Basic Training Example

import numpy as np
import rnl as vault

# Configure robot parameters
robot_config = vault.robot(
    base_radius=0.105,        # Robot radius in meters
    max_vel_linear=0.22,      # Maximum linear velocity
    max_vel_angular=2.84,     # Maximum angular velocity
    wheel_distance=0.16,      # Distance between wheels
    weight=1.0,               # Robot weight in kg
    threshold=1.0,            # Obstacle detection threshold
    collision=0.5,            # Collision radius
    path_model="None"         # Path to pretrained model
)

# Configure LIDAR sensor
sensor_config = vault.sensor(
    fov=2 * np.pi,           # Field of view (360 degrees)
    num_rays=20,             # Number of LIDAR rays
    min_range=0.0,           # Minimum detection range
    max_range=6.0            # Maximum detection range
)

# Configure environment
env_config = vault.make(
    scale=100,               # Environment scale
    folder_map="None",       # Custom map folder
    name_map="None",         # Custom map name
    max_timestep=10000       # Maximum episode length
)

# Configure rendering
render_config = vault.render(
    controller=False,       # Disable manual control (set True to control robot with arrow keys)
    debug=True,             # Enable debug visualization
    plot=False              # Disable plotting
)

# Initialize trainer
trainer = vault.Trainer(robot_config, sensor_config, env_config, render_config)

# Start training
trainer.learn(
    max_timestep_global=3000000,  # Total training steps
    seed=1,                       # Random seed
    batch_size=1024,             # Training batch size
    hidden_size=128,             # Neural network hidden size
    num_envs=4,                  # Parallel environments
    device="cuda",               # Training device
    checkpoint=10000,            # Checkpoint frequency
    use_wandb=True,             # Enable Wandb logging
    lr=0.0003,                  # Learning rate
    learn_step=512,             # Learning step size
    gae_lambda=0.95,            # GAE lambda parameter
    ent_coef=0.0,               # Entropy coefficient
    vf_coef=0.5,                # Value function coefficient
    max_grad_norm=0.5,          # Gradient clipping
    update_epochs=10,           # Update epochs
    name="navigation_model"      # Model name wandb
)

2. Inference Example

import rnl as vault

# Use same configuration as training
# ... (robot_config, sensor_config, env_config, render_config)

# Initialize simulation
simulation = vault.Simulation(robot_config, sensor_config, env_config, render_config)

# Run inference
simulation.run()

3. Demo Mode

python main.py -m sim

Advanced Features

LLM Integration

The framework supports Large Language Model integration for automated reward engineering:

trainer.learn(
    use_llm=True,
    llm_api_key="your_api_key",
    population=2,
    loop_feedback=10,
    description_task="reach the goal while avoiding obstacles efficiently"
)

Parallel Training

The framework supports multi-environment parallel training for faster convergence:

trainer.learn(
    num_envs=8,              # Number of parallel environments
    device="cuda",           # Use GPU acceleration
    batch_size=2048          # Larger batch size for parallel training
)

Troubleshooting

Common Issues

  1. CUDA Out of Memory

    • Reduce batch_size or num_envs
    • Use smaller hidden_size
  2. Slow Training

    • Increase num_envs for parallel training
    • Use GPU acceleration
    • Optimize learn_step parameter
  3. Unstable Training

    • Adjust learning rate (lr)
    • Increase update_epochs

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Metadata

Release files for rnl 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rnl 1.1.1
File Size Uploaded Provenance Actions
rnl-1.1.1.tar.gz 3.4 MB Without provenance Details for rnl-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rnl 1.1.1
File Interpreter ABI Platform Actions
rnl-1.1.1-py3-none-any.whl Python 3 none any Details for rnl-1.1.1-py3-none-any.whl

Total release size: 3.5 MB

Release files / rnl-1.1.1.tar.gz

Download URL rnl-1.1.1.tar.gz
Size 3.4 MB
Tags Source
SHA-256 checksum
How to use checksums
0049e6ae26f98ccdbf9a4cf06f00dc82a9263bee45ceb1f2894eb3f0ff358a27
BLAKE2b-256 checksum
How to use checksums
9a7b3ae1d0c945b9019d8f33c42dc2ed4ac91e92e8a69f10854289ec38eb7dfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.13

Release files / rnl-1.1.1-py3-none-any.whl

Download URL rnl-1.1.1-py3-none-any.whl
Size 44.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd18845bf691645b82e2f614b040adc38b601c4add77c54f25a06d30292ae520
BLAKE2b-256 checksum
How to use checksums
5b9ec3aecf096477fee503ba48cc4a1d1abe4d5f65ec6e1243e482f17fd764f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.13

Security for rnl 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page