YARP
Yet Another Robot Platform
yarp::dev::ControlBoardHelper Class Reference

#include <yarp/dev/ControlBoardHelper.h>

Classes

class  PrivateUnitsHandler
 

Public Member Functions

 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)
 
 ~ControlBoardHelper ()
 
 ControlBoardHelper (const ControlBoardHelper &other)
 
ControlBoardHelperoperator= (const ControlBoardHelper &other)
 
bool checkAxisId (int id)
 
bool checkAxesIds (const int n_axes, const int *axesList)
 
int toHw (int axis)
 
int toUser (int axis)
 
void toUser (const double *hwData, double *user)
 
void toUser (const int *hwData, int *user)
 
void toHw (const double *usr, double *hwData)
 
void toHw (const int *usr, int *hwData)
 
void posA2E (double ang, int j, double &enc, int &k)
 
double posA2E (double ang, int j)
 
void posE2A (double enc, int j, double &ang, int &k)
 
double posE2A (double enc, int j)
 
void posA2E (const double *ang, double *enc)
 
void posE2A (const double *enc, double *ang)
 
void velA2E (double ang, int j, double &enc, int &k)
 
double velA2E (double ang, int j)
 
void velA2E_abs (double ang, int j, double &enc, int &k)
 
void velE2A (double enc, int j, double &ang, int &k)
 
void velE2A_abs (double enc, int j, double &ang, int &k)
 
double velE2A (double enc, int j)
 
double velE2A_abs (double enc, int j)
 
void velA2E (const double *ang, double *enc)
 
void velA2E_abs (const double *ang, double *enc)
 
void velE2A (const double *enc, double *ang)
 
void velE2A_abs (const double *enc, double *ang)
 
void accA2E (double ang, int j, double &enc, int &k)
 
void accA2E_abs (double ang, int j, double &enc, int &k)
 
void accE2A (double enc, int j, double &ang, int &k)
 
void accE2A_abs (double enc, int j, double &ang, int &k)
 
double accE2A (double enc, int j)
 
double accE2A_abs (double enc, int j)
 
void accA2E (const double *ang, double *enc)
 
void accA2E_abs (const double *ang, double *enc)
 
void accE2A (const double *enc, double *ang)
 
void accE2A_abs (const double *enc, double *ang)
 
void trqN2S (double newtons, int j, double &sens, int &k)
 
double trqN2S (double newtons, int j)
 
void trqN2S (const double *newtons, double *sens)
 
void trqS2N (const double *sens, double *newtons)
 
void trqS2N (double sens, int j, double &newton, int &k)
 
double trqS2N (double sens, int j)
 
void impN2S (double newtons, int j, double &sens, int &k)
 
double impN2S (double newtons, int j)
 
void impN2S (const double *newtons, double *sens)
 
void impS2N (const double *sens, double *newtons)
 
void impS2N (double sens, int j, double &newton, int &k)
 
double impS2N (double sens, int j)
 
void ampereA2S (double ampere, int j, double &sens, int &k)
 
double ampereA2S (double ampere, int j)
 
void ampereA2S (const double *ampere, double *sens)
 
void ampereS2A (const double *sens, double *ampere)
 
void ampereS2A (double sens, int j, double &ampere, int &k)
 
double ampereS2A (double sens, int j)
 
void voltageV2S (double voltage, int j, double &sens, int &k)
 
double voltageV2S (double voltage, int j)
 
void voltageV2S (const double *voltage, double *sens)
 
void voltageS2V (const double *sens, double *voltage)
 
void voltageS2V (double sens, int j, double &voltage, int &k)
 
double voltageS2V (double sens, int j)
 
void dutycycle2PWM (double dutycycle, int j, double &pwm, int &k)
 
double dutycycle2PWM (double dutycycle, int j)
 
void dutycycle2PWM (const double *dutycycle, double *sens)
 
void PWM2dutycycle (const double *pwm, double *dutycycle)
 
void PWM2dutycycle (double pwm_raw, int k_raw, double &dutycycle, int &j)
 
