Comments (4)
Thanks for the issue - I suspect a version upgrade in DM we don't cover yet, will investigate!
from carl.
We'll definitely need more information here @sai-prasanna , since we haven't been able to reproduce this issue with your or an older dm_control version:
- what is the exact gravity value and how do you get it? I'd assume you use 'env.env.env.physics.model.opt' to inspect the physics of the environment?
- which environments did you try this with specifically? Did you reset them before checking (since instance changing happens in reset)?
- since you installed carl at a specific commit that doesn't seem to be the latest one: is there a specific reason for that? Does it work on the current main branch?
- does you environment instantiate at all? MuJoCo gravity is usually an array with x,y and z gravity where we only change z gravity, a single zero value should cause issues here
from carl.
Sorry for the late reply got tied up with some work and then vacations.
I am using the v1.0.0 tag just to have it in the release version. Here is my sample code.
from carl.envs.dmc.carl_dm_walker import CARLDmcWalkerEnv
import numpy as np
import matplotlib.pyplot as plt
import imageio
from carl.context.selection import StaticSelector
from carl.envs.dmc import CARLDmcWalkerEnv
contexts = None
frames = []
env = CARLDmcWalkerEnv(contexts={0: CARLDmcWalkerEnv.get_default_context()})
env.reset()
for i in range(1000):
action = env.action_space.sample()
state, reward, terminated, truncated, info = env.step(action=action)
frames.append(env.render())
imageio.mimsave('video.mp4', frames, fps=30)
This answers some of your questions (1, 2, 3). The environment does instantiate (4).
With random actions, I would assume the walker would writhe on the ground unable to walk, but inspecting the video, it's floating. Am I wrong in assuming this?
video.mp4
env.env.env.physics.model.opt has the following value
<MjOption
apirate: 100.0
cone: 0
density: 0.0
disableactuator: 0
disableflags: 0
enableflags: 0
gravity: array([0. , 0. , 9.81])
impratio: 1.0
integrator: 0
iterations: 100
jacobian: 2
ls_iterations: 50
ls_tolerance: 0.01
magnetic: array([ 0. , -0.5, 0. ])
mpr_iterations: 50
mpr_tolerance: 1e-06
noslip_iterations: 0
noslip_tolerance: 1e-06
o_friction: array([1.e+00, 1.e+00, 5.e-03, 1.e-04, 1.e-04])
o_margin: 0.0
o_solimp: array([9.0e-01, 9.5e-01, 1.0e-03, 5.0e-01, 2.0e+00])
o_solref: array([0.02, 1. ])
sdf_initpoints: 40
sdf_iterations: 10
solver: 2
timestep: 0.0025
tolerance: 1e-08
viscosity: 0.0
wind: array([0., 0., 0.])
>
Now I tried directly loading vanilla dm control environment (used this wrapper to convert it to gymnasium). It works properly. So I think the bug is isolated to CARL rather than my dmcontrol setup being wacky.
video.mp4
from carl.
Found the issue! We refactored these recently and added the sins of the bounds in the wrong order. I pushed a fix on development, locally your example now gives me the video below. Let me know if it works for you!
video.mp4
from carl.
Related Issues (20)
- Reintegrate RNA
- Update to Gym 0.25.x HOT 1
- AttributeError: 'LunarLander' object has no attribute 'sky_polys' HOT 1
- Upgrade to new brax version HOT 1
- Set context only during reset, not in __init__ HOT 1
- Update to gymnasium HOT 6
- Documentation cannot be accessed HOT 2
- Performance Deviations in Brax HOT 2
- Integrate sampling for uniform bounds HOT 2
- About brax HOT 1
- Adjust API to current brax version HOT 1
- Using with stable-baselines3 HOT 3
- Support for python ver 3.8 HOT 1
- Inquiry Regarding RL Libraries and Curves in CARL Project HOT 2
- CARLLunarLander not training properly HOT 2
- Make example with RL library HOT 1
- Subtle error in action_space type for dm_control (gym/gymnasium) HOT 1
- Allow sampling contexts on the fly on reset HOT 2
- Search space encoding failing on docstring example
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 carl.