Add mjmActuator and mjmSensor.
PiperOrigin-RevId: 605600704 Change-Id: I0a2f5eb9d894c068ca9ee08940c752066021b6ec
This commit is contained in:
committed by
Copybara-Service
parent
e3cbad280c
commit
6fa139a693
@@ -123,6 +123,25 @@ void* mjm_addFrame(mjmBody* bodyspec, void* parentframe) {
|
||||
|
||||
|
||||
|
||||
// add actuator to model
|
||||
mjmActuator* mjm_addActuator(void* model, void* defspec) {
|
||||
mjCModel* modelC = static_cast<mjCModel*>(model);
|
||||
mjCDef* def = static_cast<mjCDef*>(defspec);
|
||||
mjCActuator* actuator = modelC->AddActuator(def);
|
||||
return &actuator->spec;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// add sensor to model
|
||||
mjmSensor* mjm_addSensor(void* model) {
|
||||
mjCModel* modelC = static_cast<mjCModel*>(model);
|
||||
mjCSensor* sensor = modelC->AddSensor();
|
||||
return &sensor->spec;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Add plugin to model.
|
||||
mjElement mjm_addPlugin(void* model) {
|
||||
mjCModel* modelC = static_cast<mjCModel*>(model);
|
||||
|
||||
Reference in New Issue
Block a user