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
Release files for real-robots 0.1.21
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| real_robots-0.1.21.tar.gz | 9.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| real_robots-0.1.21-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 27.2 MB
Release files / real_robots-0.1.21.tar.gz
| Download URL | real_robots-0.1.21.tar.gz |
|---|---|
| Size | 9.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e94526bcb70a23e53ca85f3686744356029c0a6ff8c226d9a76d8d59e81bec9
|
|
BLAKE2b-256 checksum How to use checksums |
4ed05d04f339d4d8b6602be5396bf5f074cc6fdb7b5688fd8603f1924bf13312
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9
|
Release files / real_robots-0.1.21-py2.py3-none-any.whl
| Download URL | real_robots-0.1.21-py2.py3-none-any.whl |
|---|---|
| Size | 18.2 MB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
ead227d8025eced524629c19f6736ec251ec4a163174ac03cf8989efad0717ac
|
|
BLAKE2b-256 checksum How to use checksums |
23c9a63dbad03debd9289102f1acda1691ff98ae2290b86e2a3fbad7ce0fec2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9
|