Skip to main content

A OpenAI Gym Env for Rover with Arm

Project description

A OpenAI Gym Env for Rover with Arm

Project Overview

https://docs.google.com/presentation/d/1NnCJ13qy9eBprIPJsYDFgFuNXPIBvIbRBtx6BVz_si8/edit#slide=id.p3

Task1 - Move the cart near the table and pick up the object in the tray

Reward = 1 (when the object is picked up)

Reward = 0 (else)

Code with Sample Actions

import rover_arm
import gym
env = gym.make('rover-arm-pick-v0', render_mode = 'rgb_array')

observation = env.reset()
done = False

while not done:
    action = env.action_space.sample()
    observation, reward, done, info = env.step(action)
    img = env.render()
    # print(img.shape)
    print(action, observation, reward)
    
print(reward, done, info)

You can try to explore the environment and action space by controlling the bot using Keyboard.

You will have to install the dev version in local, and give keyboard access to terminal or IDE where code is being executed. To install in dev version you could do


pip install 'rover-arm[dev]'

Keyboard Controls

Rover

Up, Down, Left, Right Arrows to steer the Rover.

Arm

A, D -> Move the end-effector in X-axis

W, S -> Move the end-effector in Y-axis

Q, E -> Move the end-effector in Z-axis

-, + -> Open / Close the fingers of the robot arm

Note: W, S are also hot keys to adjust view in pybullet env (so ignore the changes or press again to undo the change.)

Code to control the bot using keyboard in human mode (needs to be run in local)

import rover_arm.keyboard_control as kc

import rover_arm
import gym
env = gym.make('rover-arm-pick-v0', render_mode = 'human')

keyboard_controller = kc.KeyboardAction()
keyboard_controller.start_listening()

observation = env.reset()
done = False

while not done:
    action = keyboard_controller.action
    observation, reward, done, info = env.step(action)
    # print(action, observation, reward)
# print(reward, done, info)

Task2: Pick the object from the closer tray and place it on the distant tray

Use the env "rover-arm-place-v0" for task2


env = gym.make('rover-arm-place-v0')

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

rover_arm-1.0.11.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

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

rover_arm-1.0.11-py3-none-any.whl (2.8 MB view details)

Uploaded Python 3

File details

Details for the file rover_arm-1.0.11.tar.gz.

File metadata

  • Download URL: rover_arm-1.0.11.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for rover_arm-1.0.11.tar.gz
Algorithm Hash digest
SHA256 475fff8a5de9bdd5df7ba8bca422668e4339b54e1ab0f79f11c720bd05a6ce8d
MD5 b55b8b3f2b2a00e00649f336f88e5fa1
BLAKE2b-256 7c4814fa2f47d82112db87a023ae0b84d663b38eb64673cfd509ff021bf6fe4c

See more details on using hashes here.

File details

Details for the file rover_arm-1.0.11-py3-none-any.whl.

File metadata

  • Download URL: rover_arm-1.0.11-py3-none-any.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for rover_arm-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 900f0a9661b161d0deeb18456051d30f985ee413c8dda2f40d538d2bed74f262
MD5 f19104a26f373fb86d6150353488d247
BLAKE2b-256 8e54bb36e64112694b078a739b827710e1ea4c1845cc87944e2b80540ca1942b

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