TwiceAsNice
2019-02-18
|
External MoCon profile: Representation of a trajectory as list of parameterized segments. More...
#include <Profile.h>
Classes | |
struct | Segment |
Single segment of a MoCon profile. More... | |
Public Member Functions | |
MoConModuleProfile () | |
Defining the following macro lets the software merge consecutive segments to avoid zero velocities This tries to patch the fact that otherwise the MOCON may (?) create an event that this basda-mocca client software regards as the completion of a trajectory. More... | |
~MoConModuleProfile () | |
void | setExternalProfileMaxSamplesPerSegment (unsigned int _maxSamplesPerSegment) |
void | setExternalProfileMinSamplesPerSegment (unsigned int _minSamplesPerSegment) |
void | setExternalProfileFaultTolerance (unsigned int _maxError) |
unsigned int | fitExternalProfile (Nice::Date _date, Nice::I64 _startCycle, std::vector< Nice::PointVar > &_trajectory, double _cycleTime) |
unsigned int | getExternalProfileSize () |
void | getExternalProfile (int _index, int &_position, int &_velocity, int &_acceleration, int &_jerk, int &_numberOfCycles) |
std::vector< Segment > | getExternalProfile () |
MoConModuleProfile () | |
~MoConModuleProfile () | |
void | setExternalProfileMaxSamplesPerSegment (unsigned int _maxSamplesPerSegment) |
void | setExternalProfileMinSamplesPerSegment (unsigned int _minSamplesPerSegment) |
void | setExternalProfileFaultTolerance (unsigned int _maxError) |
unsigned int | fitExternalProfile (Nice::Date _date, Nice::I64 _startCycle, std::vector< Nice::PointVar > &_trajectory, double _cycleTime) |
unsigned int | getExternalProfileSize () |
void | getExternalProfile (int _index, int &_position, int &_velocity, int &_acceleration, int &_jerk, int &_numberOfCycles) |
std::vector< Segment > | getExternalProfile () |
Private Member Functions | |
void | calcMaxDeviation (unsigned int _segmentStart, Segment _segment, double &_position, double &_velocity, double &_acceleration, double &_jerk, int &_numberOfCycles) |
calculates the biggest deviation between the input and fitted trajectory. More... | |
void | calcMaxDeviation (unsigned int _segmentStart, Segment _segment, double &_position, double &_velocity, double &_acceleration, double &_jerk, int &_numberOfCycles) |
Static Private Member Functions | |
static void | basePol3 (const double _x, boost::numeric::ublas::vector< double > &_afunc) |
Basis functions for a degree 3 polynomial. More... | |
static void | basePol3 (const double _x, boost::numeric::ublas::vector< double > &_afunc) |
Private Attributes | |
std::vector< Nice::PointVar > | m_trajectory |
Type of a full MoCon trajectory (in steps or counts and cycles) that is to be transfered to a mocon profile. More... | |
std::vector< Segment > | m_profile |
The MoCon profile vector consist of segments. More... | |
unsigned int | m_faultTolerance |
Fault Tolerance in steps (counts). More... | |
unsigned int | m_maxSamplesPerSegment |
The number of points on the trajectory that should be represented by a single polynomial. More... | |
unsigned int | m_minSamplesPerSegment |
double | m_deviation |
double | m_maxDeviation |
External MoCon profile: Representation of a trajectory as list of parameterized segments.
A MoCon profile uses degree 3 polynomials to describe each segment of a motor trajectory. The Coefficients of the polynomials represent time, position, velocity, acceleration, and jerk.
The time defines when the next trajectory point will be loaded. The position of the next trajectory point have to be the same as the current position point. The next acceleration, velocity and jerk values define the next movement.
The position of the first trajectory point have to be the start position. If it is not the start position the MoCon will do a jump which can introduce errors.
The position value of the next trajectory point must be the same as the current position value. Which means the position value of the next trajectory point defines the current
This class
soon: provides a method to change the current trajectory
soon: deals with the UTC start time for the profile. Needed for absolute time trajectories.
A MoCon profile uses degree 3 polynomials to describe each segment of a motor trajectory. The Coefficients of the polynomials represent time, position, velocity, acceleration, and jerk.
The time defines when the next trajectory point will be loaded. The position of the next trajectory point have to be the same as the current position point. The next acceleration, velocity and jerk values define the next movement.
The position of the first trajectory point have to be the start position. If it is not the start position the MoCon will do a jump which can introduce errors.
The position value of the next trajectory point must be the same as the current position value. Which means the position value of the next trajectory point defines the current
This class
soon: provides a method to change the current trajectory
soon: deals with the UTC start time for the profile. Needed for absolute time trajectories.
Basda::MoConModuleProfile::MoConModuleProfile | ( | ) |
Defining the following macro lets the software merge consecutive segments to avoid zero velocities This tries to patch the fact that otherwise the MOCON may (?) create an event that this basda-mocca client software regards as the completion of a trajectory.
Basda::MoConModuleProfile::~MoConModuleProfile | ( | ) |
Basda::MoConModuleProfile::MoConModuleProfile | ( | ) |
Basda::MoConModuleProfile::~MoConModuleProfile | ( | ) |
|
staticprivate |
Basis functions for a degree 3 polynomial.
Function provided to the LNMath function lfit within ProfiFit()
[in] | _x | Value onthe abscissa |
[out] | _afunc | returns a constant 1 for index 0, _x scaled by a factor 2^16 for index 1 and so on. |
|
staticprivate |
|
private |
calculates the biggest deviation between the input and fitted trajectory.
Calculates also m_deviation, the deviation between fit and requested position at the end of the segment.
|
private |
unsigned int Basda::MoConModuleProfile::fitExternalProfile | ( | Nice::Date | _date, |
Nice::I64 | _startCycle, | ||
std::vector< Nice::PointVar > & | _trajectory, | ||
double | _cycleTime | ||
) |
unsigned int Basda::MoConModuleProfile::fitExternalProfile | ( | Nice::Date | _date, |
Nice::I64 | _startCycle, | ||
std::vector< Nice::PointVar > & | _trajectory, | ||
double | _cycleTime | ||
) |
void Basda::MoConModuleProfile::getExternalProfile | ( | int | _index, |
int & | _position, | ||
int & | _velocity, | ||
int & | _acceleration, | ||
int & | _jerk, | ||
int & | _numberOfCycles | ||
) |
void Basda::MoConModuleProfile::getExternalProfile | ( | int | _index, |
int & | _position, | ||
int & | _velocity, | ||
int & | _acceleration, | ||
int & | _jerk, | ||
int & | _numberOfCycles | ||
) |
std::vector< Basda::MoConModuleProfile::Segment > Basda::MoConModuleProfile::getExternalProfile | ( | ) |
std::vector<Segment> Basda::MoConModuleProfile::getExternalProfile | ( | ) |
unsigned int Basda::MoConModuleProfile::getExternalProfileSize | ( | ) |
unsigned int Basda::MoConModuleProfile::getExternalProfileSize | ( | ) |
void Basda::MoConModuleProfile::setExternalProfileFaultTolerance | ( | unsigned int | _maxError | ) |
void Basda::MoConModuleProfile::setExternalProfileFaultTolerance | ( | unsigned int | _maxError | ) |
void Basda::MoConModuleProfile::setExternalProfileMaxSamplesPerSegment | ( | unsigned int | _maxSamplesPerSegment | ) |
void Basda::MoConModuleProfile::setExternalProfileMaxSamplesPerSegment | ( | unsigned int | _maxSamplesPerSegment | ) |
void Basda::MoConModuleProfile::setExternalProfileMinSamplesPerSegment | ( | unsigned int | _minSamplesPerSegment | ) |
void Basda::MoConModuleProfile::setExternalProfileMinSamplesPerSegment | ( | unsigned int | _minSamplesPerSegment | ) |
|
private |
|
private |
Fault Tolerance in steps (counts).
This is the maximum acceptable deviation of the fitted trajectory from the input trajectory. The deviation is determined for each specified point in the input trajectory.
|
private |
|
private |
The number of points on the trajectory that should be represented by a single polynomial.
Each n*samplesPerSegment point will be a knot on the piecewise polynomial The sampling will be reduced, if the fitted polynomial of the corresponding segment cannot be fitted accurately enough.
|
private |
|
private |
The MoCon profile vector consist of segments.
|
private |