double PWM2dutycycle (double pwm_raw, int k_raw)
 
double bemf_user2raw (double bemf_user, int j)
 
double ktau_user2raw (double ktau_user, int j)
 
void bemf_user2raw (double bemf_user, int j, double &bemf_raw, int &k)
 
void ktau_user2raw (double ktau_user, int j, double &ktau_raw, int &k)
 
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)
 
int axes ()
 
void convert_pidunits_to_machine (const yarp::dev::PidControlTypeEnum &pidtype, double userval, int j, double &machineval, int &k)
 
void convert_pidunits_to_machine (const yarp::dev::PidControlTypeEnum &pidtype, const double *userval, double *machineval)
 
void convert_pidunits_to_user (const yarp::dev::PidControlTypeEnum &pidtype, const double machineval, double *userval, int k)
 
void convert_pidunits_to_user (const yarp::dev::PidControlTypeEnum &pidtype, const double *machineval, double *userval)
 
void convert_pid_to_user (const yarp::dev::PidControlTypeEnum &pidtype, const Pid &in_raw, int j_raw, Pid &out_usr, int &k_usr)
 
void convert_pid_to_machine (const yarp::dev::PidControlTypeEnum &pidtype, const Pid &in_usr, int j_usr, Pid &out_raw, int &k_raw)
 
Pid convert_pid_to_machine (const yarp::dev::PidControlTypeEnum &pidtype, const Pid &in_usr, int j_usr)
 
void set_pid_conversion_units (const PidControlTypeEnum &pidtype, const PidFeedbackUnitsEnum fbk_conv_units, const PidOutputUnitsEnum out_conv_units)
 
double get_pidfeedback_conversion_factor_user2raw (const yarp::dev::PidControlTypeEnum &pidtype, int j)
 
double get_pidoutput_conversion_factor_user2raw (const yarp::dev::PidControlTypeEnum &pidtype, int j)
 

Detailed Description

Definition at line 59 of file ControlBoardHelper.h.

Constructor & Destructor Documentation

◆ ControlBoardHelper() [1/2]

ControlBoardHelper::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 
)

Definition at line 164 of file ControlBoardHelper.cpp.

◆ ~ControlBoardHelper()

ControlBoardHelper::~ControlBoardHelper ( )

Definition at line 198 of file ControlBoardHelper.cpp.

◆ ControlBoardHelper() [2/2]

yarp::dev::ControlBoardHelper::ControlBoardHelper ( const ControlBoardHelper other)

Definition at line 203 of file ControlBoardHelper.cpp.

Member Function Documentation

◆ accA2E() [1/2]

void ControlBoardHelper::accA2E ( const double *  ang,
double *  enc 
)

Definition at line 537 of file ControlBoardHelper.cpp.

◆ accA2E() [2/2]

void ControlBoardHelper::accA2E ( double  ang,
int  j,
double &  enc,
int &  k 
)

Definition at line 426 of file ControlBoardHelper.cpp.

◆ accA2E_abs() [1/2]

void ControlBoardHelper::accA2E_abs ( const double *  ang,
double *  enc 
)

Definition at line 548 of file ControlBoardHelper.cpp.

◆ accA2E_abs() [2/2]

void ControlBoardHelper::accA2E_abs ( double  ang,
int  j,
double &  enc,
int &  k 
)

Definition at line 431 of file ControlBoardHelper.cpp.

◆ accE2A() [1/3]

void ControlBoardHelper::accE2A ( const double *  enc,
double *  ang 
)

Definition at line 559 of file ControlBoardHelper.cpp.

◆ accE2A() [2/3]

double ControlBoardHelper::accE2A ( double  enc,
int  j 
)

Definition at line 459 of file ControlBoardHelper.cpp.

◆ accE2A() [3/3]

void ControlBoardHelper::accE2A ( double  enc,
int  j,
double &  ang,
int &  k 
)

Definition at line 436 of file ControlBoardHelper.cpp.

◆ accE2A_abs() [1/3]

