RcsPySim
A robot control and simulation library
Rcs Namespace Reference

Classes

class  ActionModel
 
class  ActionModelIK
 
class  AMDynamicalSystemActivation
 
class  AMIKControllerActivation
 
class  AMIKGeneric
 
class  AMIntegrate1stOrder
 
class  AMIntegrate2ndOrder
 
class  AMJointControl
 
class  AMJointControlAcceleration
 
class  AMJointControlPosition
 
class  AMNormalized
 
class  AMPlateAngPos
 
class  AMPlatePos5D
 
struct  BodyParamInfo
 
class  BoxSpace
 
class  BoxSpaceProvider
 
class  ComponentViewer
 
class  ControlPolicy
 
class  ControlPolicyRegistration
 
class  DataLogger
 
class  DSConst
 
class  DSLinear
 
class  DSMassSpringDamper
 
class  DSMassSpringDamperNonlinear
 
class  DSSecondOrder
 
class  DSSlice
 
class  DynamicalSystem
 
class  ECBallInTube
 
class  ECBallOnPlate
 
class  ECBoxLifting
 
class  ECBoxShelving
 
class  ECMiniGolf
 
class  ECMPblending
 
class  ECPlanar3Link
 
class  ECPlanarInsert
 
class  ECQuanserQube
 
class  EmptyPropertySource
 
class  ExperimentConfig
 
class  ExperimentConfigRegistration
 
class  ForceDisturber
 
class  InitStateSetter
 
class  ISSBallInTube
 
class  ISSBallOnPlate
 
class  ISSBoxLifting
 
class  ISSBoxShelving
 
class  ISSMiniGolf
 
class  ISSMPBlending
 
class  ISSPlanar3Link
 
class  ISSPlanarInsert
 
class  ISSQuanserQube
 
class  JointLimitException
 
class  LockedFTS
 
class  ObservationModel
 
class  OMBallPos
 
class  OMBodyStateAngular
 
class  OMBodyStateAngularPositions
 
class  OMBodyStateLinear
 
class  OMBodyStateLinearPositions
 
class  OMCollisionCost
 
class  OMCollisionCostPrediction
 
class  OMCombined
 
class  OMComputedVelocity
 
class  OMDynamicalSystemDiscrepancy
 
class  OMDynamicalSystemGoalDistance
 
class  OMForceTorque
 
class  OMJointState
 
class  OMJointStatePositions
 
class  OMManipulabilityIndex
 
class  OMNormalized
 
class  OMPartial
 
class  OMTask
 
class  OMTaskPositions
 
class  OMTaskSpaceDiscrepancy
 
class  PhysicsParameterDescriptor
 
class  PhysicsParameterManager
 
class  PhysicsSimulationComponent
 
class  PolicyComponent
 
class  PPDBodyOrientation
 
class  PPDBodyPosition
 
class  PPDBoxExtents
 
class  PPDCompound
 
class  PPDCubeExtents
 
class  PPDMassProperties
 
class  PPDMaterialProperties
 
class  PPDRodLength
 
class  PPDSingleVar
 
class  PPDSphereRadius
 
class  PropertySink
 
class  PropertySource
 
class  PropertySourceDict
 
class  PropertySourceXml
 
class  RcsPyBot
 
class  RcsSimEnv
 
class  SimpleControlPolicy
 
class  TorchPolicy
 
class  ViewerComponent
 

Typedefs

using IndexList = OMPartial::IndexList
 
template<typename M >
using MatNdMappable = typename std::conditional< M::IsRowMajor||M::IsVectorAtCompileTime, M, Eigen::Matrix< typename M::Scalar, M::RowsAtCompileTime, M::ColsAtCompileTime, Eigen::RowMajor > >::type
 

Enumerations

enum  TaskCombinationMethod { TaskCombinationMethod::Sum, TaskCombinationMethod::Mean, TaskCombinationMethod::SoftMax, TaskCombinationMethod::Product }
 
enum  IntMode { IntMode::ForwardEuler, IntMode::BackwardEuler, IntMode::SymplecticEuler }
 

Functions

void MatNd_fabsClipEleSelf (MatNd *self, double negUpperBound, double posLowerBound)
 
