Skip to main content

RNL - Robot Navigation Learning

Project description

Robot Navigation Learning

MicroVault

Documentation Status PyPI codecov CI

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

This project uses Deep Reinforcement Learning (DRL) to train a robot to move in unfamiliar environments. The robot learns to make decisions on its own, interacting with the environment, and gradually becomes better and more efficient at navigation.

How to Use

Installation and usage mode.

  • Install with pip:
pip install rnl
  • Use train:
import numpy as np
import rnl as vault

# 1.step -> config robot
param_robot = vault.robot(
    base_radius=0.033,  # (m)
    vel_linear=[0.0, 2.0],  # [min, max]
    val_angular=[1.0, 2.0],  # [min, max]
    wheel_distance=0.16,  # (cm)
    weight=1.0,  # robot (kg)
    threshold=0.01,  # distance for obstacle avoidance (cm)
)

# 2.step -> config sensors [for now only lidar sensor!!]
param_sensor = vault.sensor(
    fov=4 * np.pi,
    num_rays=20,
    min_range=0.0,
    max_range=6.0,
)

# 3.step -> config env
param_env = vault.make(
    map_file="None", # map file yaml (Coming soon)
    random_mode="normal",  # hard or normal (Coming soon)
    timestep=1000,  # max timestep
    grid_dimension=5,  # size grid
    friction=0.4,  # grid friction
    porcentage_obstacles=0.1
)

# 4.step -> config train robot
model = vault.Trainer(
    param_robot, param_sensor, param_env, pretrained_model=False
)

# 5.step -> train robot
model.learn(
    batch_size=64,
    lr=0.0001,
    seed=1,
    num_envs=2,
    device="cpu",
    target_score=200,
    checkpoint=100,
    checkpoint_path="checkpoints",
    hidden_size=[800, 600],
)
  • Use inference:
import numpy as np
import rnl as vault

# 1.step -> config robot
param_robot = vault.robot(
    base_radius=0.033,  # (m)
    vel_linear=[0.0, 2.0],  # [min, max]
    val_angular=[1.0, 2.0],  # [min, max]
    wheel_distance=0.16,  # (cm)
    weight=1.0,  # robot (kg)
    threshold=0.01,  # distance for obstacle avoidance (cm)
)

# 2.step -> config sensors [for now only lidar sensor!!]
param_sensor = vault.sensor(
    fov=4 * np.pi,
    num_rays=20,
    min_range=0.0,
    max_range=6.0,
)

# 3.step -> config env
param_env = vault.make(
    map_file="None", # map file yaml (Coming soon)
    random_mode="normal",  # hard or normal (Coming soon)
    timestep=1000,  # max timestep
    grid_dimension=5,  # size grid
    friction=0.4,  # grid friction
    porcentage_obstacles=0.1
)

# 4.step -> config render
param_render = vault.render(fps=100, controller=True, rgb_array=True)


# 5.step -> config train robot
model = vault.Trainer(
    param_robot, param_sensor, param_env, pretrained_model=False
)

# 6.step -> run robot
model.run()
  • Use demo:
python train.py

License

This project is licensed under the MIT license - see archive LICENSE for details.

Contact and Contribution

The project is still under development and may have some bugs. If you encounter any problems or have suggestions, feel free to open an issue or send an email to: Nicolas Alan - grottimeireles@gmail.com.

TODO:

  • Add map file yaml
  • Add random mode (hard or normal)
  • Create Integration ROS and (Gazebo, webots)
  • Create Integration with OpenAI o1-preview

Acknowledgments

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

rnl-0.3.2.tar.gz (55.3 kB view details)

Uploaded Source

Built Distribution

rnl-0.3.2-py3-none-any.whl (63.4 kB view details)

Uploaded Python 3

File details

Details for the file rnl-0.3.2.tar.gz.

File metadata

  • Download URL: rnl-0.3.2.tar.gz
  • Upload date:
  • Size: 55.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/23.5.0

File hashes

Hashes for rnl-0.3.2.tar.gz
Algorithm Hash digest
SHA256 2a710e6e83098a312538906dac628706d1720aa518aa9a8bb2a52559bcaa96fc
MD5 5ef31d86e8049e69f4deebd9e5f6a340
BLAKE2b-256 e3226aa235249d4c9bc97f61595cd36df57b061d86da42625b56029e03598ee9

See more details on using hashes here.

File details

Details for the file rnl-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: rnl-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 63.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/23.5.0

File hashes

Hashes for rnl-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 696bc9c37dba6d1fadfd13e1e3e29bba17501d1a23c617d1fd10948d5d8f73f8
MD5 9e060f2c385343c9e89b288ba7e37876
BLAKE2b-256 f5679c163d60810f9fd0a050d50f6642652c7aad22997c2777d1b97f55967c42

See more details on using hashes here.

Supported by

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