Framework for training Robotic Manipulators on the Obstacle Avoidance task through Reinforcement Learning.
Project description
Framework and Code for the application of Normalized Advantage Function algorithm for Obstacle Avoidance on Robotic Manipulators
Installation of requirements (on virtual environment)
-
Create a virtual environment
$ python3 -m venv venv
-
Activate the virtual environment
$ source venv/bin/activate
-
Install required packages
$ python -m pip install -r requirements.txt
Execution of preloaded trainings
There are two preloaded trainings in the framework, which can be used to test its functionality or the work done in the project. The trainings correspond to the robotic manipulators KUKA LBR iiwa and xArm6, as stated in the report. The code neccessary to launch these training is located in the bottom of the framework.py file, commented.
There are 4 sections commented, with the following titles:
- CODE FOR KUKA IIWA ROBOT
- TESTING CODE FOR KUKA IIWA ROBOT
- CODE FOR XARM6 ROBOT
- TESTING CODE FOR XARM6 ROBOT
Sections 1 and 3 can be used to launch a training with the manipulator robot mentioned in the title Sections 2 and 4 can be used to test the previous trainings, for the manipulators mentioned in the title.
It is important to note that ONLY the section that is required to be executed can be uncommented to ensure a controlled execution of the framework. It is also worth noting that the code related to the execution of the training and testing expects to be running for 3000 episodes, with 400 timesteps per episode. If either the number of episodes or the number of timesteps change, so must change the testing code related to that training, as the testing code will load the trained model from episode 3000. This means that, if the training is executed for less than 3000 episodes, the test will not find the required model, and that if more than 3000 episodes are executed, the test will only show the behaviour of the model trained until 3000 episodes.
Execution of customized training
-
Initialize the framework
$ framework = ManipulatorFramework()
-
Initialize environment
$ framework.initialize_environment(manipulator_file=<path_to_sdf_urdf_file>>, endeffector_index=<endeffector_index>, fixed_joints=<list_of_indices_of_joints_to_fix>, involved_joints=<list_of_indices_of_joints_to_involve>, target_position=<target_pos_as_3d_array>, obstacle_position=<obstacle_pos_as_3d_array>, initial_joint_positions=<list_of_initial_pos_for_each_joint>, initial_positions_variation_range=<list_of_variation_range_for_each_joint>, visualize=<bool>)
-
Initialize NAF Agent
$ framework.initialize_naf_agent()
-
Run Training
$ framework.run_training(n_episodes, n_timesteps)
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
Hashes for robotic-manipulator-rloa-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a65d8a40f63d57e58c6e45a1f5f2d1ef97dcc64417edbbd1db650ea2ee84a49 |
|
MD5 | 2136264dbaab4d4208f3ef346e95ee49 |
|
BLAKE2b-256 | 6d92ffd97a5fd6c4c2a1752eb13f629a545bbf582bab79f6dfcac18bdfe9fb3a |
Hashes for robotic_manipulator_rloa-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd7abccfc36ebf6ea5390942c35b508ce7a7847d8209fdaef933937e6df0498f |
|
MD5 | ba290f3ad275a4742418b9dfa6280bf1 |
|
BLAKE2b-256 | bd5a32809bc604f96717a936db363da6068a41f246a9315e0955d77d3c74118e |