WayPoint specialisation with joint (motor) angle storage format. More...
#include <waypoint.hpp>
Public Types | |
typedef Array< double > | JointDataArray |
A convenient typedef to the underlying storage array. | |
Public Member Functions | |
Array< double > & | accelerations () |
Handle to the joint angle accelerations array. | |
const Array< double > & | accelerations () const |
Array< double > & | angles () |
Handle to the joint angle array. | |
const Array< double > & | angles () const |
bool | approx (const WayPoint< JointAngles > &other, const double &epsilon=0.01) |
Approximately operator for waypoints. | |
unsigned int | dimension () const |
Return the waypoint dimension. | |
Array< double > & | nominalRates () |
Handle to the nominal angle rates array. | |
void | nominalRates (double nom_rate) |
Configures the nominal rates with a common value. | |
bool | operator!= (const WayPoint< JointAngles > &other) const |
Inequality operator for waypoints. | |
bool | operator== (const WayPoint< JointAngles > &other) const |
Equality operator for waypoints. | |
Array< double > & | rates () |
Handle to the joint angle rates array. | |
const Array< double > & | rates () const |
void | redimension (const unsigned int &dimension) |
WayPoint () | |
Default constructor. | |
WayPoint (const unsigned int &dimension) | |
Configures the waypoint for a specific dimension. | |
WayPoint (const WayPoint< JointAngles > &waypoint) | |
Copy constructor. | |
virtual | ~WayPoint () |
Public Attributes | |
Parameter< bool > | accelerations_configured |
Accelerations have been configured for this waypoint. | |
Parameter< double > | duration |
Timestamp for this waypoint. | |
Parameter< std::string > | name |
String name identifier. | |
Parameter< bool > | rates_configured |
Rates have been configured for this waypoint. | |
Private Attributes | |
JointDataArray | angle_accelerations |
JointDataArray | angle_positions |
JointDataArray | angle_rates |
JointDataArray | nominal_rates |
Friends | |
template<typename OutputStream > | |
OutputStream & | operator<< (OutputStream &ostream, WayPoint< JointAngles > &waypoint) |
Streaming output insertion operator for for waypoints. |
WayPoint specialisation with joint (motor) angle storage format.
This class can be used to store waypoints in joint/motor angle format. It is not especially useful for navigational waypoints, but often the only storage format required for robotic arm tasks. This is intended to be a very light class.
N | : no. of degrees of freedom for this waypoint. |
Definition at line 73 of file waypoint.hpp.
typedef Array<double> ecl::WayPoint< JointAngles >::JointDataArray |
A convenient typedef to the underlying storage array.
Definition at line 76 of file waypoint.hpp.
ecl::WayPoint< JointAngles >::WayPoint | ( | ) | [inline] |
Default constructor.
Configures the waypoint to be of zero dimension. Make sure you use the redimension function later to set the dimension.
Definition at line 88 of file waypoint.hpp.
ecl::WayPoint< JointAngles >::WayPoint | ( | const unsigned int & | dimension | ) | [inline] |
Configures the waypoint for a specific dimension.
Configuring the waypoint requires setting of many required and optional parameters, some of which are initialised at construction and some of which are later calculated. This is usually beyond the scope of defining a simple constructor (though a very simple configuration is deployed through the alternative constructor here). Consequently, manual configuration must be utilised if you use this constructor:
Waypoint<JointAngles> waypoint(4); waypoint.name("Raised Position"); // String identifier (not req'd). waypoint.nominalRates(1.0); // Sets a common nominal rate to the next waypoint. waypoint.nominalRates << 1.0, 1.0, 0.8, 0.8; // Sets specific angular rates to the next waypoint. waypoint.angles() << 1.57, 1.57, 0, 0; // Joint angle specification.
Angle rates and accelerations are currently only configured by the interpolation techniques that act on the waypoints. At some stage though, this may change if we want more flexible, higher order interpolating functionalities.
waypoint.rates() << 1.0, 1.0, 0.5, 0.5; // Joint angle rates specification. waypoint.accelerations() << 0.0, 0.0, 0.0, 0.0; // Joint angle accelerations specification. waypoint.duration(3.00); // Useful if you set a nominalRate of 0.0.
Definition at line 120 of file waypoint.hpp.
ecl::WayPoint< JointAngles >::WayPoint | ( | const WayPoint< JointAngles > & | waypoint | ) | [inline] |
virtual ecl::WayPoint< JointAngles >::~WayPoint | ( | ) | [inline, virtual] |
Definition at line 148 of file waypoint.hpp.
Array<double>& ecl::WayPoint< JointAngles >::accelerations | ( | ) | [inline] |
Handle to the joint angle accelerations array.
Supplies a handle to the joint angle accelerations array which can be used to set/modify joint angle acceleration information (can use the comma initialiser).
The joint angle accelerations represent the specified angular acceleration that must be attained as a trajectory moves through this waypoint. It is not always necessary depending on the type of interpolation being used (cubic spline vs quintic spline) and the location of the waypoint in the trajectory (boundary vs internal).
When using this method, the waypoint is flagged as having had its angular accelerations configured.
Note a convenient way to set the information is to use the comma initialiser of the underlying angle array:
waypoint.accelerations() = 1.0, 1.0, 0, 0;
Definition at line 254 of file waypoint.hpp.
const Array<double>& ecl::WayPoint< JointAngles >::accelerations | ( | ) | const [inline] |
Array<double>& ecl::WayPoint< JointAngles >::angles | ( | ) | [inline] |
Handle to the joint angle array.
Supplies a handle to the joint angle array which can be used to set/modify joint angle information (can use the comma initialiser).
Note a convenient way to set the angle information is to use the comma initialiser of the underlying angle array:
waypoint.angles() = 1.57, 1.57, 0, 0;
Definition at line 186 of file waypoint.hpp.
const Array<double>& ecl::WayPoint< JointAngles >::angles | ( | ) | const [inline] |
bool ecl::WayPoint< JointAngles >::approx | ( | const WayPoint< JointAngles > & | other, |
const double & | epsilon = 0.01 |
||
) | [inline] |
Approximately operator for waypoints.
This is useful as a quick check to see if one waypoint is very similar to another. It returns false if any individual angle difference (not the sum) is greater than the supplied epsilon.
other | : the waypoint to check against. |
epsilon | : approximate to this value of approximateness. |
Definition at line 346 of file waypoint.hpp.
unsigned int ecl::WayPoint< JointAngles >::dimension | ( | ) | const [inline] |
Return the waypoint dimension.
The number of joints used to compose the waypoint.
Definition at line 160 of file waypoint.hpp.
Array<double>& ecl::WayPoint< JointAngles >::nominalRates | ( | ) | [inline] |
Handle to the nominal angle rates array.
Supplies a handle to the nominal rates array which can be used to set/modify the individual nominal rates (can use the comma initialiser).
The nominal rates represent the recommended (which may be ignored by the interpolation method) average angular rate to be used over the ensuing segment until the next waypoint is reached.
Note a convenient way to set the values is to use the comma initialiser of the underlying array:
waypoint.nominalRates() = 1.00, 1.00, 0.60, 0.60;
Definition at line 284 of file waypoint.hpp.
void ecl::WayPoint< JointAngles >::nominalRates | ( | double | nom_rate | ) | [inline] |
Configures the nominal rates with a common value.
Configures the nominal angular rate the next segment of each joint to a common value.
nom_rate | : the blanket nominal angular rate to set for each joint. |
Definition at line 293 of file waypoint.hpp.
bool ecl::WayPoint< JointAngles >::operator!= | ( | const WayPoint< JointAngles > & | other | ) | const [inline] |
Inequality operator for waypoints.
This is useful as a quick check to see if one waypoint doesn't match another.
other | : the waypoint to check against. |
Definition at line 326 of file waypoint.hpp.
bool ecl::WayPoint< JointAngles >::operator== | ( | const WayPoint< JointAngles > & | other | ) | const [inline] |
Equality operator for waypoints.
This is useful as a quick check to see if one waypoint doesn't match another.
other | : the waypoint to check against. |
Definition at line 308 of file waypoint.hpp.
Array<double>& ecl::WayPoint< JointAngles >::rates | ( | ) | [inline] |
Handle to the joint angle rates array.
Supplies a handle to the joint angle rates array which can be used to set/modify joint angle rate information (can use the comma initialiser).
The joint angle rates represent the specified angular rate that must be attained as a trajectory moves through this waypoint. It is not always necessary depending on the type of interpolation being used (cubic spline vs quintic spline) and the location of the waypoint in the trajectory (boundary vs internal).
When using this method, the waypoint is flagged as having had its angular rates configured.
Note a convenient way to set the information is to use the comma initialiser of the underlying angle array:
waypoint.rates() << 1.0, 1.0, 0, 0;
I don't actually really like this - because we've actually got no real guarantee that the lazy bastard outside the class actually configured the values.
Definition at line 219 of file waypoint.hpp.
const Array<double>& ecl::WayPoint< JointAngles >::rates | ( | ) | const [inline] |
void ecl::WayPoint< JointAngles >::redimension | ( | const unsigned int & | dimension | ) | [inline] |
dimension |
Definition at line 166 of file waypoint.hpp.
OutputStream& operator<< | ( | OutputStream & | ostream, |
WayPoint< JointAngles > & | waypoint | ||
) | [friend] |
Streaming output insertion operator for for waypoints.
Streaming output insertion operator for waypoints.
OutputStream | : the type of stream being used. |
ostream | : the output stream being used. |
waypoint | : the waypoint. |
Definition at line 392 of file waypoint.hpp.
Accelerations have been configured for this waypoint.
Definition at line 378 of file waypoint.hpp.
JointDataArray ecl::WayPoint< JointAngles >::angle_accelerations [private] |
Definition at line 383 of file waypoint.hpp.
JointDataArray ecl::WayPoint< JointAngles >::angle_positions [private] |
Definition at line 381 of file waypoint.hpp.
JointDataArray ecl::WayPoint< JointAngles >::angle_rates [private] |
Definition at line 382 of file waypoint.hpp.
Parameter<double> ecl::WayPoint< JointAngles >::duration |
Timestamp for this waypoint.
Definition at line 376 of file waypoint.hpp.
Parameter<std::string> ecl::WayPoint< JointAngles >::name |
String name identifier.
Definition at line 375 of file waypoint.hpp.
JointDataArray ecl::WayPoint< JointAngles >::nominal_rates [private] |
Definition at line 384 of file waypoint.hpp.
Parameter<bool> ecl::WayPoint< JointAngles >::rates_configured |
Rates have been configured for this waypoint.
Definition at line 377 of file waypoint.hpp.