33 #include <Rcs_VecNd.h> 34 #include <Rcs_macros.h> 48 shift = MatNd_clone(iModMax);
49 MatNd_subSelf(
shift, iModMin);
50 MatNd_constMulSelf(
shift, 0.5);
51 MatNd_addSelf(
shift, iModMin);
54 scale = MatNd_clone(iModMax);
55 MatNd_subSelf(
scale, iModMin);
56 MatNd_constMulSelf(
scale, 0.5);
71 VecNd_setElementsTo(min, -1,
getDim());
72 VecNd_setElementsTo(max, 1,
getDim());
81 MatNd* q_des, MatNd* q_dot_des, MatNd* T_des,
82 const MatNd* action,
double dt)
85 MatNd* denormalizedAction = NULL;
86 MatNd_create2(denormalizedAction, action->m, action->n);
88 MatNd_eleMul(denormalizedAction, action,
scale);
89 MatNd_addSelf(denormalizedAction,
shift);
99 MatNd_destroy(denormalizedAction);
112 for (
unsigned int i = 0; i <
getDim(); ++i) {
113 action->ele[i] = (action->ele[i] -
shift->ele[i])/
scale->ele[i];
virtual void computeCommand(MatNd *q_des, MatNd *q_dot_des, MatNd *T_des, const MatNd *action, double dt)
virtual std::vector< std::string > getNames() const
const MatNd * getMin() const
virtual unsigned int getDim() const
const BoxSpace * getSpace() const
virtual void getStableAction(MatNd *action) const
virtual void computeCommand(MatNd *q_des, MatNd *q_dot_des, MatNd *T_des, const MatNd *action, double dt)=0
const MatNd * getMax() const
virtual void getMinMax(double *min, double *max) const
virtual ActionModel * getWrappedActionModel() const
ActionModel * clone() const
virtual std::vector< std::string > getNames() const
virtual unsigned int getDim() const =0
virtual void getStableAction(MatNd *action) const =0
AMNormalized(ActionModel *wrapped)