Skip to main content

Framework for training Robotic Manipulators on the Obstacle Avoidance task through Reinforcement Learning.

Project description

robotic_manipulator_rloa

robotic_manipulator_rloa is a framework for training Robotic Manipulators on the Obstacle Avoidance task through Reinforcement Learning.

Installation

Install the package with pip.

$ pip install robotic-manipulator-rloa

For Windows: If the installation is not successful because Microsoft Visual C++ 14.0 or greater is required, download and install the Microsoft C++ Build Tools from here: https://visualstudio.microsoft.com/es/visual-cpp-build-tools/

Usage

Execution of a demo training and testing process for the KUKA IIWA Robotic Manipulator

from robotic_manipulator_rloa import ManipulatorFramework

# Initialize the framework
mf = ManipulatorFramework()

# Run a demo of the training process for the KUKA IIWA Robotic Manipulator
mf.run_demo_training('kuka_training', verbose=False)

# Run a demo of the testing process for the KUKA IIWA Robotic Manipulator
mf.run_demo_testing('kuka_testing')

Execution of a training for the KUKA IIWA Robotic Manipulator

from robotic_manipulator_rloa import ManipulatorFramework

# Initialize the framework
mf = ManipulatorFramework()

# Initialize KUKA IIWA Robotic Manipulator environment
mf.initialize_environment(manipulator_file='kuka_iiwa/kuka_with_gripper2.sdf',
                          endeffector_index=13,
                          fixed_joints=[6, 7, 8, 9, 10, 11, 12, 13],
                          involved_joints=[0, 1, 2, 3, 4, 5],
                          target_position=[0.4, 0.85, 0.71],
                          obstacle_position=[0.45, 0.55, 0.55],
                          initial_joint_positions=[0.9, 0.45, 0, 0, 0, 0],
                          initial_positions_variation_range=[0, 0, 0.5, 0.5, 0.5, 0.5],
                          visualize=False)

# Initialize NAF Agent (checkpoint files will be generated every 100 episodes)
mf.initialize_naf_agent(checkpoint_frequency=100)

# Run training for 3000 episodes, 400 timesteps per episode
mf.run_training(3000, 400, verbose=False)

Execution of a testing process for the KUKA IIWA Robotic Manipulator (must execute a training for 3000 episodes before)

import os
import pybullet_data
from robotic_manipulator_rloa import ManipulatorFramework

# Initialize the framework
mf = ManipulatorFramework()

# Initialize KUKA IIWA Robotic Manipulator environment
kuka_path = os.path.join(pybullet_data.getDataPath(), 'kuka_iiwa/kuka_with_gripper2.sdf')
mf.initialize_environment(manipulator_file=kuka_path,
                          endeffector_index=13,
                          fixed_joints=[6, 7, 8, 9, 10, 11, 12, 13],
                          involved_joints=[0, 1, 2, 3, 4, 5],
                          target_position=[0.4, 0.85, 0.71],
                          obstacle_position=[0.45, 0.55, 0.55],
                          initial_joint_positions=[0.9, 0.45, 0, 0, 0, 0],
                          initial_positions_variation_range=[0, 0, .5, .5, .5, .5],
                          visualize=False)

# Initialize NAF Agent
mf.initialize_naf_agent()

# Load pretrained weights from .p file
mf.load_pretrained_parameters_from_episode(3000)

# Test the pretrained model for 50 test episodes, 750 timesteps each
mf.test_trained_model(50, 750)

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change. Please make sure to update and execute the tests!

robotic_manipulator_rloa$ pytest --cov-report term-missing --cov=robotic_manipulator_rloa/ tests/robotic_manipulator_rloa/

License

MIT License

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

robotic-manipulator-rloa-1.0.0.tar.gz (635.7 kB view details)

Uploaded Source

Built Distribution

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

robotic_manipulator_rloa-1.0.0-py3-none-any.whl (635.8 kB view details)

Uploaded Python 3

File details

Details for the file robotic-manipulator-rloa-1.0.0.tar.gz.

File metadata

  • Download URL: robotic-manipulator-rloa-1.0.0.tar.gz
  • Upload date:
  • Size: 635.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for robotic-manipulator-rloa-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a9a86542321ac65a56d29be99f5d9cb31d79c4f45ad178b4dcf87b448e8708bd
MD5 a5e11cb587e1ff4d83385db57332049b
BLAKE2b-256 f86c348721dc01bfe2ddcfcb767e801073345b7d57de53e0ef20eb4b2dbc4e85

See more details on using hashes here.

File details

Details for the file robotic_manipulator_rloa-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for robotic_manipulator_rloa-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05e28eb24fd8189cd35271f777908c7401e0dcad249b857f2d1f1593e7a7f097
MD5 ae240b60b8ee0b0e772538e8d587a735
BLAKE2b-256 d3c354c31d34241d5a53fa8ae719e7be6b3f6f8699d877dd4e464f77fa15d29b

See more details on using hashes here.

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