Adding independent Actuator and Controller to Model:
Posted: Fri Oct 20, 2017 4:43 am
I have a model that has a number of muscle actuators and I want to add another actuator that applies force on two segments of the model as a function of some of the state variables in the model. I reckon I should define an actuator and a controller for that additional actuator (similar to tugOfWar actuator). So I derive two classes – MyActuator from Actuators class and MyController from Controller class. Now I have two issues:
1. I want MyController to only be associated with MyActuator and not with the Muscle Actuators in the model. If I invoke addActuators() with an object of MyController, all the actuators, including the muscles are associated with MyController which is not what I want. If I invoke SetActuators with an object of MyActuators as an argument this does not work either because the argument of SetActuators is a Set<Actuators> type and not an Actuators type. How do I define a Set<Actuator> type different from an Actuator type or re-cast Actuators type to a Set<Actuators> type? The explanation in ClassNameMapping.pdf only takes me in a circuitous path.
2. Also, I was surprised to see that even though MyController is derived from class Controller, invoking the method setNumControls() with an object of MyController throws an error that only a controller can set its number of controls based on the actuators associated with it.
I will appreciate any help with these issues.
1. I want MyController to only be associated with MyActuator and not with the Muscle Actuators in the model. If I invoke addActuators() with an object of MyController, all the actuators, including the muscles are associated with MyController which is not what I want. If I invoke SetActuators with an object of MyActuators as an argument this does not work either because the argument of SetActuators is a Set<Actuators> type and not an Actuators type. How do I define a Set<Actuator> type different from an Actuator type or re-cast Actuators type to a Set<Actuators> type? The explanation in ClassNameMapping.pdf only takes me in a circuitous path.
2. Also, I was surprised to see that even though MyController is derived from class Controller, invoking the method setNumControls() with an object of MyController throws an error that only a controller can set its number of controls based on the actuators associated with it.
I will appreciate any help with these issues.