Robots that learn to interact with the environment autonomously
Project description
real-robots
Robots that learn to interact with the environment autonomously
Installation
pip install -U real_robots
If everything went well, then you should be able to run :
real-robots-demo
and it should (eventually) open up a small window with a little robotic arm doing random stuff.
Usage
import gym import numpy as np import time import real_robots from real_robots.policy import BasePolicy class RandomPolicy(BasePolicy): def __init__(self, action_space): self.action_space = action_space self.action = action_space.sample() def step(self, observation, reward, done): if np.random.rand() < 0.05: self.action = self.action_space.sample() return self.action env = gym.make("REALRobot2020-R2J3-v0") pi = RandomPolicy(env.action_space) env.render("human") observation = env.reset() reward, done = 0, False for t in range(40): action = pi.step(observation, reward, done) observation, reward, done, info = env.step(action)
Local Evaluation
import gym import numpy as np import real_robots from real_robots.policy import BasePolicy class RandomPolicy(BasePolicy): def __init__(self, action_space): self.action_space = action_space self.action = action_space.sample() def step(self, observation, reward, done): if np.random.rand() < 0.05: self.action = self.action_space.sample() return self.action result, detailed_scores = real_robots.evaluate( RandomPolicy, environment='R1', action_type='macro_action', n_objects=1, intrinsic_timesteps=1e3, extrinsic_timesteps=1e3, extrinsic_trials=3, visualize=False, goals_dataset_path='goals-REAL2020-s2020-50-1.npy.npz' ) # NOTE : You can find goals-REAL2020-s2020-50-1.npy.npz file in the REAL2020 Starter Kit repository # or you can generate one using the real-robots-generate-goals command. # print(result) # {'score_REAL2020': 0.06529471503519801, 'score_total': 0.06529471503519801} print(detailed_scores) # {'REAL2020': [0.00024387094790936833, 0.19553060745741896, 0.00010966670026571288]}
See also our FAQ.
- Free software: MIT license
Features
The REALRobot environment is a standard gym environment.
It includes a 7DoF kuka arm with a 2DoF gripper, a table with 3 objects on it and a camera looking at the table from the top.
For more info on the environment see environment.md.
Authors
- Francesco Mannella
- Emilio Cartoni
- Sharada Mohanty
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
real_robots-0.1.21.tar.gz
(9.1 MB
view hashes)
Built Distribution
Close
Hashes for real_robots-0.1.21-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ead227d8025eced524629c19f6736ec251ec4a163174ac03cf8989efad0717ac |
|
MD5 | 2290f89262f6560cca78b537c51c74f1 |
|
BLAKE2-256 | 23c9a63dbad03debd9289102f1acda1691ff98ae2290b86e2a3fbad7ce0fec2f |