14 #ifndef ECL_MANIPULATORS_WAYPOINT_HPP_ 15 #define ECL_MANIPULATORS_WAYPOINT_HPP_ 45 template<enum ManipulatorAngleType Type = Jo
intAngles>
91 rates_configured(false),
92 accelerations_configured(false)
123 rates_configured(false),
124 accelerations_configured(false),
125 angle_positions(JointDataArray::Constant(dimension,0.0)),
126 angle_rates(JointDataArray::Constant(dimension,0.0)),
127 angle_accelerations(JointDataArray::Constant(dimension,0.0)),
128 nominal_rates(JointDataArray::Constant(dimension,1.00))
138 name(waypoint.name()),
139 duration(waypoint.duration()),
140 rates_configured(waypoint.rates_configured()),
141 accelerations_configured(waypoint.accelerations_configured()),
142 angle_positions(waypoint.angle_positions),
143 angle_rates(waypoint.angle_rates),
144 angle_accelerations(waypoint.angle_accelerations),
145 nominal_rates(waypoint.nominal_rates)
160 unsigned int dimension()
const {
return angle_positions.size(); }
167 angle_positions = JointDataArray::Constant(dimension,0.0);
168 angle_rates = JointDataArray::Constant(dimension,0.0);
169 angle_accelerations = JointDataArray::Constant(dimension,0.0);
170 nominal_rates = JointDataArray::Constant(dimension,0.0);
220 rates_configured(
true);
255 accelerations_configured(
true);
256 return angle_accelerations;
263 return angle_accelerations;
294 for (
unsigned int i = 0; i < nominal_rates.size(); ++i) {
295 nominal_rates[i] = nom_rate;
309 for (
unsigned int i = 0; i < angle_positions.size(); ++i ) {
327 for (
unsigned int i = 0; i < angle_positions.size(); ++i ) {
347 for (
unsigned int i = 0; i < angle_positions.size(); ++i ) {
348 if ( std::fabs(angle_positions[i] - other.
angle_positions[i]) > epsilon ) {
369 template <
typename OutputStream>
370 friend OutputStream& operator << (OutputStream &ostream, WayPoint<JointAngles> &waypoint);
391 template <
typename OutputStream>
392 OutputStream& operator << (OutputStream &ostream, WayPoint<JointAngles> &waypoint) {
395 if ( waypoint.name() !=
"" ) {
396 ostream <<
" Name : " << waypoint.name() <<
"\n";
398 ostream <<
" Angles : " << format(waypoint.angle_positions) <<
"\n";
399 if (waypoint.rates_configured()) {
400 ostream <<
" Rates : " << format(waypoint.angle_rates) <<
"\n";
402 if (waypoint.accelerations_configured()) {
403 ostream <<
" Accelerations : " << format(waypoint.angle_accelerations) <<
"\n";
405 ostream <<
" Nominal Rates : " << format(waypoint.nominal_rates) <<
"\n";
void nominalRates(double nom_rate)
Configures the nominal rates with a common value.
const Array< double > & angles() const
JointDataArray nominal_rates
Array< double > & nominalRates()
Handle to the nominal angle rates array.
Primary template for waypoints.
bool operator==(const WayPoint< JointAngles > &other) const
Equality operator for waypoints.
bool operator!=(const WayPoint< JointAngles > &other) const
Inequality operator for waypoints.
Parameter< bool > accelerations_configured
Accelerations have been configured for this waypoint.
Type definitions for manipulators.
Parameter< std::string > name
String name identifier.
bool approx(const WayPoint< JointAngles > &other, const double &epsilon=0.01)
Approximately operator for waypoints.
WayPoint(const WayPoint< JointAngles > &waypoint)
Copy constructor.
WayPoint()
Default constructor.
WayPoint(const unsigned int &dimension)
Configures the waypoint for a specific dimension.
void redimension(const unsigned int &dimension)
WayPoint()
Unreachable constructor.
Parameter< bool > rates_configured
Rates have been configured for this waypoint.
Parameter< double > duration
Timestamp for this waypoint.
Array< double > & angles()
Handle to the joint angle array.
const Array< double > & rates() const
Array< double > JointDataArray
A convenient typedef to the underlying storage array.
unsigned int dimension() const
Return the waypoint dimension.
JointDataArray angle_accelerations
const Array< double > & accelerations() const
Array< double > & rates()
Handle to the joint angle rates array.
JointDataArray angle_rates
JointDataArray angle_positions
WayPoint specialisation with joint (motor) angle storage format.
Joint angle representations are being used.
Array< double > & accelerations()
Handle to the joint angle accelerations array.