void ControlBoardHelper::accE2A_abs ( const double *  enc,
double *  ang 
)

Definition at line 570 of file ControlBoardHelper.cpp.

◆ accE2A_abs() [2/3]

double ControlBoardHelper::accE2A_abs ( double  enc,
int  j 
)

Definition at line 464 of file ControlBoardHelper.cpp.

◆ accE2A_abs() [3/3]

void ControlBoardHelper::accE2A_abs ( double  enc,
int  j,
double &  ang,
int &  k 
)

Definition at line 441 of file ControlBoardHelper.cpp.

◆ ampereA2S() [1/3]

void ControlBoardHelper::ampereA2S ( const double *  ampere,
double *  sens 
)

Definition at line 594 of file ControlBoardHelper.cpp.

◆ ampereA2S() [2/3]

double ControlBoardHelper::ampereA2S ( double  ampere,
int  j 
)

Definition at line 588 of file ControlBoardHelper.cpp.

◆ ampereA2S() [3/3]

void ControlBoardHelper::ampereA2S ( double  ampere,
int  j,
double &  sens,
int &  k 
)

Definition at line 582 of file ControlBoardHelper.cpp.

◆ ampereS2A() [1/3]

void ControlBoardHelper::ampereS2A ( const double *  sens,
double *  ampere 
)

Definition at line 606 of file ControlBoardHelper.cpp.

◆ ampereS2A() [2/3]

double ControlBoardHelper::ampereS2A ( double  sens,
int  j 
)

Definition at line 623 of file ControlBoardHelper.cpp.

◆ ampereS2A() [3/3]

void ControlBoardHelper::ampereS2A ( double  sens,
int  j,
double &  ampere,
int &  k 
)

Definition at line 617 of file ControlBoardHelper.cpp.

◆ axes()

int ControlBoardHelper::axes ( )

Definition at line 762 of file ControlBoardHelper.cpp.

◆ bemf_raw2user()

void ControlBoardHelper::bemf_raw2user ( double  bemf_raw,
int  k_raw,
double &  bemf_user,
int &  j_user 
)

Definition at line 738 of file ControlBoardHelper.cpp.

◆ bemf_user2raw() [1/2]

double ControlBoardHelper::bemf_user2raw ( double  bemf_user,
int  j 
)

Definition at line 750 of file ControlBoardHelper.cpp.

◆ bemf_user2raw() [2/2]

void ControlBoardHelper::bemf_user2raw ( double  bemf_user,
int  j,
double &  bemf_raw,
int &  k 
)

Definition at line 726 of file ControlBoardHelper.cpp.

◆ checkAxesIds()

bool ControlBoardHelper::checkAxesIds ( const int  n_axes,
const int *  axesList 
)

Definition at line 224 of file ControlBoardHelper.cpp.

◆ checkAxisId()

bool ControlBoardHelper::checkAxisId ( int  id)

Definition at line 214 of file ControlBoardHelper.cpp.

◆ convert_pid_to_machine() [1/2]

Pid ControlBoardHelper::convert_pid_to_machine ( const yarp::dev::PidControlTypeEnum pidtype,
const Pid in_usr,
int  j_usr 
)

Definition at line 826 of file ControlBoardHelper.cpp.

◆ convert_pid_to_machine() [2/2]

void ControlBoardHelper::convert_pid_to_machine ( const yarp::dev::PidControlTypeEnum pidtype,
const Pid in_usr,
int  j_usr,
Pid out_raw,
int &  k_raw 
)

Definition at line 834 of file ControlBoardHelper.cpp.

◆ convert_pid_to_user()

void ControlBoardHelper::convert_pid_to_user ( const yarp::dev::PidControlTypeEnum pidtype,
const Pid in_raw,
int  j_raw,
Pid out_usr,
int &  k_usr 
)

Definition at line 802 of file ControlBoardHelper.cpp.

◆ convert_pidunits_to_machine() [1/2]

