Comments (9)
Hey,
hmm I woudn't have expected f
to be 3-dimensional in this example. There seems to be some unwanted broadcasting along the processing pipeline. Could you check what x_cart
and x_pole
is in https://github.com/cheind/pytorch-blender/blob/develop/examples/control/cartpole.py?`
I don't have blender 3.x around currently
from pytorch-blender.
So, I've installed latest Blender 3.0, gym 0.21 and pytorch 10.1. I however can't reproduce what you are seeing. The control example runs fine. Are you on latest develop
of blendtorch?
from pytorch-blender.
Yes, my branch is up to date with develop
.
I printed xcart
and xpole
in cartpole.py:
xcart: 0.0 xpole: [0. 0. 1.2]
Do these seem sane?
I'm on Mac, with python 3.9.7
from pytorch-blender.
xpole
is incorrect, it should be just the x-coordinate of the pole. I have no idea how that happens and I cannot reproduce it. The data you see is read from Blender when you reset/step the env. In both methods just the x coordinate of the world_matrix is returned.
I've tested the code on Ubuntu as well and it works as expected. Would you mind creating a fresh virtual environment to install pytorch-blender?
from pytorch-blender.
@rafaveguim any updates on this?
from pytorch-blender.
Is this correct in _env_reset
?
p = np.array([0.0, 0, 1.2])
from pytorch-blender.
Ah, you're on the right track here!
I believe the code should be
def _env_reset(self):
self.motor.motor_lin_target_velocity = 0.
self.cart.location = np.array([0.0, 0, 1.2])
self.polerot.rotation_euler[1] = np.random.uniform(-0.6, 0.6)
return self._env_post_step()
def _env_post_step(self):
c = self.cart.matrix_world.translation[0]
p = self.pole.matrix_world.translation[0]
a = self.pole.matrix_world.to_euler('XYZ')[1]
return dict(
obs=(c, p, a),
reward=0.,
done=bool(
abs(a) > 0.6
or abs(c) > 4.0
)
)
in examples/control/cartpole_gym/envs/cartpole.blend.py
. Could you try this? Not sure, why it works on other platforms though.
from pytorch-blender.
Problem solved!
from pytorch-blender.
nice, will move the updated code to develop. thanks for your help!
from pytorch-blender.
Related Issues (20)
- Debugging cartpole.blend.py in VScode HOT 1
- datagen other complex scenes (than cubes) HOT 1
- Code for generating object detection dataset HOT 8
- Neural Style Transfer that is UV aware?
- collision between the cloth and rigid body not working HOT 1
- Issue with install / load HOT 5
- Error in example/controls/cartpole.py HOT 2
- needs adaptation to 2.8? HOT 2
- Using custom images instead of shapes like cubes
- Unittest errors due to short DEFAULT_TIMEOUTMS HOT 2
- Installing blendtorch.btb fails HOT 2
- Is there any video where I can learn about the capabilities of this HOT 1
- How to access other render passes? HOT 2
- Add support for PyTorch -> Blender feedback mechanism HOT 1
- Block until peers are connected in DataPublisher
- Escape command line arguments
- Guided DR HOT 1
- Switching tabs in Blender stops animation callbacks.
- Enhancment for background support HOT 1
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 pytorch-blender.