Particles with arbitrary geoms and joints.

Fixes #553

PiperOrigin-RevId: 486614769
Change-Id: I9a09bf73da97b6b9746800a72ac6c97cce2efa92
This commit is contained in:
Alessio Quaglino
2022-11-07 03:21:36 -08:00
committed by Copybara-Service
parent fd4d47e4a5
commit 3b89b0fd30
10 changed files with 283 additions and 51 deletions
+6 -3
View File
@@ -15,8 +15,8 @@
#ifndef MUJOCO_SRC_USER_USER_COMPOSITE_H_
#define MUJOCO_SRC_USER_USER_COMPOSITE_H_
#include <map>
#include <string>
#include <unordered_map>
#include <vector>
#include <mujoco/mjmodel.h>
@@ -44,6 +44,7 @@ typedef enum _mjtCompKind {
mjCOMPKIND_STRETCH,
mjCOMPKIND_TENDON,
mjCOMPKIND_SHEAR,
mjCOMPKIND_PARTICLE,
mjNCOMPKINDS
} mjtCompKind;
@@ -64,6 +65,7 @@ class mjCComposite {
mjCComposite(void);
void SetDefault(void);
bool AddDefaultJoint(char* error = NULL, int error_sz = 0);
void AdjustSoft(mjtNum* solref, mjtNum* solimp, int level);
bool Make(mjCModel* model, mjCBody* body, char* error, int error_sz);
@@ -123,8 +125,9 @@ class mjCComposite {
int skingroup; // skin group of the composite object
// element options
bool add[mjNCOMPKINDS]; // add element
mjCDef def[mjNCOMPKINDS]; // defaults
bool add[mjNCOMPKINDS]; // add element
mjCDef def[mjNCOMPKINDS]; // default geom, site, tendon
std::unordered_map<mjtCompKind, std::vector<mjCDef> > defjoint; // default joints
// computed internally
int dim; // dimensionality