Improve comments in mjplugin.h, align to header standard (column 35).
PiperOrigin-RevId: 525868504 Change-Id: I8edfcea737e6e94458015a0e4fa6522cf89a1230
This commit is contained in:
committed by
Copybara-Service
parent
2d69b158aa
commit
0295d972cb
+11
-11
@@ -1198,26 +1198,26 @@ struct mjModel_ {
|
|||||||
};
|
};
|
||||||
typedef struct mjModel_ mjModel;
|
typedef struct mjModel_ mjModel;
|
||||||
struct mjpResourceProvider_ {
|
struct mjpResourceProvider_ {
|
||||||
const char* prefix; // prefix for match against a resource name
|
const char* prefix; // prefix for match against a resource name
|
||||||
mjfOpenResource open; // opening callback
|
mjfOpenResource open; // opening callback
|
||||||
mjfReadResource read; // reading callback
|
mjfReadResource read; // reading callback
|
||||||
mjfCloseResource close; // closing callback
|
mjfCloseResource close; // closing callback
|
||||||
void* data; // opaque data pointer (resource invariant)
|
void* data; // opaque data pointer (resource invariant)
|
||||||
};
|
};
|
||||||
typedef struct mjpResourceProvider_ mjpResourceProvider;
|
typedef struct mjpResourceProvider_ mjpResourceProvider;
|
||||||
typedef enum mjtPluginCapabilityBit_ {
|
typedef enum mjtPluginCapabilityBit_ {
|
||||||
mjPLUGIN_ACTUATOR = 1<<0,
|
mjPLUGIN_ACTUATOR = 1<<0, // actuator forces
|
||||||
mjPLUGIN_SENSOR = 1<<1,
|
mjPLUGIN_SENSOR = 1<<1, // sensor measurements
|
||||||
mjPLUGIN_PASSIVE = 1<<2,
|
mjPLUGIN_PASSIVE = 1<<2, // passive forces
|
||||||
} mjtPluginCapabilityBit;
|
} mjtPluginCapabilityBit;
|
||||||
struct mjpPlugin_ {
|
struct mjpPlugin_ {
|
||||||
const char* name; // globally unique name identifying the plugin
|
const char* name; // globally unique name identifying the plugin
|
||||||
|
|
||||||
int nattribute; // number of configuration attributes
|
int nattribute; // number of configuration attributes
|
||||||
const char* const* attributes; // name of configuration attributes
|
const char* const* attributes; // name of configuration attributes
|
||||||
|
|
||||||
int capabilityflags; // bitfield of mjtPluginCapabilityBit specifying plugin capabilities
|
int capabilityflags; // plugin capabilities: bitfield of mjtPluginCapabilityBit
|
||||||
int needstage; // an mjtStage enum value specifying the sensor computation stage
|
int needstage; // sensor computation stage (mjtStage)
|
||||||
|
|
||||||
// number of mjtNums needed to store the state of a plugin instance (required)
|
// number of mjtNums needed to store the state of a plugin instance (required)
|
||||||
int (*nstate)(const mjModel* m, int instance);
|
int (*nstate)(const mjModel* m, int instance);
|
||||||
|
|||||||
+12
-12
@@ -36,11 +36,11 @@ typedef void (*mjfCloseResource)(mjResource* resource);
|
|||||||
|
|
||||||
// struct describing a single resource provider
|
// struct describing a single resource provider
|
||||||
struct mjpResourceProvider_ {
|
struct mjpResourceProvider_ {
|
||||||
const char* prefix; // prefix for match against a resource name
|
const char* prefix; // prefix for match against a resource name
|
||||||
mjfOpenResource open; // opening callback
|
mjfOpenResource open; // opening callback
|
||||||
mjfReadResource read; // reading callback
|
mjfReadResource read; // reading callback
|
||||||
mjfCloseResource close; // closing callback
|
mjfCloseResource close; // closing callback
|
||||||
void* data; // opaque data pointer (resource invariant)
|
void* data; // opaque data pointer (resource invariant)
|
||||||
};
|
};
|
||||||
typedef struct mjpResourceProvider_ mjpResourceProvider;
|
typedef struct mjpResourceProvider_ mjpResourceProvider;
|
||||||
|
|
||||||
@@ -48,19 +48,19 @@ typedef struct mjpResourceProvider_ mjpResourceProvider;
|
|||||||
//---------------------------------- Plugins -------------------------------------------------------
|
//---------------------------------- Plugins -------------------------------------------------------
|
||||||
|
|
||||||
typedef enum mjtPluginCapabilityBit_ {
|
typedef enum mjtPluginCapabilityBit_ {
|
||||||
mjPLUGIN_ACTUATOR = 1<<0,
|
mjPLUGIN_ACTUATOR = 1<<0, // actuator forces
|
||||||
mjPLUGIN_SENSOR = 1<<1,
|
mjPLUGIN_SENSOR = 1<<1, // sensor measurements
|
||||||
mjPLUGIN_PASSIVE = 1<<2,
|
mjPLUGIN_PASSIVE = 1<<2, // passive forces
|
||||||
} mjtPluginCapabilityBit;
|
} mjtPluginCapabilityBit;
|
||||||
|
|
||||||
struct mjpPlugin_ {
|
struct mjpPlugin_ {
|
||||||
const char* name; // globally unique name identifying the plugin
|
const char* name; // globally unique name identifying the plugin
|
||||||
|
|
||||||
int nattribute; // number of configuration attributes
|
int nattribute; // number of configuration attributes
|
||||||
const char* const* attributes; // name of configuration attributes
|
const char* const* attributes; // name of configuration attributes
|
||||||
|
|
||||||
int capabilityflags; // bitfield of mjtPluginCapabilityBit specifying plugin capabilities
|
int capabilityflags; // plugin capabilities: bitfield of mjtPluginCapabilityBit
|
||||||
int needstage; // an mjtStage enum value specifying the sensor computation stage
|
int needstage; // sensor computation stage (mjtStage)
|
||||||
|
|
||||||
// number of mjtNums needed to store the state of a plugin instance (required)
|
// number of mjtNums needed to store the state of a plugin instance (required)
|
||||||
int (*nstate)(const mjModel* m, int instance);
|
int (*nstate)(const mjModel* m, int instance);
|
||||||
@@ -112,7 +112,7 @@ typedef struct mjpPlugin_ mjpPlugin;
|
|||||||
#endif // !defined(mjEXTERNC)
|
#endif // !defined(mjEXTERNC)
|
||||||
|
|
||||||
// NOLINTBEGIN(runtime/int)
|
// NOLINTBEGIN(runtime/int)
|
||||||
#define mjPLUGIN_LIB_INIT \
|
#define mjPLUGIN_LIB_INIT \
|
||||||
static void _mjplugin_dllmain(void); \
|
static void _mjplugin_dllmain(void); \
|
||||||
mjEXTERNC int __stdcall mjDLLMAIN(void* hinst, unsigned long reason, void* reserved) { \
|
mjEXTERNC int __stdcall mjDLLMAIN(void* hinst, unsigned long reason, void* reserved) { \
|
||||||
if (reason == 1) { \
|
if (reason == 1) { \
|
||||||
|
|||||||
Reference in New Issue
Block a user