SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | List of all members
jspace::State Class Reference

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 const &orig)
 
 State (size_t npos, size_t nvel, size_t nforce)
 
void init (size_t npos, size_t nvel, size_t nforce)
 
void resizeAndPadWithZeros (size_t npos, size_t nvel, size_t nforce)
 
bool equal (State const &rhs, int flags=COMPARE_POSITION|COMPARE_VELOCITY, double precision=1e-3) const
 
Stateoperator= (State const &rhs)
 

Public Attributes

size_t time_sec_
 
size_t time_usec_
 
Eigen::VectorXd position_
 
Eigen::VectorXd velocity_
 
Eigen::VectorXd force_
 

Member Function Documentation

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.

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.

Note
This method is intended as a cheap way to avoid segfaults when feeding user-provided data to jspace::Model::update() or similar. In a "real" application, your State and Model should definitely be guaranteed to agree on the dimensions of position_, velocity_, and force_.

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