Comments (3)
You can infer it the same way from my previous comment:
Task | Position | |
---|---|---|
ee position | PandaPickAndPlace | [0:3] |
PandaStack | [0:3] | |
object position | PandaPickAndPlace | [0:3] |
PandaStack | [7:10] for 1, [19:22] for 2 | |
finger width | PandaPickAndPlace | [6] |
PandaStack | [6] |
from panda-gym.
Hi, @Vidharth
Yes, you can manually control the robot by passing your own action into the step()
method. Here is a simple example:
import gym
import panda_gym
env = gym.make('PandaPickAndPlace-v1')
env.reset()
env.step([1, 0, 0, 0]) # Go FORWARD
env.step([-1, 0, 0, 0]) # Go BACKWARD
env.step([0, 1, 0, 0]) # Go LEFT
env.step([0, -1, 0, 0]) # Go RIGHT
env.step([0, 0, 1, 0]) # Go UP
env.step([0, 0, -1, 0]) # Go DOWN
env.step([0, 0, 0, 1]) # OPEN fingers
env.step([0, 0, 0, -1]) # CLOSE fingers
Another example, where action depends on the observation:
import gym
import panda_gym
env = gym.make('PandaPush-v1')
obs = env.reset()
# Get specific observations
ee_position = obs['observation'][0:3]
object_position = obs['observation'][7:10]
# Choose action according to object position and end-effector position
action = object_position - ee_position # move in the direction of the object
# Step
obs, reward, done, info = env.step(action)
Each envrionment has its own observation and action space. Read the following for more details.
You should be able to adapt this code to do keyboard-control, if that's what you want to do (using the keyboard
module for example).
For PandaReach-v1
:
Observation:
- end-effector position (3 coordinates)
- end-effector velocity (3 coordinates)
Action:
- displacement (3 coordinates)
For PandaPush-v1
and PandaSlide-v1
:
Observation:
- end-effector position (3 coordinates)
- end-effector velocity (3 coordinates)
- object position (3 coordinates)
- object rotation (3 coordinates)
- object linerar velocity (3 coordinates)
- object angular velocity (3 coordinates)
Action:
- displacement (3 coordinates)
For PandaPickAndPlace-v1
:
Observation:
- end-effector position (3 coordinates)
- end-effector velocity (3 coordinates)
- finger width (1 coordinate)
- object position (3 coordinates)
- object rotation (3 coordinates)
- object linerar velocity (3 coordinates)
- object angular velocity (3 coordinates)
Action:
- displacement (3 coordinates)
- displacement of fingers (1 coordinate)
For PandaStack-v1
:
Observation:
- end-effector position (3 coordinates)
- end-effector velocity (3 coordinates)
- finger width (1 coordinate)
- object 1 position (3 coordinates)
- object 1 rotation (3 coordinates)
- object 1 linerar velocity (3 coordinates)
- object 1 angular velocity (3 coordinates)
- object 2 position (3 coordinates)
- object 2 rotation (3 coordinates)
- object 2 linerar velocity (3 coordinates)
- object 2 angular velocity (3 coordinates)
Action:
- displacement (3 coordinates)
- displacement of fingers (1 coordinate)
EDIT: added finger width in PandaStack
from panda-gym.
Hey @qgallouedec,
If the position of the end-effector is positioned in the observation space at positions [0:3] and for the object at positions [7:10] for tasks PandaPush and PandaSlide, where are the ee-position, object position and finger width in PandaPickAndPlace and PandaStack tasks?
from panda-gym.
Related Issues (20)
- When is it panda-gym going to be compatible with python 3.11? HOT 1
- how to realize the sb3 train demo code with panda-gym? HOT 2
- Typo in the `core.py` script HOT 1
- Render screen is out of sync HOT 6
- `NAN` in the training HOT 1
- How to get `predict` data from a saved model? HOT 2
- TypeError: catching classes that do not inherit from BaseException is not allowed HOT 6
- Shape of `achieved_goal` and `desired_goal` HOT 6
- Discussion about the future work HOT 9
- Decreasing Size of Action Space HOT 2
- Compatibility of gym-0.24 branch? HOT 2
- panda-gym v2 error; "TypeError: catching classes that do not inherit from BaseException is not allowed". HOT 2
- Clarification about 'observation', 'achieved_goal' and 'desired_goal' HOT 5
- Flip and Stack question HOT 3
- change the observation and return HOT 1
- reproduce the results HOT 1
- reproduce the results HOT 2
- Set to move in a two-dimensional plane HOT 6
- Clarification about the observation or system state returned by the task class HOT 1
- Can the SAC algorithm without using HER converge in some of the environments in this project?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panda-gym.