MatNd * MatNd_signs (const MatNd *src)
 
static bool getMatrixProperty (Eigen::MatrixXd &out, PropertySource *ps, const char *property, unsigned int expectedRows, unsigned int expectedCols)
 
static bool getVectorProperty (Eigen::VectorXd &out, PropertySource *ps, const char *property, unsigned int expectedSize)
 
 for (auto &name :actionSpace->getNames())
 
static void copy_prop_to_xml_attr (xmlNodePtr node, PropertySource *source, const char *name, const char *xmlName=nullptr)
 
RcsCollisionMdl * RcsCollisionModel_createFromConfig (RcsGraph *graph, PropertySource *config)
 
static bool defaultWrapJointAngle (RcsJoint *joint)
 
static IndexList loadIndexList (IndexList input, unsigned int dim, bool exclude, const char *category)
 
static IndexList loadMask (const std::vector< bool > &mask, unsigned int dim, bool exclude, const char *category)
 
template<typename T >
static void apply (T &partial, const T &full, const std::vector< unsigned int > &keptIndices)
 
void Vec33d_setZero (double v[3][3])
 
void Vec33d_add (double dst[3][3], const double v1[3][3], const double v2[3][3])
 
void setVortexLogLevel (const char *level)
 
static void initDefaultNames (std::vector< std::string > &out, unsigned int dim)
 
template<typename M >
MatNd viewEigen2MatNd (M &src)
 
template<typename M = Eigen::MatrixXd>
Eigen::Map< MatNdMappable< M > > viewMatNd2Eigen (MatNd *src)
 
template<typename M = Eigen::MatrixXd>
Eigen::Map< const MatNdMappable< M > > viewMatNd2Eigen (const MatNd *src)
 
template<typename M >
void copyMatNd2Eigen (M &dst, const MatNd *src)
 
template<typename M >
void copyEigen2MatNd (MatNd *dst, const M &src)
 
void intStep2ndOrder (MatNd *x, MatNd *xd, const MatNd *xdd, double dt, IntMode mode)
 
void intStep1stOrder (MatNd *x, const MatNd *xd_0, const MatNd *xd_T, double dt, IntMode mode)
 
template<typename ... Args>
std::string string_format (const std::string &format, Args ... args)
 
static std::string spaceJoinedString (py::handle iterable)
 
static xmlNodePtr dict2xml (const py::dict &data, xmlDocPtr doc, const char *nodeName)
 

Variables

const unsigned int PLATE_TASK_DIM = 6
 
static std::map< std::string, ControlPolicy::ControlPolicyCreateFunctionregistry
 
static ControlPolicyRegistration< TorchPolicyRegTorchPolicy ("torch")
 
static ExperimentConfigRegistration< ECBallInTubeRegBallInTube ("BallInTube")
 
static ExperimentConfigRegistration< ECBallOnPlateRegBallOnPlate ("BallOnPlate")
 
static ExperimentConfigRegistration< ECBoxLiftingRegBoxLifting ("BoxLifting")
 
static ExperimentConfigRegistration< ECBoxShelvingRegBoxShelving ("BoxShelving")
 
static ExperimentConfigRegistration< ECMiniGolfRegMiniGolf ("MiniGolf")
 
static ExperimentConfigRegistration< ECMPblendingRegMPBlending ("MPBlending")
 
static ExperimentConfigRegistration< ECPlanar3LinkRegPlanar3Link ("Planar3Link")
 
static ExperimentConfigRegistration< ECPlanarInsertRegPlanarInsert ("PlanarInsert")
 
static ExperimentConfigRegistration< ECQuanserQubeRegQuanserQube ("QuanserQube")
 
static std::map< std::string, ExperimentConfig::ExperimentConfigCreateFunctionregistry
 
static const char * extended_xml_material_props []
 

Detailed Description

Value freeRatio is the ratio of the joint's half range in which the joint limit gradient kicks in. For instance if freeRatio is 1, the whole joint range is without gradient. If freeRatio is 0, the gradient follows a quadratic cost over the whole range.

