Comments (11)
Very interesting! Can you please check if env.env_desc['obstacles']
gives the same/similar obstacles? The exact description of the current environment should be there.
from osim-rl.
to reproduce, you could simply log every observations of every episode, and check them with the algorithm above. my code was checking on the fly during training.
from osim-rl.
@kidzik i train mainly with remote environment so by the time I wrote previous post that's not possible. I will try that on local machine with modified env to collect env_desc.
I think it might not be a problem of the obstacle list though, since the obstacle observations are generated by comparing pelvis_x with the obstacle list. It might be bugs that corrupted pelvis_x or the calculation of obstacle_relative.
from osim-rl.
That's true, I meant it rather as a sanity check, also to check which of the obstacles is wrong (if it's always the first or the last one, it may speed up debugging).
One important thing here is the logic of the obstacles sensor. Current semantics are as follows (besides the error of the first observation):
- if all obstacles are ahead, return the relative position of the first one,
obstacle_x - pelvis_x
- if
pelvis_x
passed an obstacle, it ispelvis_x > obstacle_x + obstacle_radius
return the relative position of the next obstacle, i.e.obstacle_x - pelvis_x
- if there are no obstacles ahead, return
[100,0,0]
as implemented here https://github.com/stanfordnmbl/osim-rl/blob/master/osim/env/run.py#L110-L120
Note that the second point makes it a little messy: agent is likely to see an obstacle with negative relative distance. Moreover, if one obstacle was covering another it may show up after passing the first one.
The actual list of obstacles is created here https://github.com/stanfordnmbl/osim-rl/blob/master/osim/env/run.py#L228-L262 and I don't see any reason why it could be other than 3
since the code is straightforward. If it's a problem on osim-rl
side, it should rather be in the sensing part.
Yet, the example you gave is still not covered by this case.
from osim-rl.
Thank you. I know the logic of generation of obstacles very well (we all do :) ).
There's one problem regarding the sensor though: you sorted the list of obstacles at the beginning, then assume they should be detected in that order by iterating thru the list. https://github.com/stanfordnmbl/osim-rl/blob/master/osim/env/run.py#L256-L257
You sort them by obstacle_x
; but when iterating thru the list, you compare the pelvis_x
with obstacle_x+radius
, which may not be in the same ascending order as obstacle_x
.
which will result in undercounting (the client will never 'see' one of the obstacles throughout 1000 steps) in some cases, this one for example:
which is not strictly a bug since this unseen obstacle does not affect the agent's performance. it just made the counting inaccurate.
from osim-rl.
Yes, that's the reason I mentioned the exact procedure here. As you say, it should not affect performance much, while it might affect counting.
In either case, it still doesn't explain 4 obstacles...
from osim-rl.
on FourObstacleError I made a dump.
dump.zip
I'm currently examining it.
from osim-rl.
I'll paste all the problems I found.
- psoas isn't constant:
psoas | psoas
-- | --
1.094567 | 0.796778
0.992841 | 0.991891
0.992841 | 0.991891
0.992841 | 0.991891
0.992841 | 0.991891
0.992841 | 0.991891
0.992841 | 0.991891
0.992841 | 0.991891
0.992841 | 0.991891
0.992841 | 0.991891
0.992841 | 0.991891
0.992841 | 0.991891
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
0.940272 | 1.144951
from osim-rl.
i tried to plot, well this is strange:
it seems the data i collected from the environment contains two consecutive episodes rather than one. I guess there could be something extremely wrong in my parallelization code. so now I'll go check my own code and see if it indeed is my problem.
from osim-rl.
Update: the messed up observations are likely to be my problem, this issue could be closed.
Still the values in the first observation will always be wrong, due to osim-rl's implementation:
https://github.com/stanfordnmbl/osim-rl/blob/master/osim/env/run.py#L57-L63
def reset(self, difficulty=2, seed=None):
super(RunEnv, self).reset()
self.istep = 0
self.last_state = self.get_observation()
self.setup(difficulty, seed)
self.current_state = self.last_state
return self.last_state
the last_state was obtained before setup(), causing last_state not representing the actual model state after reset(). The two lines should really be switched.
from osim-rl.
Great! At this point, it's a duplicate of #53, so I'm closing this one.
from osim-rl.
Related Issues (20)
- Constant force applied to a point HOT 6
- How to install the 2017 osim-rl environment
- No Module names ProstheticsEnv HOT 2
- ValueError while executing act_and_train in TRPO HOT 1
- Integrator step failed at time 0.23 (required condition 't1 > t0' was not met) HOT 5
- possible to change the forward speed in sim_L2M2019_controller1.py? HOT 30
- python crashes with no error when running env.reset() HOT 9
- Cannot reproduce 'model_exp' for toy arm environment
- Are there residual and/or reserve actuators in the model? HOT 2
- how to get the moment arm
- Loco_reflex_song2019 controller doesn't work in 3D mode HOT 2
- ModuleNotFoundError: No module named '_simbody' HOT 4
- Creating an environment
- Using fixed step size in opensim_rl HOT 2
- installation of Opensim-rl
- Required condition 'SimVersion == ProtocolVersion' was not met HOT 1
- Visualizer shows up as blank HOT 1
- not showing the musculoskeletal: Intel MKL ERROR: Parameter 1 was incorrect on entry to CPPCON
- No module named 'osim' HOT 1
- installation of kidzik/opensim package using python3.7+
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 osim-rl.