Add edge ids to flex elements in mjModel.

PiperOrigin-RevId: 675130981
Change-Id: If2ccfb268142d235273b7a50e15740f6399903b2
This commit is contained in:
Alessio Quaglino
2024-09-16 06:56:09 -07:00
committed by Copybara-Service
parent 9d73211757
commit 31abd7900a
18 changed files with 84 additions and 131 deletions
+1 -7
View File
@@ -42,13 +42,8 @@ class Solid {
int i0; // index of first body
int nc; // number of cubes in the grid
int nv; // number of vertices (bodies) in the solid
int nt; // number of volumetric elements (tetrahedra)
int ne; // number of edges in the solid
// connectivity info for mapping tetrahedra to edges and vertices
std::vector<Stencil3D> elements; // 4 vertices and 6 edges (nt x 10)
std::vector<std::pair<int, int> > edges; // edge to vertex map (ne x 2)
// precomputed quantities
std::vector<mjtNum> prev; // previous-step lengths (ne x 1)
std::vector<mjtNum> elongation; // edge elongation (ne x 1)
@@ -58,8 +53,7 @@ class Solid {
private:
Solid(const mjModel* m, mjData* d, int instance, mjtNum nu, mjtNum E,
mjtNum damp, const std::vector<int>& simplex,
const std::vector<int>& edgeidx);
mjtNum damp);
};
} // namespace mujoco::plugin::elasticity