Add mjmActuator and mjmSensor.

PiperOrigin-RevId: 605600704
Change-Id: I0a2f5eb9d894c068ca9ee08940c752066021b6ec
This commit is contained in:
Alessio Quaglino
2024-02-09 05:10:10 -08:00
committed by Copybara-Service
parent e3cbad280c
commit 6fa139a693
9 changed files with 453 additions and 273 deletions
+19
View File
@@ -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);