Value freeRange is the range starting from q0, where the gradient is 0. The value penaltyRange is the range where the gradient is not 0. Here is an illustration:

q_lowerLimit q_lowerRange q_0 q_upperRange q_upperLimit | | | | | | | | | | __________________/__________/____________/_______________/ a b c d

freeRatio: b/(a+b) c/(c+d) freeRange: b c penaltyRange: a d

cost = q in a: 0.5 * wJL * ((q-q_lowerRange)/a)^2 => c(limit) = 0.5*wJL q in b: 0 q in c: 0 q in d: 0.5 * wJL * ((q-q_upperRange)/d)^2 => c(limit) = 0.5*wJL

gradient = q in a: (q-q_lowerRange)*wJL/a^2 => grad(limit) = 0.5*wJL/a q in b: 0 q in c: 0 q in d: (q-q_upperRange)*wJL/a^2 => grad(limit) = 0.5*wJL/d

For the default case wJL=1 and freeRange=0, we get: dH_i = 0.5/halfRange and for symmetric joint centers, we get: dH_i = 1.0/range If we interpret it as a velocity, it's the inverse of the joint range.

Typedef Documentation

◆ IndexList

Definition at line 41 of file OMPartial.cpp.

◆ MatNdMappable

template<typename M >
using Rcs::MatNdMappable = typedef typename std::conditional< M::IsRowMajor || M::IsVectorAtCompileTime, M, Eigen::Matrix< typename M::Scalar, M::RowsAtCompileTime, M::ColsAtCompileTime, Eigen::RowMajor> >::type

Definition at line 74 of file eigen_matnd.h.

Enumeration Type Documentation

◆ IntMode

enum Rcs::IntMode
strong

Integration mode.

Enumerator
ForwardEuler 
BackwardEuler 
SymplecticEuler 

Definition at line 42 of file integrator.h.

◆ TaskCombinationMethod

Combination method for tasks a.k.a. movement primitives Determines how the contribution of each task is scaled with its activation.

Enumerator
Sum 
Mean 
SoftMax 
Product 

Definition at line 46 of file ActionModel.h.

Function Documentation

◆ apply()

template<typename T >
static void Rcs::apply ( T &  partial,
const T &  full,
const std::vector< unsigned int > &  keptIndices 
)
static

Definition at line 182 of file OMPartial.cpp.

◆ copy_prop_to_xml_attr()

static void Rcs::copy_prop_to_xml_attr ( xmlNodePtr  node,
PropertySource source,
const char *  name,
const char *  xmlName = nullptr 
)
inlinestatic

Definition at line 54 of file ExperimentConfig.cpp.

◆ copyEigen2MatNd()

template<typename M >
void Rcs::copyEigen2MatNd ( MatNd *  dst,
const M &  src 
)

Copy a matrix from Eigen to Rcs.

Template Parameters
Meigen matrix type
Parameters
dstdestination rcs matrix
srcsource eigen matrix

Definition at line 132 of file eigen_matnd.h.

◆ copyMatNd2Eigen()

template<typename M >
void Rcs::copyMatNd2Eigen ( M &  dst,
const MatNd *  src 
)

Copy a matrix from Rcs to Eigen.

Template Parameters
Meigen matrix type
Parameters
dstdestination eigen matrix
srcsource rcs matrix

Definition at line 120 of file eigen_matnd.h.

◆ defaultWrapJointAngle()

static bool Rcs::defaultWrapJointAngle ( RcsJoint *  joint)
static

Definition at line 48 of file OMJointState.cpp.

◆ dict2xml()

static xmlNodePtr Rcs::dict2xml ( const py::dict &  data,
xmlDocPtr  doc,
const char *  nodeName 
)
static

Definition at line 362 of file PropertySourceDict.cpp.

◆ for()

Rcs::for ( auto &name :actionSpace->  getNames())

Definition at line 85 of file DataLogger.cpp.

◆ getMatrixProperty()

static bool Rcs::getMatrixProperty ( Eigen::MatrixXd &  out,
PropertySource ps,
const char *  property,
unsigned int  expectedRows,
unsigned int  expectedCols 
)
static

Get an Eigen matrix value from a config entry.