void ControlBoardHelper::convert_pidunits_to_machine ( const yarp::dev::PidControlTypeEnum pidtype,
const double *  userval,
double *  machineval 
)

Definition at line 883 of file ControlBoardHelper.cpp.

◆ convert_pidunits_to_machine() [2/2]

void ControlBoardHelper::convert_pidunits_to_machine ( const yarp::dev::PidControlTypeEnum pidtype,
double  userval,
int  j,
double &  machineval,
int &  k 
)

Definition at line 858 of file ControlBoardHelper.cpp.

◆ convert_pidunits_to_user() [1/2]

void ControlBoardHelper::convert_pidunits_to_user ( const yarp::dev::PidControlTypeEnum pidtype,
const double *  machineval,
double *  userval 
)

Definition at line 933 of file ControlBoardHelper.cpp.

◆ convert_pidunits_to_user() [2/2]

void ControlBoardHelper::convert_pidunits_to_user ( const yarp::dev::PidControlTypeEnum pidtype,
const double  machineval,
double *  userval,
int  k 
)

Definition at line 908 of file ControlBoardHelper.cpp.

◆ dutycycle2PWM() [1/3]

void ControlBoardHelper::dutycycle2PWM ( const double *  dutycycle,
double *  sens 
)

Definition at line 691 of file ControlBoardHelper.cpp.

◆ dutycycle2PWM() [2/3]

double ControlBoardHelper::dutycycle2PWM ( double  dutycycle,
int  j 
)

Definition at line 686 of file ControlBoardHelper.cpp.

◆ dutycycle2PWM() [3/3]

void ControlBoardHelper::dutycycle2PWM ( double  dutycycle,
int  j,
double &  pwm,
int &  k 
)

Definition at line 680 of file ControlBoardHelper.cpp.

◆ get_pidfeedback_conversion_factor_user2raw()

double ControlBoardHelper::get_pidfeedback_conversion_factor_user2raw ( const yarp::dev::PidControlTypeEnum pidtype,
int  j 
)

Definition at line 783 of file ControlBoardHelper.cpp.

◆ get_pidoutput_conversion_factor_user2raw()

double ControlBoardHelper::get_pidoutput_conversion_factor_user2raw ( const yarp::dev::PidControlTypeEnum pidtype,
int  j 
)

Definition at line 767 of file ControlBoardHelper.cpp.

◆ impN2S() [1/3]

void ControlBoardHelper::impN2S ( const double *  newtons,
double *  sens 
)

Definition at line 315 of file ControlBoardHelper.cpp.

◆ impN2S() [2/3]

double ControlBoardHelper::impN2S ( double  newtons,
int  j 
)

Definition at line 310 of file ControlBoardHelper.cpp.

◆ impN2S() [3/3]

void ControlBoardHelper::impN2S ( double  newtons,
int  j,
double &  sens,
int &  k 
)

Definition at line 304 of file ControlBoardHelper.cpp.

◆ impS2N() [1/3]

void ControlBoardHelper::impS2N ( const double *  sens,
double *  newtons 
)

Definition at line 373 of file ControlBoardHelper.cpp.

◆ impS2N() [2/3]

double ControlBoardHelper::impS2N ( double  sens,
int  j 
)

Definition at line 390 of file ControlBoardHelper.cpp.

◆ impS2N() [3/3]

void ControlBoardHelper::impS2N ( double  sens,
int  j,
double &  newton,
int &  k 
)

Definition at line 384 of file ControlBoardHelper.cpp.

◆ ktau_raw2user()

void ControlBoardHelper::ktau_raw2user ( double  ktau_raw,
int  k_raw,
double &  ktau_user,
int &  j_user 
)

Definition at line 744 of file ControlBoardHelper.cpp.

◆ ktau_user2raw() [1/2]

double ControlBoardHelper::ktau_user2raw ( double  ktau_user,
int  j 
)

Definition at line 755 of file ControlBoardHelper.cpp.

◆ ktau_user2raw() [2/2]

void ControlBoardHelper::ktau_user2raw ( double  ktau_user,
int  j,
double &  ktau_raw,
int &  k 
)

