Select Git revision
Martin Karlsson authored
dmp.cc 685 B
#include "dmp.h"
#include <iostream>
#include <armadillo>
using namespace arma;
using namespace std;
Dmp::Dmp(mat w, mat g, double t) : weights(w), goal(g), tau(t) {}
mat Dmp::getW() const {
return weights;
}
mat Dmp::getG() const {
return goal;
}
double Dmp::getT() const {
return tau;
}
void Dmp::setG(mat g) {
goal = g;
}
void Dmp::setT(double t) {
tau = t;
}
Dmp& Dmp::doubleSpeed() {
tau = tau/2;
return *this;
}
Dmp& Dmp::speedupTimes(int x) {
tau = tau/x;
return *this;
}
ostream& operator<<(ostream& os, const Dmp& dmp) {
os << "Weights = " << dmp.weights << endl;
os << "Goal = " << dmp.goal << endl;
os << "Tau = " << dmp.tau << endl;
return os;
}