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://1drv.ms/p/s!Aswo8fN5BKr61klitElDnhZ-JARq

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

Reward = 1 (when the object is picked up)

(Else) If the bot gets close to the object it gets a small positive reward (say 0.001) and if it gets far it gets a negative reward (say -0.001).

Code with Sample Actions

import rover_arm
import gymnasium as 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, terminated, truncated,  info = env.step(action)
    done = terminated or truncated
    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
import gymnasium as gym
import rover_arm.keyboard_control as kc

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, terminated, truncated,  info = env.step(action)
    done = terminated or truncated
    img = env.render()
    # print(img.shape)
    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')

Note: Task2 Env is not upto date, it uses gym style instead of gymnasium, so expect done instead of truncated and terminated.

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.1.8.tar.gz (2.8 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.1.8-py3-none-any.whl (2.8 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rover_arm-1.1.8.tar.gz
  • Upload date:
  • Size: 2.8 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.1.8.tar.gz
Algorithm Hash digest
SHA256 a0e51e7c71c64c519ff0fe5ac8f0444675a78db6f07c75428c8464702446d546
MD5 55818159d9c1492f6648a1dd188eb8cf
BLAKE2b-256 a2127d2eb1fbf671efdf4ecb93692d5d04cf8c4e4101fa9fcd7306c8175f1981

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rover_arm-1.1.8-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.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8a6da70d73af7ba2e64dae6df95a0d39f5497e3d574a98ade5507242a682638e
MD5 44d9db9e8c99aae4258b851415263e51
BLAKE2b-256 fbc3f8c6cedb2f893d4868c0b34f7e3cb37bda11a568657f73d81bde1510cdc3

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