Definition at line 732 of file ControlBoardHelper.cpp.

◆ operator=()

ControlBoardHelper & ControlBoardHelper::operator= ( const ControlBoardHelper other)

Definition at line 208 of file ControlBoardHelper.cpp.

◆ posA2E() [1/3]

void ControlBoardHelper::posA2E ( const double *  ang,
double *  enc 
)

Definition at line 470 of file ControlBoardHelper.cpp.

◆ posA2E() [2/3]

double ControlBoardHelper::posA2E ( double  ang,
int  j 
)

Definition at line 285 of file ControlBoardHelper.cpp.

◆ posA2E() [3/3]

void ControlBoardHelper::posA2E ( double  ang,
int  j,
double &  enc,
int &  k 
)

Definition at line 279 of file ControlBoardHelper.cpp.

◆ posE2A() [1/3]

void ControlBoardHelper::posE2A ( const double *  enc,
double *  ang 
)

Definition at line 482 of file ControlBoardHelper.cpp.

◆ posE2A() [2/3]

double ControlBoardHelper::posE2A ( double  enc,
int  j 
)

Definition at line 297 of file ControlBoardHelper.cpp.

◆ posE2A() [3/3]

void ControlBoardHelper::posE2A ( double  enc,
int  j,
double &  ang,
int &  k 
)

Definition at line 290 of file ControlBoardHelper.cpp.

◆ PWM2dutycycle() [1/3]

void ControlBoardHelper::PWM2dutycycle ( const double *  pwm,
double *  dutycycle 
)

Definition at line 702 of file ControlBoardHelper.cpp.

◆ PWM2dutycycle() [2/3]

double ControlBoardHelper::PWM2dutycycle ( double  pwm_raw,
int  k_raw 
)

Definition at line 719 of file ControlBoardHelper.cpp.

◆ PWM2dutycycle() [3/3]

void ControlBoardHelper::PWM2dutycycle ( double  pwm_raw,
int  k_raw,
double &  dutycycle,
int &  j 
)

Definition at line 713 of file ControlBoardHelper.cpp.

◆ set_pid_conversion_units()

void ControlBoardHelper::set_pid_conversion_units ( const PidControlTypeEnum pidtype,
const PidFeedbackUnitsEnum  fbk_conv_units,
const PidOutputUnitsEnum  out_conv_units 
)

Definition at line 958 of file ControlBoardHelper.cpp.

◆ toHw() [1/3]

void ControlBoardHelper::toHw ( const double *  usr,
double *  hwData 
)

Definition at line 266 of file ControlBoardHelper.cpp.

◆ toHw() [2/3]

void ControlBoardHelper::toHw ( const int *  usr,
int *  hwData 
)

Definition at line 273 of file ControlBoardHelper.cpp.

◆ toHw() [3/3]

int ControlBoardHelper::toHw ( int  axis)

Definition at line 245 of file ControlBoardHelper.cpp.

◆ toUser() [1/3]

void ControlBoardHelper::toUser ( const double *  hwData,
double *  user 
)

Definition at line 252 of file ControlBoardHelper.cpp.

◆ toUser() [2/3]

void yarp::dev::ControlBoardHelper::toUser ( const int *  hwData,
int *  user 
)

◆ toUser() [3/3]

int ControlBoardHelper::toUser ( int  axis)

Definition at line 248 of file ControlBoardHelper.cpp.

◆ trqN2S() [1/3]

void ControlBoardHelper::trqN2S ( const double *  newtons,
double *  sens 
)

Definition at line 338 of file ControlBoardHelper.cpp.

◆ trqN2S() [2/3]

double ControlBoardHelper::trqN2S ( double  newtons,
int  j 
)

Definition at line 332 of file ControlBoardHelper.cpp.

◆ trqN2S() [3/3]

void ControlBoardHelper::trqN2S ( double  newtons,
int  j,
double &  sens,
int &  k 
)

Definition at line 326 of file ControlBoardHelper.cpp.