Converts the config value to a MatNd, checks the dimensions, and copies the contents into the output reference.

Parameters
[out]outstorage for read value.
[in]psProperty source to load from.
[in]propertyproperty name
[in]expectedRowsRequired row count.
[in]expectedColsRequired column count.
Exceptions
std::invalid_argumentif the matrix dimensions do not match.

Definition at line 56 of file DynamicalSystem.cpp.

◆ getVectorProperty()

static bool Rcs::getVectorProperty ( Eigen::VectorXd &  out,
PropertySource ps,
const char *  property,
unsigned int  expectedSize 
)
static

Get an Eigen vector value from a config entry.

Converts the config value to a MatNd, checks the dimensions, and copies the contents into the output reference.

Parameters
[out]outstorage for read value.
[in]psProperty source to load from.
[in]propertyproperty name
[in]expectedSizeRequired element count.
Exceptions
std::invalid_argumentif the matrix dimensions do not match.

Definition at line 95 of file DynamicalSystem.cpp.

◆ initDefaultNames()

static void Rcs::initDefaultNames ( std::vector< std::string > &  out,
unsigned int  dim 
)
static

Definition at line 41 of file BoxSpace.cpp.

◆ intStep1stOrder()

void Rcs::intStep1stOrder ( MatNd *  x,
const MatNd *  xd_0,
const MatNd *  xd_T,
double  dt,
IntMode  mode 
)

First order integration function.

Parameters
[in,out]xcurrent value matrix, updated with new value.
[in]xd_0first derivative matrix at current timestep to integrate. Used by ForwardEuler.
[in]xd_Tfirst derivative matrix at next timestep to integrate. Used by BackwardEuler.
dttimestep length in seconds
modeForwardEuler or BackwardEuler

Definition at line 65 of file integrator.cpp.

◆ intStep2ndOrder()

void Rcs::intStep2ndOrder ( MatNd *  x,
MatNd *  xd,
const MatNd *  xdd,
double  dt,
IntMode  mode 
)

Second order integration function.

Parameters
[in,out]xcurrent value matrix, updated with new value.
[in,out]xdcurrent first derivative value matrix, updated with new value.
[in]xddsecond derivative matrix to integrate
dttimestep length in seconds
modeForwardEuler or SymplecticEuler

Definition at line 38 of file integrator.cpp.

◆ loadIndexList()

static IndexList Rcs::loadIndexList ( IndexList  input,
unsigned int  dim,
bool  exclude,
const char *  category 
)
static

Definition at line 44 of file OMPartial.cpp.

◆ loadMask()

static IndexList Rcs::loadMask ( const std::vector< bool > &  mask,
unsigned int  dim,
bool  exclude,
const char *  category 
)
static

Definition at line 73 of file OMPartial.cpp.

◆ MatNd_fabsClipEleSelf()

void Rcs::MatNd_fabsClipEleSelf ( MatNd *  self,
double  negUpperBound,
double  posLowerBound 
)

Definition at line 42 of file AMIKControllerActivation.cpp.

◆ MatNd_signs()

MatNd* Rcs::MatNd_signs ( const MatNd *  src)

Definition at line 58 of file AMIKControllerActivation.cpp.

◆ RcsCollisionModel_createFromConfig()

RcsCollisionMdl * Rcs::RcsCollisionModel_createFromConfig ( RcsGraph *  graph,
Rcs::PropertySource config 
)

Create a collision model using the settings from the given RcsPySim config.

Parameters
graphgraph to observe
configcollision configuration
Returns
new collision model
Exceptions
std::invalid_argumentif the collision model could not be created.

Definition at line 67 of file ExperimentConfig.cpp.

◆ setVortexLogLevel()

void Rcs::setVortexLogLevel ( const char *  level)

Set Vortex' log level if vortex is installed.

Definition at line 80 of file vortex_log.cpp.

◆ spaceJoinedString()

static std::string Rcs::spaceJoinedString ( py::handle  iterable)
static

Definition at line 346 of file PropertySourceDict.cpp.

◆ string_format()

template<typename ... Args>
std::string Rcs::string_format ( const std::string &  format,
Args ...  args 
)

