RcsPySim
A robot control and simulation library
Rcs::OMJointState Class Reference

#include <OMJointState.h>

Inheritance diagram for Rcs::OMJointState:
Collaboration diagram for Rcs::OMJointState:

Public Member Functions

 OMJointState (RcsGraph *graph, const char *jointName, bool wrapJointAngle)
 
 OMJointState (RcsGraph *graph, const char *jointName)
 
virtual ~OMJointState ()
 
virtual unsigned int getStateDim () const
 
virtual unsigned int getVelocityDim () const
 
virtual void computeObservation (double *state, double *velocity, const MatNd *currentAction, double dt) const
 
virtual void getLimits (double *minState, double *maxState, double *maxVelocity) const
 
virtual std::vector< std::string > getStateNames () const
 
- Public Member Functions inherited from Rcs::ObservationModel
virtual ~ObservationModel ()
 
MatNd * computeObservation (const MatNd *currentAction, double dt) const
 
void computeObservation (MatNd *observation, const MatNd *currentAction, double dt) const
 
virtual void reset ()
 
virtual std::vector< std::string > getVelocityNames () const
 
virtual void getMinMax (double *min, double *max) const final
 
virtual unsigned int getDim () const final
 
virtual std::vector< std::string > getNames () const final
 
template<typename OM >
OM * findModel ()
 
template<typename OM >
Offsets findOffsets ()
 
virtual std::vector< ObservationModel * > getNested () const
 
- Public Member Functions inherited from Rcs::BoxSpaceProvider
 BoxSpaceProvider ()
 
virtual ~BoxSpaceProvider ()
 
 BoxSpaceProvider (const BoxSpaceProvider &)=delete
 
BoxSpaceProvideroperator= (const BoxSpaceProvider &)=delete
 
 BoxSpaceProvider (BoxSpaceProvider &&)=delete
 
BoxSpaceProvideroperator= (BoxSpaceProvider &&)=delete
 
const BoxSpacegetSpace () const
 

Static Public Member Functions

static ObservationModelobserveAllJoints (RcsGraph *graph)
 
static ObservationModelobserveUnconstrainedJoints (RcsGraph *graph)
 

Private Member Functions

 OMJointState (RcsGraph *graph, RcsJoint *joint)
 

Private Attributes

RcsGraph * graph
 
RcsJoint * joint
 
bool wrapJointAngle
 

Detailed Description

Observes joint positions and velocities for a single joint.

Definition at line 42 of file OMJointState.h.

Constructor & Destructor Documentation

◆ OMJointState() [1/3]

Rcs::OMJointState::OMJointState ( RcsGraph *  graph,
const char *  jointName,
bool  wrapJointAngle 
)

Constructor

Parameters
graphgraph to observe
jointNamename of joint to observe
wrapJointAnglewhether to wrap the state of a rotational joint into the [-pi, pi] range. Use for unlimited rotation joints.

Definition at line 54 of file OMJointState.cpp.

◆ OMJointState() [2/3]

Rcs::OMJointState::OMJointState ( RcsGraph *  graph,
const char *  jointName 
)

Constructor Decides to wrap the joint angle if the joint's movement range is exactly [-pi, pi].

Parameters
graphgraph to observe
jointNamename of joint to observe

Definition at line 70 of file OMJointState.cpp.

◆ ~OMJointState()

Rcs::OMJointState::~OMJointState ( )
virtual

Definition at line 82 of file OMJointState.cpp.

◆ OMJointState() [3/3]

Rcs::OMJointState::OMJointState ( RcsGraph *  graph,
RcsJoint *  joint 
)
private

Definition at line 75 of file OMJointState.cpp.

Member Function Documentation

◆ computeObservation()

void Rcs::OMJointState::computeObservation ( double *  state,
double *  velocity,
const MatNd *  currentAction,
double  dt 
) const
virtual

Implement to fill the observation vector with the observed values.

Parameters
[out]statestate observation vector to fill, has getStateDim() elements.
[out]velocityvelocity observation vector to fill, has getVelocityDim() elements.
[in]currentActionaction in current step. May be NULL if not available.
[in]dttime step since the last observation has been taken

Implements Rcs::ObservationModel.

Definition at line 98 of file OMJointState.cpp.

◆ getLimits()

void Rcs::OMJointState::getLimits ( double *  minState,
double *  maxState,
double *  maxVelocity 
) const
virtual

Provides the minimum and maximum observable values. Since the velocity is symmetric, only the maximum needs to be provided. The default implementation uses -inf and inf.

Parameters
[out]minStateminimum state vector to fill, has getStateDim() elements.
[out]maxStatemaximum state vector to fill, has getStateDim() elements.
[out]maxVelocitymaximum velocity vector to fill, has getVelocityDim() elements.

Reimplemented from Rcs::ObservationModel.

Definition at line 108 of file OMJointState.cpp.

◆ getStateDim()

unsigned int Rcs::OMJointState::getStateDim ( ) const
virtual

The number of state variables.

Implements Rcs::ObservationModel.

Definition at line 88 of file OMJointState.cpp.

◆ getStateNames()

std::vector< std::string > Rcs::OMJointState::getStateNames ( ) const
virtual

Provides names for each state entry.

Returns
a vector of name strings. Must be of length getStateDim() or empty for a nameless space.

Reimplemented from Rcs::ObservationModel.

Definition at line 116 of file OMJointState.cpp.

◆ getVelocityDim()

unsigned int Rcs::OMJointState::getVelocityDim ( ) const
virtual

The number of velocity variables. The default implementation assumes that for each state there is a velocity.

Reimplemented from Rcs::ObservationModel.

Reimplemented in Rcs::OMJointStatePositions.

Definition at line 93 of file OMJointState.cpp.

◆ observeAllJoints()

ObservationModel * Rcs::OMJointState::observeAllJoints ( RcsGraph *  graph)
static

Definition at line 121 of file OMJointState.cpp.

◆ observeUnconstrainedJoints()

ObservationModel * Rcs::OMJointState::observeUnconstrainedJoints ( RcsGraph *  graph)
static

Definition at line 130 of file OMJointState.cpp.

Member Data Documentation

◆ graph

RcsGraph* Rcs::OMJointState::graph
private

Definition at line 85 of file OMJointState.h.

◆ joint

RcsJoint* Rcs::OMJointState::joint
private

Definition at line 87 of file OMJointState.h.

◆ wrapJointAngle

bool Rcs::OMJointState::wrapJointAngle
private

Definition at line 89 of file OMJointState.h.


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