|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
9 #ifndef YARP_DEV_CONTROLBOARDHELPER_H
10 #define YARP_DEV_CONTROLBOARDHELPER_H
17 #include <type_traits>
23 std::enable_if_t<std::is_trivial<T>::value,
int> = 0>
28 memset(
t, 0,
sizeof(T) * size);
33 std::enable_if_t<!std::is_trivial<T>::value,
int> = 0>
54 class ControlBoardHelper;
62 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);
69 bool checkAxesIds(
const int n_axes,
const int* axesList);
72 void toUser(
const double *hwData,
double *user);
73 void toUser(
const int *hwData,
int *user);
74 void toHw(
const double *usr,
double *hwData);
75 void toHw(
const int *usr,
int *hwData);
78 void posA2E(
double ang,
int j,
double &enc,
int &k);
79 double posA2E(
double ang,
int j);
80 void posE2A(
double enc,
int j,
double &ang,
int &k);
81 double posE2A(
double enc,
int j);
82 void posA2E(
const double *ang,
double *enc);
83 void posE2A(
const double *enc,
double *ang);
86 void velA2E(
double ang,
int j,
double &enc,
int &k);
87 double velA2E(
double ang,
int j);
88 void velA2E_abs(
double ang,
int j,
double &enc,
int &k);
89 void velE2A(
double enc,
int j,
double &ang,
int &k);
90 void velE2A_abs(
double enc,
int j,
double &ang,
int &k);
91 double velE2A(
double enc,
int j);
93 void velA2E(
const double *ang,
double *enc);
94 void velA2E_abs(
const double *ang,
double *enc);
95 void velE2A(
const double *enc,
double *ang);
96 void velE2A_abs(
const double *enc,
double *ang);
99 void accA2E(
double ang,
int j,
double &enc,
int &k);
100 void accA2E_abs(
double ang,
int j,
double &enc,
int &k);
101 void accE2A(
double enc,
int j,
double &ang,
int &k);
102 void accE2A_abs(
double enc,
int j,
double &ang,
int &k);
103 double accE2A(
double enc,
int j);
105 void accA2E(
const double *ang,
double *enc);
106 void accA2E_abs(
const double *ang,
double *enc);
107 void accE2A(
const double *enc,
double *ang);
108 void accE2A_abs(
const double *enc,
double *ang);
111 void trqN2S(
double newtons,
int j,
double &sens,
int &k);
112 double trqN2S(
double newtons,
int j);
113 void trqN2S(
const double *newtons,
double *sens);
114 void trqS2N(
const double *sens,
double *newtons);
115 void trqS2N(
double sens,
int j,
double &newton,
int &k);
116 double trqS2N(
double sens,
int j);
119 void impN2S(
double newtons,
int j,
double &sens,
int &k);
120 double impN2S(
double newtons,
int j);
121 void impN2S(
const double *newtons,
double *sens);
122 void impS2N(
const double *sens,
double *newtons);
123 void impS2N(
double sens,
int j,
double &newton,
int &k);
124 double impS2N(
double sens,
int j);
127 void ampereA2S(
double ampere,
int j,
double &sens,
int &k);
129 void ampereA2S(
const double *ampere,
double *sens);
130 void ampereS2A(
const double *sens,
double *ampere);
131 void ampereS2A(
double sens,
int j,
double &ere,
int &k);
135 void voltageV2S(
double voltage,
int j,
double &sens,
int &k);
137 void voltageV2S(
const double *voltage,
double *sens);
138 void voltageS2V(
const double *sens,
double *voltage);
139 void voltageS2V(
double sens,
int j,
double &voltage,
int &k);
143 void dutycycle2PWM(
double dutycycle,
int j,
double &pwm,
int &k);
147 void PWM2dutycycle(
double pwm_raw,
int k_raw,
double &dutycycle,
int &j);
153 void bemf_user2raw(
double bemf_user,
int j,
double &bemf_raw,
int &k);
154 void ktau_user2raw(
double ktau_user,
int j,
double &ktau_raw,
int &k);
155 void bemf_raw2user(
double bemf_raw,
int k_raw,
double &bemf_user,
int &j_user);
156 void ktau_raw2user(
double ktau_raw,
int k_raw,
double &ktau_user,
int &j_user);
183 #endif // YARP_DEV_CONTROLBOARDHELPER_H
void convert_pidunits_to_machine(const yarp::dev::PidControlTypeEnum &pidtype, double userval, int j, double &machineval, int &k)
void velE2A(double enc, int j, double &ang, int &k)
void convert_pid_to_machine(const yarp::dev::PidControlTypeEnum &pidtype, const Pid &in_usr, int j_usr, Pid &out_raw, int &k_raw)
void posE2A(double enc, int j, double &ang, int &k)
double bemf_user2raw(double bemf_user, int j)
double get_pidoutput_conversion_factor_user2raw(const yarp::dev::PidControlTypeEnum &pidtype, int j)
bool checkAxesIds(const int n_axes, const int *axesList)
void toUser(const int *hwData, int *user)
void velA2E_abs(double ang, int j, double &enc, int &k)
ControlBoardHelper & operator=(const ControlBoardHelper &other)
void dutycycle2PWM(double dutycycle, int j, double &pwm, int &k)
void ampereS2A(const double *sens, double *ampere)
void ampereA2S(double ampere, int j, double &sens, int &k)
void velE2A_abs(double enc, int j, double &ang, int &k)
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)
void posA2E(double ang, int j, double &enc, int &k)
void voltageS2V(const double *sens, double *voltage)
void impS2N(const double *sens, double *newtons)
void voltageV2S(double voltage, int j, double &sens, int &k)
double ktau_user2raw(double ktau_user, int j)
void impN2S(double newtons, int j, double &sens, int &k)
void accA2E(double ang, int j, double &enc, int &k)
void trqN2S(double newtons, int j, double &sens, int &k)
void velA2E(double ang, int j, double &enc, int &k)
void checkAndDestroy(T *&p)
void accE2A_abs(double enc, int j, double &ang, int &k)
void accA2E_abs(double ang, int j, double &enc, int &k)
define control board standard interfaces
yarp::dev::ControlBoardHelper * castToMapper(void *p)
The main, catch-all namespace for YARP.
void convert_pid_to_user(const yarp::dev::PidControlTypeEnum &pidtype, const Pid &in_raw, int j_raw, Pid &out_usr, int &k_usr)
double get_pidfeedback_conversion_factor_user2raw(const yarp::dev::PidControlTypeEnum &pidtype, int j)
void accE2A(double enc, int j, double &ang, int &k)
void trqS2N(const double *sens, double *newtons)
Contains the parameters for a PID.
void set_pid_conversion_units(const PidControlTypeEnum &pidtype, const PidFeedbackUnitsEnum fbk_conv_units, const PidOutputUnitsEnum out_conv_units)
void bemf_raw2user(double bemf_raw, int k_raw, double &bemf_user, int &j_user)
void ktau_raw2user(double ktau_raw, int k_raw, double &ktau_user, int &j_user)
T * allocAndCheck(int size)
void PWM2dutycycle(const double *pwm, double *dutycycle)
void convert_pidunits_to_user(const yarp::dev::PidControlTypeEnum &pidtype, const double machineval, double *userval, int k)