#include <State.hpp>
Public Types | |
enum | compare_flags_t { COMPARE_ACQUISITION_TIME = 0x1, COMPARE_POSITION = 0x2, COMPARE_VELOCITY = 0x4, COMPARE_FORCE = 0x8, COMPARE_ALL = 0xf } |
Public Member Functions | |
State () | |
State (State const &orig) | |
State (size_t npos, size_t nvel, size_t nforce) | |
void | init (size_t npos, size_t nvel, size_t nforce) |
Resizes and zeros-out position_, velocity_, and force_ to the desired lengths. | |
void | resizeAndPadWithZeros (size_t npos, size_t nvel, size_t nforce) |
Resize position_, velocity_, and force_ to the desired lengths and, if necessary, pad them with zeros. | |
bool | equal (State const &rhs, int flags=COMPARE_POSITION|COMPARE_VELOCITY, double precision=1e-3) const |
Compares two states for equality. | |
State & | operator= (State const &rhs) |
Public Attributes | |
size_t | time_sec_ |
size_t | time_usec_ |
Vector | position_ |
Vector | velocity_ |
Vector | force_ |
Definition at line 33 of file State.hpp.
jspace::State::State | ( | ) |
jspace::State::State | ( | size_t | npos, | |
size_t | nvel, | |||
size_t | nforce | |||
) |
void jspace::State::init | ( | size_t | npos, | |
size_t | nvel, | |||
size_t | nforce | |||
) |
Resizes and zeros-out position_, velocity_, and force_ to the desired lengths.
Also sets the timestamp to zero.
Definition at line 56 of file State.cpp.
References force_, position_, time_sec_, time_usec_, and velocity_.
Referenced by tutsim::run(), and State().
void jspace::State::resizeAndPadWithZeros | ( | size_t | npos, | |
size_t | nvel, | |||
size_t | nforce | |||
) |
Resize position_, velocity_, and force_ to the desired lengths and, if necessary, pad them with zeros.
Neither the existing values nor the timestamp get modified by this method.
Definition at line 95 of file State.cpp.
References jspace::_pad(), force_, position_, and velocity_.
bool jspace::State::equal | ( | State const & | rhs, | |
int | flags = COMPARE_POSITION | COMPARE_VELOCITY , |
|||
double | precision = 1e-3 | |||
) | const |
Compares two states for equality.
You can specify which aspects of the state should be considered relevant, and also a precision for comparing floating point values.
Definition at line 119 of file State.cpp.
References jspace::compare(), COMPARE_ACQUISITION_TIME, COMPARE_FORCE, COMPARE_POSITION, COMPARE_VELOCITY, force_, position_, time_sec_, time_usec_, and velocity_.
size_t jspace::State::time_sec_ |
size_t jspace::State::time_usec_ |
Definition at line 80 of file State.hpp.
Referenced by jspace::JointGoalController::computeCommand(), equal(), init(), jspace::GoalControllerBase::init(), jspace::JointGoalController::latch(), operator=(), read_state_from_tree(), resizeAndPadWithZeros(), servo_cb(), and write_state_to_tree().
Definition at line 81 of file State.hpp.
Referenced by jspace::JointGoalController::computeCommand(), equal(), init(), operator=(), read_state_from_tree(), resizeAndPadWithZeros(), servo_cb(), tut05::PTask::updateStateAndJacobian(), and write_state_to_tree().
Definition at line 82 of file State.hpp.
Referenced by equal(), init(), operator=(), read_state_from_tree(), and resizeAndPadWithZeros().