Framelinvel sensor and global velocity #2582
-
IntroHi! I am a master degree student at UNED, I use MuJoCo for my research on human motion synthesis. My setupMuJoCo python My questionHi, Which one is the best way to achieve this: using Trying to look for the answer by myself I've found a situation that i can not explain and I'm not sure if I have missunderstood the way that sensors works. The model that I've used to test the situation is an arm, with three bodies:
When I apply a force to the slide joint the entire arm move to positive X, then I measure the velocity in body0 and fingertip and both give me the same value using The problem is that I've also attached a sensor in fingertip, and when I read the value I see a sightly different value. Why is this? Have I misunderstood how sensor works? I know that I've set a very small step time in simulation to make sure that this is not the problem, but not sure neither if this is relevant. Thanks for the help Minimal model and/or code that explain my question
Confirmations
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, I am a MuJoCo user. I hope this helps. Please insert The function |
Beta Was this translation helpful? Give feedback.
-
Hi @v-r-a , |
Beta Was this translation helpful? Give feedback.
Hi,
I am a MuJoCo user. I hope this helps.
Please insert
mujoco.mj_forward(model, data)
beforeprint(data.sensordata)
and you will see that the values match exactly. This is because the sensor value is stale by one step of integration. Please have a look at the simulation pipeline, especially this part.The function
mj_step()
stops after advancing the simulation by one time step. The new sensor values corresponding to the advanced state are yet to be computed. Do the forward dynamic calculations usingmj_forward()
, and everything is up to date.