6#ifndef YARP_DEV_CONTROLBOARDHELPER_H
7#define YARP_DEV_CONTROLBOARDHELPER_H
20 std::enable_if_t<std::is_trivial<T>::value,
int> = 0>
25 memset(
t, 0,
sizeof(T) * size);
30 std::enable_if_t<!std::is_trivial<T>::value,
int> = 0>
50class ControlBoardHelper;
57 ControlBoardHelper(
int n,
const int *aMap,
const double *angToEncs =
nullptr,
const double *zs =
nullptr,
const double *newtons =
nullptr,
const double *amps =
nullptr,
const double *volts =
nullptr,
const double *dutycycles =
nullptr,
const double *kbemf =
nullptr,
const double *ktau =
nullptr);
64 bool checkAxesIds(
const int n_axes,
const int* axesList);
67 void toUser(
const double *hwData,
double *user);
68 void toUser(
const int *hwData,
int *user);
69 void toHw(
const double *usr,
double *hwData);
70 void toHw(
const int *usr,
int *hwData);
73 void posA2E(
double ang,
int j,
double &enc,
int &k);
74 double posA2E(
double ang,
int j);
75 void posE2A(
double enc,
int j,
double &ang,
int &k);
76 double posE2A(
double enc,
int j);
77 void posA2E(
const double *ang,
double *enc);
78 void posE2A(
const double *enc,
double *ang);
81 void velA2E(
double ang,
int j,
double &enc,
int &k);
82 double velA2E(
double ang,
int j);
83 void velA2E_abs(
double ang,
int j,
double &enc,
int &k);
84 void velE2A(
double enc,
int j,
double &ang,
int &k);
85 void velE2A_abs(
double enc,
int j,
double &ang,
int &k);
86 double velE2A(
double enc,
int j);
88 void velA2E(
const double *ang,
double *enc);
89 void velA2E_abs(
const double *ang,
double *enc);
90 void velE2A(
const double *enc,
double *ang);
91 void velE2A_abs(
const double *enc,
double *ang);
94 void accA2E(
double ang,
int j,
double &enc,
int &k);
95 void accA2E_abs(
double ang,
int j,
double &enc,
int &k);
96 void accE2A(
double enc,
int j,
double &ang,
int &k);
97 void accE2A_abs(
double enc,
int j,
double &ang,
int &k);
98 double accE2A(
double enc,
int j);
100 void accA2E(
const double *ang,
double *enc);
101 void accA2E_abs(
const double *ang,
double *enc);
102 void accE2A(
const double *enc,
double *ang);
103 void accE2A_abs(
const double *enc,
double *ang);
106 void trqN2S(
double newtons,
int j,
double &sens,
int &k);
107 double trqN2S(
double newtons,
int j);
108 void trqN2S(
const double *newtons,
double *sens);
109 void trqS2N(
const double *sens,
double *newtons);
110 void trqS2N(
double sens,
int j,
double &newton,
int &k);
111 double trqS2N(
double sens,
int j);
114 void impN2S(
double newtons,
int j,
double &sens,
int &k);
115 double impN2S(
double newtons,
int j);
116 void impN2S(
const double *newtons,
double *sens);
117 void impS2N(
const double *sens,
double *newtons);
118 void impS2N(
double sens,
int j,
double &newton,
int &k);
119 double impS2N(
double sens,
int j);
122 void ampereA2S(
double ampere,
int j,
double &sens,
int &k);
124 void ampereA2S(
const double *ampere,
double *sens);
125 void ampereS2A(
const double *sens,
double *ampere);
126 void ampereS2A(
double sens,
int j,
double &ere,
int &k);
130 void voltageV2S(
double voltage,
int j,
double &sens,
int &k);
132 void voltageV2S(
const double *voltage,
double *sens);
133 void voltageS2V(
const double *sens,
double *voltage);
134 void voltageS2V(
double sens,
int j,
double &voltage,
int &k);
138 void dutycycle2PWM(
double dutycycle,
int j,
double &pwm,
int &k);
142 void PWM2dutycycle(
double pwm_raw,
int k_raw,
double &dutycycle,
int &j);
154 void bemf_user2raw(
double bemf_user,
int j,
double &bemf_raw,
int &k);
155 void ktau_user2raw(
double ktau_user,
int j,
double &ktau_raw,
int &k);
161 void bemf_raw2user(
double bemf_raw,
int k_raw,
double &bemf_user,
int &j_user);
162 void ktau_raw2user(
double ktau_raw,
int k_raw,
double &ktau_user,
int &j_user);
163 void viscousPos_raw2user(
double viscousPos_raw,
int k_raw,
double &viscousPos_user,
int &j_user);
164 void viscousNeg_raw2user(
double viscousNeg_raw,
int k_raw,
double &viscousNeg_user,
int &j_user);
165 void coulombPos_raw2user(
double coulombPos_raw,
int k_raw,
double &coulombPos_user,
int &j_user);
166 void coulombNeg_raw2user(
double coulombNeg_raw,
int k_raw,
double &coulombNeg_user,
int &j_user);
void checkAndDestroy(T *&p)
T * allocAndCheck(int size)
yarp::dev::ControlBoardHelper * castToMapper(void *p)
define control board standard interfaces
double get_pidfeedback_conversion_factor_user2raw(const yarp::dev::PidControlTypeEnum &pidtype, int j)
void accE2A(double enc, int j, double &ang, int &k)
void convert_pid_to_user(const yarp::dev::PidControlTypeEnum &pidtype, const Pid &in_raw, int j_raw, Pid &out_usr, int &k_usr)
void viscousNeg_raw2user(double viscousNeg_raw, int k_raw, double &viscousNeg_user, int &j_user)
double viscousNeg_user2raw(double viscousNeg_user, int j)
void ktau_raw2user(double ktau_raw, int k_raw, double &ktau_user, int &j_user)
void trqN2S(double newtons, int j, double &sens, int &k)
void velE2A_abs(double enc, int j, double &ang, int &k)
void convert_pidunits_to_machine(const yarp::dev::PidControlTypeEnum &pidtype, double userval, int j, double &machineval, int &k)
void bemf_raw2user(double bemf_raw, int k_raw, double &bemf_user, int &j_user)
void coulombPos_raw2user(double coulombPos_raw, int k_raw, double &coulombPos_user, int &j_user)
void voltageS2V(const double *sens, double *voltage)
void convert_pid_to_machine(const yarp::dev::PidControlTypeEnum &pidtype, const Pid &in_usr, int j_usr, Pid &out_raw, int &k_raw)
void ampereA2S(double ampere, int j, double &sens, int &k)
void impN2S(double newtons, int j, double &sens, int &k)
double ktau_user2raw(double ktau_user, int j)
double coulombPos_user2raw(double coulombPos_user, int j)
void velE2A(double enc, int j, double &ang, int &k)
double coulombNeg_user2raw(double coulombNeg_user, int j)
double velocityThres_user2raw(double velocityThres_user, int j)
void velocityThres_raw2user(double threshold_raw, int k_raw, double &velocityThres_user, int &j_user)
void velA2E(double ang, int j, double &enc, int &k)
void dutycycle2PWM(double dutycycle, int j, double &pwm, int &k)
void ampereS2A(const double *sens, double *ampere)
double viscousPos_user2raw(double viscousPos_user, int j)
void posE2A(double enc, int j, double &ang, int &k)
void coulombNeg_raw2user(double coulombNeg_raw, int k_raw, double &coulombNeg_user, int &j_user)
void trqS2N(const double *sens, double *newtons)
double get_pidoutput_conversion_factor_user2raw(const yarp::dev::PidControlTypeEnum &pidtype, int j)
void set_pid_conversion_units(const PidControlTypeEnum &pidtype, const PidFeedbackUnitsEnum fbk_conv_units, const PidOutputUnitsEnum out_conv_units)
void toUser(const int *hwData, int *user)
void voltageV2S(double voltage, int j, double &sens, int &k)
ControlBoardHelper & operator=(const ControlBoardHelper &other)
double bemf_user2raw(double bemf_user, int j)
void accA2E_abs(double ang, int j, double &enc, int &k)
void accA2E(double ang, int j, double &enc, int &k)
void accE2A_abs(double enc, int j, double &ang, int &k)
void velA2E_abs(double ang, int j, double &enc, int &k)
void viscousPos_raw2user(double viscousPos_raw, int k_raw, double &viscousPos_user, int &j_user)
void convert_pidunits_to_user(const yarp::dev::PidControlTypeEnum &pidtype, const double machineval, double *userval, int k)
void impS2N(const double *sens, double *newtons)
void PWM2dutycycle(const double *pwm, double *dutycycle)
bool checkAxesIds(const int n_axes, const int *axesList)
void posA2E(double ang, int j, double &enc, int &k)
Contains the parameters for a PID.
For streams capable of holding different kinds of content, check what they actually have.
The main, catch-all namespace for YARP.