25 template <
size_t NJOINTS,
size_t ACT_STATE_DIM = 0,
typename SCALAR =
double>
29 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
35 static const size_t NDOF = NJOINTS;
36 static const size_t NSTATE = 2 * NJOINTS + ACT_STATE_DIM;
60 jointState.
getPositions() = robotState.template head<NJOINTS>();
61 jointState.
getVelocities() = robotState.template segment<NJOINTS>(NJOINTS);
88 robotState.template head<2 * NJOINTS>() = jointState.template head<2 * NJOINTS>();
89 robotState.template tail<ACT_STATE_DIM>() = x_act;
112 template <
typename T =
void>
119 template <
typename T =
void>
124 act_state_ = robotState.template tail<ACT_STATE_DIM>();
128 template <
typename T = state_vector_t>
129 typename std::enable_if<(ACT_STATE_DIM == 0), T>::type
toStateVector()
const 136 template <
typename T = state_vector_t>
142 robotState.template tail<ACT_STATE_DIM>() =
act_state_;
RigidBodyPose_t & basePose()
get base pose
Definition: RBDState.h:67
std::enable_if<(ACT_STATE_DIM==0), T >::type toStateVector() const
conversion from RobotState to dense state vector
Definition: FixBaseRobotState.h:129
tpl::RigidBodyPose< SCALAR > RigidBodyPose_t
Definition: FixBaseRobotState.h:31
static const size_t NSTATE
Definition: FixBaseRobotState.h:36
static const actuator_state_vector_t actuatorStateFromVector(const state_vector_t &robotState)
transform full robot state to a actuator state (static)
Definition: FixBaseRobotState.h:77
Pose of a single rigid body.
Definition: RigidBodyPose.h:29
joint state and joint velocity
Definition: JointState.h:21
static const JointState_t jointStateFromVector(const state_vector_t &robotState)
full state vector to JointState (static)
Definition: FixBaseRobotState.h:57
const JointState_t & joints() const
accessor to joint state
Definition: FixBaseRobotState.h:104
std::enable_if<(ACT_STATE_DIM > 0), T >::type toStateVector() const
Definition: FixBaseRobotState.h:137
joint states and base states
Definition: RBDState.h:27
std::enable_if<(ACT_STATE_DIM==0), T >::type fromStateVector(const state_vector_t &robotState)
conversion from dense state vector to a RobotState
Definition: FixBaseRobotState.h:113
FixBaseRobotState(const FixBaseRobotState &other)
constructor
Definition: FixBaseRobotState.h:53
SCALAR & actuatorState(size_t i)
accessor to single element of actuator state
Definition: FixBaseRobotState.h:98
FixBaseRobotState()
constructor
Definition: FixBaseRobotState.h:42
actuator_state_vector_t & actuatorState()
accessor to actuator state
Definition: FixBaseRobotState.h:94
FixBaseRobotState(const JointState_t &joints, const actuator_state_vector_t &actState=actuator_state_vector_t::Zero())
constructor
Definition: FixBaseRobotState.h:44
CppAD::AD< CppAD::cg::CG< double > > SCALAR
const SCALAR & actuatorState(size_t i) const
accessor to single element of actuator state
Definition: FixBaseRobotState.h:100
JointPositionBlock getVelocities()
get joint velocity
Definition: JointState.h:131
RBDState_t toRBDState(const RigidBodyPose_t &basePose=RigidBodyPose_t())
transform full robot state to RBDState
Definition: FixBaseRobotState.h:147
static const size_t NDOF
Definition: FixBaseRobotState.h:35
std::enable_if<(ACT_STATE_DIM > 0), T >::type fromStateVector(const state_vector_t &robotState)
Definition: FixBaseRobotState.h:120
void setZero()
Definition: FixBaseRobotState.h:105
whole fix base robot state, i.e. Joint state, Actuator Dynamics (and fix-base pose) ...
Definition: FixBaseRobotState.h:26
static const state_vector_t toFullState(const ct::core::StateVector< 2 *NJOINTS, SCALAR > &jointState, const actuator_state_vector_t &x_act=actuator_state_vector_t::Zero())
transform from joint and actuator state to full state
Definition: FixBaseRobotState.h:84
~FixBaseRobotState()
destructor
Definition: FixBaseRobotState.h:55
JointState_t joints_
the joint state
Definition: FixBaseRobotState.h:158
void setZero()
set states to zero
Definition: JointState.h:164
const actuator_state_vector_t & actuatorState() const
accessor to actuator state
Definition: FixBaseRobotState.h:96
static const RBDState_t rbdStateFromVector(const state_vector_t &robotState, const RigidBodyPose_t &basePose=RigidBodyPose_t())
transform full robot state to RBDState (static)
Definition: FixBaseRobotState.h:66
JointState< NJOINTS, SCALAR > & joints()
get joint states
Definition: RBDState.h:94
JointPositionBlock getPositions()
get joint state
Definition: JointState.h:76
void setZero()
Definition: RBDState.h:198
JointState_t & joints()
accessor to joint state
Definition: FixBaseRobotState.h:102
FixBaseRobotState(const state_vector_t &robotState)
constructor
Definition: FixBaseRobotState.h:51
actuator_state_vector_t act_state_
the actuator state vector
Definition: FixBaseRobotState.h:160