◆ trqS2N() [1/3]

void ControlBoardHelper::trqS2N ( const double *  sens,
double *  newtons 
)

Definition at line 350 of file ControlBoardHelper.cpp.

◆ trqS2N() [2/3]

double ControlBoardHelper::trqS2N ( double  sens,
int  j 
)

Definition at line 367 of file ControlBoardHelper.cpp.

◆ trqS2N() [3/3]

void ControlBoardHelper::trqS2N ( double  sens,
int  j,
double &  newton,
int &  k 
)

Definition at line 361 of file ControlBoardHelper.cpp.

◆ velA2E() [1/3]

void ControlBoardHelper::velA2E ( const double *  ang,
double *  enc 
)

Definition at line 493 of file ControlBoardHelper.cpp.

◆ velA2E() [2/3]

double ControlBoardHelper::velA2E ( double  ang,
int  j 
)

Definition at line 403 of file ControlBoardHelper.cpp.

◆ velA2E() [3/3]

void ControlBoardHelper::velA2E ( double  ang,
int  j,
double &  enc,
int &  k 
)

Definition at line 397 of file ControlBoardHelper.cpp.

◆ velA2E_abs() [1/2]

void ControlBoardHelper::velA2E_abs ( const double *  ang,
double *  enc 
)

Definition at line 504 of file ControlBoardHelper.cpp.

◆ velA2E_abs() [2/2]

void ControlBoardHelper::velA2E_abs ( double  ang,
int  j,
double &  enc,
int &  k 
)

Definition at line 408 of file ControlBoardHelper.cpp.

◆ velE2A() [1/3]

void ControlBoardHelper::velE2A ( const double *  enc,
double *  ang 
)

Definition at line 515 of file ControlBoardHelper.cpp.

◆ velE2A() [2/3]

double ControlBoardHelper::velE2A ( double  enc,
int  j 
)

Definition at line 446 of file ControlBoardHelper.cpp.

◆ velE2A() [3/3]

void ControlBoardHelper::velE2A ( double  enc,
int  j,
double &  ang,
int &  k 
)

Definition at line 414 of file ControlBoardHelper.cpp.

◆ velE2A_abs() [1/3]

void ControlBoardHelper::velE2A_abs ( const double *  enc,
double *  ang 
)

Definition at line 526 of file ControlBoardHelper.cpp.

◆ velE2A_abs() [2/3]

double ControlBoardHelper::velE2A_abs ( double  enc,
int  j 
)

Definition at line 452 of file ControlBoardHelper.cpp.

◆ velE2A_abs() [3/3]

void ControlBoardHelper::velE2A_abs ( double  enc,
int  j,
double &  ang,
int &  k 
)

Definition at line 420 of file ControlBoardHelper.cpp.

◆ voltageS2V() [1/3]

void ControlBoardHelper::voltageS2V ( const double *  sens,
double *  voltage 
)

Definition at line 655 of file ControlBoardHelper.cpp.

◆ voltageS2V() [2/3]

double ControlBoardHelper::voltageS2V ( double  sens,
int  j 
)

Definition at line 672 of file ControlBoardHelper.cpp.

◆ voltageS2V() [3/3]

void ControlBoardHelper::voltageS2V ( double  sens,
int  j,
double &  voltage,
int &  k 
)

Definition at line 666 of file ControlBoardHelper.cpp.

◆ voltageV2S() [1/3]

void ControlBoardHelper::voltageV2S ( const double *  voltage,
double *  sens 
)

Definition at line 643 of file ControlBoardHelper.cpp.

◆ voltageV2S() [2/3]

double ControlBoardHelper::voltageV2S ( double  voltage,
int  j 
)

Definition at line 637 of file ControlBoardHelper.cpp.

◆ voltageV2S() [3/3]

void ControlBoardHelper::voltageV2S ( double  voltage,
int  j,
double &  sens,
int &  k 
)

Definition at line 631 of file ControlBoardHelper.cpp.


The documentation for this class was generated from the following files: