24 #include "configurationhelper.h"
25 #include "randomgenerator.h"
26 #include "motorcontrollers.h"
28 #include <QStringList>
55 Descriptor d =
addTypeDescription( type,
"Fake motors: useful to add additional outputs (not linked with real motors) to the neural controller" );
69 if (changeType == Deleted) {
74 if (resourceName ==
"neuronsIterator") {
75 NeuronsIterator* evonetIt = getResource<NeuronsIterator>(
"neuronsIterator" );
85 ProportionalController::ProportionalController(){
87 setControlParameters(0.3,20);
89 ProportionalController::~ProportionalController(){
93 void ProportionalController::setControlParameters(
double k,
double maxvel){
102 double ProportionalController::getK()
const {
106 void ProportionalController::setK(
double k){
110 double ProportionalController::getMaxVelocity(){
113 void ProportionalController::setMaxVelocity(
double maxVel){
119 double ProportionalController::velocityForJoint(
double desired,
double current){
120 double vel =
m_k * (desired - current);
122 if (vel > +m_maxvel) {
124 }
else if (vel < -m_maxvel) {