Comments (3)
Hi,
- Regarding the contact Jacobian itself, this can be accessed as follows. Each contact in the
data->contact
array contains anefc_address
integer, which tells you what is the first row in the Jacobian that corresponds to this contact. The actual number of rows depends on the dimensionality of the contact (condim
) and whether you are using elliptic or pyramidal contacts. If you are using sparse Jacobians you'll need to read the sparse format, if dense you can just read fromefc_J
. I recommend making a small test model which will default to dense (under 60 DoFs) and experimenting with elliptic and pyramidal. This is explained here. - Regarding the derivative of the Jacobian, derivative with respect to what? It looks like, from your equations, that you want derivative with respect to time? For this you would need to finite difference, there is currently no way to compute dJ/dt analytically. I have not tried this but the following should work. At the end of
mj_forward()
(notmj_step()
, since you don't want the state to change), save the Jacobian. Then callmj_integratePos
, passing indata->qpos
anddata->qvel
with some tiny epsilon in the last argument to nudge the positions. Then callmj_makeConstraint
which computes the nudged Jacobian and fin-diff. Note that this will give you a possibly bad approximation of Jdot, since you are not recomputing the contact frames. You can do the nudging in the beginning offorward()
, getting a better approximation (contacts will be recomputed), but then you run the risk of contacts appearing or disappearing, requiring some more logic.
UPDATE: thinking again about my suggestion above, as written this will definitely not work, since you need to at least call mj_forward()
to update the world-frame cartesian positions. I am now thinking that best thing would be to run the full first half of the pipeline (i.e. mj_step1()
) after nudging the positions, which will recompute everything including contact frames. This will mean that you might need to add logic to deal with changing indices if contacts appear or disappear, but this should be very rare if your epsilon is small enough, perhaps rare enough that you can ignore it.
from mujoco.
Hi!
Thanks for the above explanation. I will look into the time derivative of the jacobian part.
The corresponding contact force can be assessed using mj_contactForce(m, d, i, result)
right?
from mujoco.
That is correct. Note that for elliptic cones this basically reads out the values from efc_force
as the representation is the "natural" one. For pyramidal cones the normal and tangents need to be disambiguated.
from mujoco.
Related Issues (20)
- It's hard to me to understand what's the point of FindOrFetch macro and how to override its behavior. HOT 2
- Python 3.12 issue when using EGL with egl.eglChooseConfig HOT 1
- Assistance Required for Handling Memory Limitations and Plant Model Simulation in MuJoCo HOT 8
- Help in finding the right qpos and ctrl values while defining the keyframe HOT 5
- How to tune the PD gains ? HOT 1
- Difference between the PD control and Model based control in MuJoCo HOT 5
- Maintain Passive Viewer + Physics Rendering on MacOS - NSInternalInconsistencyException HOT 1
- inconsistencies between declaration and definition
- Undersanding auto connect feature HOT 6
- How to build Simulate app in my own project for windows HOT 3
- Non-holonomic link for sphere robot. HOT 5
- Possible unexpected behavior in simulate due to resource path HOT 1
- Possible unexpected behavior in simulate due to resource path HOT 4
- Problem implementing MJX environment from xml (NotImplementedError) HOT 4
- Does mj_contactForce apply to contact->geom[0] or contact->geom[1]? HOT 3
- MuJoCo for rope drived HOT 1
- Simulated air bearings partially "sink" in the floor after I include a ball joint HOT 2
- Problems Encountered in Rope Drive:( HOT 2
- Suggestion for auto-connect elements HOT 1
- Color and texture change for the center of mass sphere 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 mujoco.