Improve docstrings and layout in mjdata.h
PiperOrigin-RevId: 649195756 Change-Id: Iadf6589c226acacd9f3e85959de552a98fc7435a
This commit is contained in:
committed by
Copybara-Service
parent
5cce67439b
commit
ca44ad4f0f
+21
-21
@@ -139,29 +139,29 @@ struct mjData_ {
|
|||||||
int nplugin; // number of plugin instances
|
int nplugin; // number of plugin instances
|
||||||
|
|
||||||
// stack pointer
|
// stack pointer
|
||||||
size_t pstack; // first available mjtNum address in stack
|
size_t pstack; // first available byte in stack
|
||||||
size_t pbase; // value of pstack when mj_markStack was last called
|
size_t pbase; // value of pstack when mj_markStack was last called
|
||||||
|
|
||||||
// arena pointer
|
// arena pointer
|
||||||
size_t parena; // first available byte in arena
|
size_t parena; // first available byte in arena
|
||||||
|
|
||||||
// memory utilization stats
|
// memory utilization statistics
|
||||||
size_t maxuse_stack; // maximum stack allocation in bytes
|
size_t maxuse_stack; // maximum stack allocation in bytes
|
||||||
size_t maxuse_threadstack[mjMAXTHREAD]; // maximum stack allocation per thread in bytes
|
size_t maxuse_threadstack[mjMAXTHREAD]; // maximum stack allocation per thread in bytes
|
||||||
size_t maxuse_arena; // maximum arena allocation in bytes
|
size_t maxuse_arena; // maximum arena allocation in bytes
|
||||||
int maxuse_con; // maximum number of contacts
|
int maxuse_con; // maximum number of contacts
|
||||||
int maxuse_efc; // maximum number of scalar constraints
|
int maxuse_efc; // maximum number of scalar constraints
|
||||||
|
|
||||||
// diagnostics
|
|
||||||
mjWarningStat warning[mjNWARNING]; // warning statistics
|
|
||||||
mjTimerStat timer[mjNTIMER]; // timer statistics
|
|
||||||
|
|
||||||
// solver statistics
|
// solver statistics
|
||||||
mjSolverStat solver[mjNISLAND*mjNSOLVER]; // solver statistics per island, per iteration
|
mjSolverStat solver[mjNISLAND*mjNSOLVER]; // solver statistics per island, per iteration
|
||||||
int solver_nisland; // number of islands processed by solver
|
int solver_nisland; // number of islands processed by solver
|
||||||
int solver_niter[mjNISLAND]; // number of solver iterations, per island
|
int solver_niter[mjNISLAND]; // number of solver iterations, per island
|
||||||
int solver_nnz[mjNISLAND]; // number of non-zeros in Hessian or efc_AR, per island
|
int solver_nnz[mjNISLAND]; // number of nonzeros in Hessian or efc_AR, per island
|
||||||
mjtNum solver_fwdinv[2]; // forward-inverse comparison: qfrc, efc
|
mjtNum solver_fwdinv[2]; // forward-inverse comparison: qfrc, efc
|
||||||
|
|
||||||
|
// diagnostics
|
||||||
|
mjWarningStat warning[mjNWARNING]; // warning statistics
|
||||||
|
mjTimerStat timer[mjNTIMER]; // timer statistics
|
||||||
|
|
||||||
// variable sizes
|
// variable sizes
|
||||||
int ne; // number of equality constraints
|
int ne; // number of equality constraints
|
||||||
@@ -274,7 +274,7 @@ struct mjData_ {
|
|||||||
|
|
||||||
// computed by mj_collisionTree
|
// computed by mj_collisionTree
|
||||||
mjtNum* bvh_aabb_dyn; // global bounding box (center, size) (nbvhdynamic x 6)
|
mjtNum* bvh_aabb_dyn; // global bounding box (center, size) (nbvhdynamic x 6)
|
||||||
mjtByte* bvh_active; // volume has been added to collisions (nbvh x 1)
|
mjtByte* bvh_active; // was bounding volume checked for collision (nbvh x 1)
|
||||||
|
|
||||||
//-------------------- POSITION, VELOCITY dependent
|
//-------------------- POSITION, VELOCITY dependent
|
||||||
|
|
||||||
@@ -344,7 +344,7 @@ struct mjData_ {
|
|||||||
//-------------------- arena-allocated: POSITION dependent
|
//-------------------- arena-allocated: POSITION dependent
|
||||||
|
|
||||||
// computed by mj_collision
|
// computed by mj_collision
|
||||||
mjContact* contact; // list of all detected contacts (ncon x 1)
|
mjContact* contact; // array of all detected contacts (ncon x 1)
|
||||||
|
|
||||||
// computed by mj_makeConstraint
|
// computed by mj_makeConstraint
|
||||||
int* efc_type; // constraint type (mjtConstraint) (nefc x 1)
|
int* efc_type; // constraint type (mjtConstraint) (nefc x 1)
|
||||||
@@ -394,11 +394,11 @@ struct mjData_ {
|
|||||||
//-------------------- arena-allocated: POSITION, VELOCITY, CONTROL/ACCELERATION dependent
|
//-------------------- arena-allocated: POSITION, VELOCITY, CONTROL/ACCELERATION dependent
|
||||||
|
|
||||||
// computed by mj_fwdConstraint/mj_inverse
|
// computed by mj_fwdConstraint/mj_inverse
|
||||||
mjtNum* efc_b; // linear cost term: J*qacc_smooth - aref (nefc x 1)
|
mjtNum* efc_b; // linear cost term: J*qacc_smooth - aref (nefc x 1)
|
||||||
mjtNum* efc_force; // constraint force in constraint space (nefc x 1)
|
mjtNum* efc_force; // constraint force in constraint space (nefc x 1)
|
||||||
int* efc_state; // constraint state (mjtConstraintState) (nefc x 1)
|
int* efc_state; // constraint state (mjtConstraintState) (nefc x 1)
|
||||||
|
|
||||||
// ThreadPool for multithreaded operations
|
// thread pool pointer
|
||||||
uintptr_t threadpool;
|
uintptr_t threadpool;
|
||||||
};
|
};
|
||||||
typedef struct mjData_ mjData;
|
typedef struct mjData_ mjData;
|
||||||
|
|||||||
+21
-21
@@ -167,29 +167,29 @@ struct mjData_ {
|
|||||||
int nplugin; // number of plugin instances
|
int nplugin; // number of plugin instances
|
||||||
|
|
||||||
// stack pointer
|
// stack pointer
|
||||||
size_t pstack; // first available mjtNum address in stack
|
size_t pstack; // first available byte in stack
|
||||||
size_t pbase; // value of pstack when mj_markStack was last called
|
size_t pbase; // value of pstack when mj_markStack was last called
|
||||||
|
|
||||||
// arena pointer
|
// arena pointer
|
||||||
size_t parena; // first available byte in arena
|
size_t parena; // first available byte in arena
|
||||||
|
|
||||||
// memory utilization stats
|
// memory utilization statistics
|
||||||
size_t maxuse_stack; // maximum stack allocation in bytes
|
size_t maxuse_stack; // maximum stack allocation in bytes
|
||||||
size_t maxuse_threadstack[mjMAXTHREAD]; // maximum stack allocation per thread in bytes
|
size_t maxuse_threadstack[mjMAXTHREAD]; // maximum stack allocation per thread in bytes
|
||||||
size_t maxuse_arena; // maximum arena allocation in bytes
|
size_t maxuse_arena; // maximum arena allocation in bytes
|
||||||
int maxuse_con; // maximum number of contacts
|
int maxuse_con; // maximum number of contacts
|
||||||
int maxuse_efc; // maximum number of scalar constraints
|
int maxuse_efc; // maximum number of scalar constraints
|
||||||
|
|
||||||
// diagnostics
|
|
||||||
mjWarningStat warning[mjNWARNING]; // warning statistics
|
|
||||||
mjTimerStat timer[mjNTIMER]; // timer statistics
|
|
||||||
|
|
||||||
// solver statistics
|
// solver statistics
|
||||||
mjSolverStat solver[mjNISLAND*mjNSOLVER]; // solver statistics per island, per iteration
|
mjSolverStat solver[mjNISLAND*mjNSOLVER]; // solver statistics per island, per iteration
|
||||||
int solver_nisland; // number of islands processed by solver
|
int solver_nisland; // number of islands processed by solver
|
||||||
int solver_niter[mjNISLAND]; // number of solver iterations, per island
|
int solver_niter[mjNISLAND]; // number of solver iterations, per island
|
||||||
int solver_nnz[mjNISLAND]; // number of non-zeros in Hessian or efc_AR, per island
|
int solver_nnz[mjNISLAND]; // number of nonzeros in Hessian or efc_AR, per island
|
||||||
mjtNum solver_fwdinv[2]; // forward-inverse comparison: qfrc, efc
|
mjtNum solver_fwdinv[2]; // forward-inverse comparison: qfrc, efc
|
||||||
|
|
||||||
|
// diagnostics
|
||||||
|
mjWarningStat warning[mjNWARNING]; // warning statistics
|
||||||
|
mjTimerStat timer[mjNTIMER]; // timer statistics
|
||||||
|
|
||||||
// variable sizes
|
// variable sizes
|
||||||
int ne; // number of equality constraints
|
int ne; // number of equality constraints
|
||||||
@@ -302,7 +302,7 @@ struct mjData_ {
|
|||||||
|
|
||||||
// computed by mj_collisionTree
|
// computed by mj_collisionTree
|
||||||
mjtNum* bvh_aabb_dyn; // global bounding box (center, size) (nbvhdynamic x 6)
|
mjtNum* bvh_aabb_dyn; // global bounding box (center, size) (nbvhdynamic x 6)
|
||||||
mjtByte* bvh_active; // volume has been added to collisions (nbvh x 1)
|
mjtByte* bvh_active; // was bounding volume checked for collision (nbvh x 1)
|
||||||
|
|
||||||
//-------------------- POSITION, VELOCITY dependent
|
//-------------------- POSITION, VELOCITY dependent
|
||||||
|
|
||||||
@@ -372,7 +372,7 @@ struct mjData_ {
|
|||||||
//-------------------- arena-allocated: POSITION dependent
|
//-------------------- arena-allocated: POSITION dependent
|
||||||
|
|
||||||
// computed by mj_collision
|
// computed by mj_collision
|
||||||
mjContact* contact; // list of all detected contacts (ncon x 1)
|
mjContact* contact; // array of all detected contacts (ncon x 1)
|
||||||
|
|
||||||
// computed by mj_makeConstraint
|
// computed by mj_makeConstraint
|
||||||
int* efc_type; // constraint type (mjtConstraint) (nefc x 1)
|
int* efc_type; // constraint type (mjtConstraint) (nefc x 1)
|
||||||
@@ -422,11 +422,11 @@ struct mjData_ {
|
|||||||
//-------------------- arena-allocated: POSITION, VELOCITY, CONTROL/ACCELERATION dependent
|
//-------------------- arena-allocated: POSITION, VELOCITY, CONTROL/ACCELERATION dependent
|
||||||
|
|
||||||
// computed by mj_fwdConstraint/mj_inverse
|
// computed by mj_fwdConstraint/mj_inverse
|
||||||
mjtNum* efc_b; // linear cost term: J*qacc_smooth - aref (nefc x 1)
|
mjtNum* efc_b; // linear cost term: J*qacc_smooth - aref (nefc x 1)
|
||||||
mjtNum* efc_force; // constraint force in constraint space (nefc x 1)
|
mjtNum* efc_force; // constraint force in constraint space (nefc x 1)
|
||||||
int* efc_state; // constraint state (mjtConstraintState) (nefc x 1)
|
int* efc_state; // constraint state (mjtConstraintState) (nefc x 1)
|
||||||
|
|
||||||
// ThreadPool for multithreaded operations
|
// thread pool pointer
|
||||||
uintptr_t threadpool;
|
uintptr_t threadpool;
|
||||||
};
|
};
|
||||||
typedef struct mjData_ mjData;
|
typedef struct mjData_ mjData;
|
||||||
|
|||||||
+24
-24
@@ -4183,7 +4183,7 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
|||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='pstack',
|
name='pstack',
|
||||||
type=ValueType(name='size_t'),
|
type=ValueType(name='size_t'),
|
||||||
doc='first available mjtNum address in stack',
|
doc='first available byte in stack',
|
||||||
),
|
),
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='pbase',
|
name='pbase',
|
||||||
@@ -4223,22 +4223,6 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
|||||||
type=ValueType(name='int'),
|
type=ValueType(name='int'),
|
||||||
doc='maximum number of scalar constraints',
|
doc='maximum number of scalar constraints',
|
||||||
),
|
),
|
||||||
StructFieldDecl(
|
|
||||||
name='warning',
|
|
||||||
type=ArrayType(
|
|
||||||
inner_type=ValueType(name='mjWarningStat'),
|
|
||||||
extents=(8,),
|
|
||||||
),
|
|
||||||
doc='warning statistics',
|
|
||||||
),
|
|
||||||
StructFieldDecl(
|
|
||||||
name='timer',
|
|
||||||
type=ArrayType(
|
|
||||||
inner_type=ValueType(name='mjTimerStat'),
|
|
||||||
extents=(15,),
|
|
||||||
),
|
|
||||||
doc='timer statistics',
|
|
||||||
),
|
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='solver',
|
name='solver',
|
||||||
type=ArrayType(
|
type=ArrayType(
|
||||||
@@ -4266,7 +4250,7 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
|||||||
inner_type=ValueType(name='int'),
|
inner_type=ValueType(name='int'),
|
||||||
extents=(20,),
|
extents=(20,),
|
||||||
),
|
),
|
||||||
doc='number of non-zeros in Hessian or efc_AR, per island',
|
doc='number of nonzeros in Hessian or efc_AR, per island',
|
||||||
),
|
),
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='solver_fwdinv',
|
name='solver_fwdinv',
|
||||||
@@ -4276,6 +4260,22 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
|||||||
),
|
),
|
||||||
doc='forward-inverse comparison: qfrc, efc',
|
doc='forward-inverse comparison: qfrc, efc',
|
||||||
),
|
),
|
||||||
|
StructFieldDecl(
|
||||||
|
name='warning',
|
||||||
|
type=ArrayType(
|
||||||
|
inner_type=ValueType(name='mjWarningStat'),
|
||||||
|
extents=(8,),
|
||||||
|
),
|
||||||
|
doc='warning statistics',
|
||||||
|
),
|
||||||
|
StructFieldDecl(
|
||||||
|
name='timer',
|
||||||
|
type=ArrayType(
|
||||||
|
inner_type=ValueType(name='mjTimerStat'),
|
||||||
|
extents=(15,),
|
||||||
|
),
|
||||||
|
doc='timer statistics',
|
||||||
|
),
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='ne',
|
name='ne',
|
||||||
type=ValueType(name='int'),
|
type=ValueType(name='int'),
|
||||||
@@ -4756,7 +4756,7 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
|||||||
type=PointerType(
|
type=PointerType(
|
||||||
inner_type=ValueType(name='mjtByte'),
|
inner_type=ValueType(name='mjtByte'),
|
||||||
),
|
),
|
||||||
doc='volume has been added to collisions (nbvh x 1)', # pylint: disable=line-too-long
|
doc='was bounding volume checked for collision (nbvh x 1)', # pylint: disable=line-too-long
|
||||||
),
|
),
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='flexedge_velocity',
|
name='flexedge_velocity',
|
||||||
@@ -4987,7 +4987,7 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
|||||||
type=PointerType(
|
type=PointerType(
|
||||||
inner_type=ValueType(name='mjContact'),
|
inner_type=ValueType(name='mjContact'),
|
||||||
),
|
),
|
||||||
doc='list of all detected contacts (ncon x 1)', # pylint: disable=line-too-long
|
doc='array of all detected contacts (ncon x 1)', # pylint: disable=line-too-long
|
||||||
),
|
),
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='efc_type',
|
name='efc_type',
|
||||||
@@ -5239,26 +5239,26 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
|||||||
type=PointerType(
|
type=PointerType(
|
||||||
inner_type=ValueType(name='mjtNum'),
|
inner_type=ValueType(name='mjtNum'),
|
||||||
),
|
),
|
||||||
doc='linear cost term: J*qacc_smooth - aref (nefc x 1)', # pylint: disable=line-too-long
|
doc='linear cost term: J*qacc_smooth - aref (nefc x 1)', # pylint: disable=line-too-long
|
||||||
),
|
),
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='efc_force',
|
name='efc_force',
|
||||||
type=PointerType(
|
type=PointerType(
|
||||||
inner_type=ValueType(name='mjtNum'),
|
inner_type=ValueType(name='mjtNum'),
|
||||||
),
|
),
|
||||||
doc='constraint force in constraint space (nefc x 1)', # pylint: disable=line-too-long
|
doc='constraint force in constraint space (nefc x 1)', # pylint: disable=line-too-long
|
||||||
),
|
),
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='efc_state',
|
name='efc_state',
|
||||||
type=PointerType(
|
type=PointerType(
|
||||||
inner_type=ValueType(name='int'),
|
inner_type=ValueType(name='int'),
|
||||||
),
|
),
|
||||||
doc='constraint state (mjtConstraintState) (nefc x 1)', # pylint: disable=line-too-long
|
doc='constraint state (mjtConstraintState) (nefc x 1)', # pylint: disable=line-too-long
|
||||||
),
|
),
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='threadpool',
|
name='threadpool',
|
||||||
type=ValueType(name='uintptr_t'),
|
type=ValueType(name='uintptr_t'),
|
||||||
doc='ThreadPool for multithreaded operations',
|
doc='thread pool pointer',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
|
|||||||
@@ -789,29 +789,6 @@ public unsafe struct mjData_ {
|
|||||||
public UIntPtr maxuse_arena;
|
public UIntPtr maxuse_arena;
|
||||||
public int maxuse_con;
|
public int maxuse_con;
|
||||||
public int maxuse_efc;
|
public int maxuse_efc;
|
||||||
public mjWarningStat_ warning0;
|
|
||||||
public mjWarningStat_ warning1;
|
|
||||||
public mjWarningStat_ warning2;
|
|
||||||
public mjWarningStat_ warning3;
|
|
||||||
public mjWarningStat_ warning4;
|
|
||||||
public mjWarningStat_ warning5;
|
|
||||||
public mjWarningStat_ warning6;
|
|
||||||
public mjWarningStat_ warning7;
|
|
||||||
public mjTimerStat_ timer0;
|
|
||||||
public mjTimerStat_ timer1;
|
|
||||||
public mjTimerStat_ timer2;
|
|
||||||
public mjTimerStat_ timer3;
|
|
||||||
public mjTimerStat_ timer4;
|
|
||||||
public mjTimerStat_ timer5;
|
|
||||||
public mjTimerStat_ timer6;
|
|
||||||
public mjTimerStat_ timer7;
|
|
||||||
public mjTimerStat_ timer8;
|
|
||||||
public mjTimerStat_ timer9;
|
|
||||||
public mjTimerStat_ timer10;
|
|
||||||
public mjTimerStat_ timer11;
|
|
||||||
public mjTimerStat_ timer12;
|
|
||||||
public mjTimerStat_ timer13;
|
|
||||||
public mjTimerStat_ timer14;
|
|
||||||
public mjSolverStat_ solver0;
|
public mjSolverStat_ solver0;
|
||||||
public mjSolverStat_ solver1;
|
public mjSolverStat_ solver1;
|
||||||
public mjSolverStat_ solver2;
|
public mjSolverStat_ solver2;
|
||||||
@@ -4816,6 +4793,29 @@ public unsafe struct mjData_ {
|
|||||||
public fixed int solver_niter[20];
|
public fixed int solver_niter[20];
|
||||||
public fixed int solver_nnz[20];
|
public fixed int solver_nnz[20];
|
||||||
public fixed double solver_fwdinv[2];
|
public fixed double solver_fwdinv[2];
|
||||||
|
public mjWarningStat_ warning0;
|
||||||
|
public mjWarningStat_ warning1;
|
||||||
|
public mjWarningStat_ warning2;
|
||||||
|
public mjWarningStat_ warning3;
|
||||||
|
public mjWarningStat_ warning4;
|
||||||
|
public mjWarningStat_ warning5;
|
||||||
|
public mjWarningStat_ warning6;
|
||||||
|
public mjWarningStat_ warning7;
|
||||||
|
public mjTimerStat_ timer0;
|
||||||
|
public mjTimerStat_ timer1;
|
||||||
|
public mjTimerStat_ timer2;
|
||||||
|
public mjTimerStat_ timer3;
|
||||||
|
public mjTimerStat_ timer4;
|
||||||
|
public mjTimerStat_ timer5;
|
||||||
|
public mjTimerStat_ timer6;
|
||||||
|
public mjTimerStat_ timer7;
|
||||||
|
public mjTimerStat_ timer8;
|
||||||
|
public mjTimerStat_ timer9;
|
||||||
|
public mjTimerStat_ timer10;
|
||||||
|
public mjTimerStat_ timer11;
|
||||||
|
public mjTimerStat_ timer12;
|
||||||
|
public mjTimerStat_ timer13;
|
||||||
|
public mjTimerStat_ timer14;
|
||||||
public int ne;
|
public int ne;
|
||||||
public int nf;
|
public int nf;
|
||||||
public int nl;
|
public int nl;
|
||||||
|
|||||||
Reference in New Issue
Block a user