Comments (3)
This is working as expected, not sure why you are confused. After mj_step, everything in mjData except for the state is wrt the previous timestep. So after an mj_step there is an inconsistency between the state and everything else, since mj_step only does everything until it computes the new state and then it stops. After mj_forward all the quantities are wrt the current timestep, there is no inconsistency.
Let me know if something is still unclear.
from mujoco.
Actually, this is probably a good opportunity to improve the documentation. If you now fully get it, tell me how you think we should improve the docs. If not, please keep asking questions until you are 100% confident you get it, and this conversation will help clarify how the docs should be improved...
from mujoco.
@yuvaltassa Thank you for the reply. I understand the behavior now.
After spending more time reading the documentation, what you described is indeed detailed in Programming/Simulation loop section.
... Jacobians, passive forces. None of these quantities are available before mj_step is called (or rather, they are available but outdated by one time step)
However, the documentation in APIreference/APIfunctions/Main simulation makes no mention of this explicitly. I also find the statement "mj_step
is the only call needed" to be misleading. As far as I can tell most robotics use cases must call mj_forward
separately to get forward kinematics results.
Most users will only need to call mj_step, which computes everything and advanced the simulation state by one time step...mj_forward performs the same computations as mj_step but without the integration. It is useful after loading or resetting a model (to put the entire mjData in a valid state), and also for out-of-order computations that involve sampling or finite-difference approximations.
I think adding more emphasis on all quantities except for the state itself is outdated after mj_step
would be helpful, especially in the APIreference
section.
from mujoco.
Related Issues (20)
- D4RL mujoco datasets compatibility between versions HOT 1
- MuJoCo cup model penetrating floor/table HOT 3
- Issues with Point Cloud Visibility in Camera's Field of View Using MuJoCo
- Document MJX "broadphase" fields
- Simulating tension only cables with variable lengths
- Disabling contact rendering for Touch Sensor Grid plugin HOT 1
- Human musculoskeletal motion simulation using mujoco HOT 1
- Build from Source incl. Python Bindings HOT 1
- unity 'mujoco.elasticity.cable' error HOT 2
- `mj_copyData` not copying contact details? HOT 3
- Getting contact information and z-position from external rendering software HOT 2
- Changing the geom mass fails to affect simulation properties? HOT 2
- How to set free joint in keyframe
- Saving the xml with updates after mj_step HOT 1
- Transforming contact forces from the contact frame to the local frame of a geom involved in said contact/collision? HOT 3
- differentiable physics tutorial missing module brax HOT 1
- Error: engine error: edge ordering is incoherent between flex and plugin / mujoco.elasticity.solid
- Using gmsh files in MuJoCo - XML Error: Error: Node tags must be sequential HOT 1
- Rotation of 3 hinge joints with orthogonal axes. HOT 2
- Gravity: Blocks not falling HOT 2
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 mujoco.