Definition at line 45 of file string_format.h.

◆ Vec33d_add()

void Rcs::Vec33d_add ( double  dst[3][3],
const double  v1[3][3],
const double  v2[3][3] 
)

Definition at line 52 of file PPDBodyOrientation.cpp.

◆ Vec33d_setZero()

void Rcs::Vec33d_setZero ( double  v[3][3])

Definition at line 43 of file PPDBodyOrientation.cpp.

◆ viewEigen2MatNd()

template<typename M >
MatNd Rcs::viewEigen2MatNd ( M &  src)

View an eigen matrix as Rcs MatNd.

Template Parameters
Meigen matrix type
Parameters
srceigen matrix
Returns
MatNd struct referencing the data of src.

Definition at line 48 of file eigen_matnd.h.

◆ viewMatNd2Eigen() [1/2]

template<typename M = Eigen::MatrixXd>
Eigen::Map<MatNdMappable<M> > Rcs::viewMatNd2Eigen ( MatNd *  src)

Wrap a Rcs MatNd in a mutable Eigen Map object.

If M is column major, the resulting map will still wrap a row major matrix, since that is the storage order of MatNd.

Template Parameters
Mdesired eigen matrix type
Parameters
srcrcs matrix
Returns
Eigen::Map referencing the data of src.

Definition at line 88 of file eigen_matnd.h.

◆ viewMatNd2Eigen() [2/2]

template<typename M = Eigen::MatrixXd>
Eigen::Map<const MatNdMappable<M> > Rcs::viewMatNd2Eigen ( const MatNd *  src)

Wrap a read-only Rcs MatNd in a const Eigen Map object.

If M is column major, the resulting map will still wrap a row major matrix, since that is the storage order of MatNd.

Template Parameters
Mdesired eigen matrix type
Parameters
srcrcs matrix
Returns
Eigen::Map referencing the data of src.

Definition at line 106 of file eigen_matnd.h.

Variable Documentation

◆ extended_xml_material_props

const char* Rcs::extended_xml_material_props[]
static
Initial value:
= {
"compliance",
}

Definition at line 40 of file PPDMaterialProperties.cpp.

◆ PLATE_TASK_DIM

const unsigned int Rcs::PLATE_TASK_DIM = 6

Definition at line 44 of file AMPlatePos5D.cpp.

◆ RegBallInTube

ExperimentConfigRegistration<ECBallInTube> Rcs::RegBallInTube("BallInTube")
static

◆ RegBallOnPlate

ExperimentConfigRegistration<ECBallOnPlate> Rcs::RegBallOnPlate("BallOnPlate")
static

◆ RegBoxLifting

ExperimentConfigRegistration<ECBoxLifting> Rcs::RegBoxLifting("BoxLifting")
static

◆ RegBoxShelving

ExperimentConfigRegistration<ECBoxShelving> Rcs::RegBoxShelving("BoxShelving")
static

◆ registry [1/2]

std::map<std::string, ControlPolicy::ControlPolicyCreateFunction> Rcs::registry
static

Definition at line 44 of file ControlPolicy.cpp.

◆ registry [2/2]

std::map<std::string, ExperimentConfig::ExperimentConfigCreateFunction> Rcs::registry
static

Definition at line 144 of file ExperimentConfig.cpp.

◆ RegMiniGolf

ExperimentConfigRegistration<ECMiniGolf> Rcs::RegMiniGolf("MiniGolf")
static

◆ RegMPBlending

ExperimentConfigRegistration<ECMPblending> Rcs::RegMPBlending("MPBlending")
static

◆ RegPlanar3Link

ExperimentConfigRegistration<ECPlanar3Link> Rcs::RegPlanar3Link("Planar3Link")
static

◆ RegPlanarInsert

ExperimentConfigRegistration<ECPlanarInsert> Rcs::RegPlanarInsert("PlanarInsert")
static

◆ RegQuanserQube

ExperimentConfigRegistration<ECQuanserQube> Rcs::RegQuanserQube("QuanserQube")
static

◆ RegTorchPolicy

ControlPolicyRegistration<TorchPolicy> Rcs::RegTorchPolicy("torch")
static