RcsPySim
A robot control and simulation library
Rcs::PPDSingleVar< T > Class Template Reference

#include <PPDSingleVar.h>

Inheritance diagram for Rcs::PPDSingleVar< T >:
Collaboration diagram for Rcs::PPDSingleVar< T >:

Public Types

typedef std::function< T &(BodyParamInfo &)> VariableAccessor
 

Public Member Functions

 PPDSingleVar (std::string name, int modifiedFlag, VariableAccessor variableAccessor)
 
virtual ~PPDSingleVar ()=default
 
virtual void getValues (PropertySink *outValues)
 
virtual void setValues (PropertySource *inValues)
 
- Public Member Functions inherited from Rcs::PhysicsParameterDescriptor
 PhysicsParameterDescriptor ()
 
virtual ~PhysicsParameterDescriptor ()
 

Protected Member Functions

virtual void init (BodyParamInfo *bodyParamInfo)
 

Private Attributes

std::string name
 
int modifiedFlag
 
VariableAccessor variableAccessor
 

Additional Inherited Members

- Protected Attributes inherited from Rcs::PhysicsParameterDescriptor
BodyParamInfobodyParamInfo
 

Detailed Description

template<typename T>
class Rcs::PPDSingleVar< T >

Descriptor for a single scalar variable of type T. The actual parameter name is built to be [lower case body name]_[param name].

Definition at line 46 of file PPDSingleVar.h.

Member Typedef Documentation

◆ VariableAccessor

template<typename T>
typedef std::function<T & (BodyParamInfo & )> Rcs::PPDSingleVar< T >::VariableAccessor

Returns a reference to the variable whihc this descriptor uses.

Definition at line 52 of file PPDSingleVar.h.

Constructor & Destructor Documentation

◆ PPDSingleVar()

template<typename T>
Rcs::PPDSingleVar< T >::PPDSingleVar ( std::string  name,
int  modifiedFlag,
VariableAccessor  variableAccessor 
)
inline

Constructor.

Parameters
nameunprefixed name for the parameter
modifiedFlagmodified flag value to set for BodyParamInfo
variableAccessorvariable accessor function. Returns a reference to be readable and writable.

Definition at line 60 of file PPDSingleVar.h.

◆ ~PPDSingleVar()

template<typename T>
virtual Rcs::PPDSingleVar< T >::~PPDSingleVar ( )
virtualdefault

Member Function Documentation

◆ getValues()

template<typename T>
virtual void Rcs::PPDSingleVar< T >::getValues ( PropertySink outValues)
inlinevirtual

Read values from graph and put them into the given dict.

Implements Rcs::PhysicsParameterDescriptor.

Definition at line 65 of file PPDSingleVar.h.

◆ init()

template<typename T>
virtual void Rcs::PPDSingleVar< T >::init ( BodyParamInfo bodyParamInfo)
inlineprotectedvirtual

Setup descriptor to work on the given body reference. Override for more custom initialization.

Reimplemented from Rcs::PhysicsParameterDescriptor.

Reimplemented in Rcs::PPDSphereRadius.

Definition at line 85 of file PPDSingleVar.h.

◆ setValues()

template<typename T>
virtual void Rcs::PPDSingleVar< T >::setValues ( PropertySource inValues)
inlinevirtual

Read values from the given dict and apply them to the graph. The parameter names need to be the same as in Rcs, e.g. rolling_friction_coefficient.

Implements Rcs::PhysicsParameterDescriptor.

Reimplemented in Rcs::PPDSphereRadius.

Definition at line 70 of file PPDSingleVar.h.

Member Data Documentation

◆ modifiedFlag

template<typename T>
int Rcs::PPDSingleVar< T >::modifiedFlag
private

Value to or to BodyParamInfo::modifiedFlag when modified.

Definition at line 96 of file PPDSingleVar.h.

◆ name

template<typename T>
std::string Rcs::PPDSingleVar< T >::name
private

Parameter name/key which the init() method will add a body prefix to this.

Definition at line 93 of file PPDSingleVar.h.

◆ variableAccessor

template<typename T>
VariableAccessor Rcs::PPDSingleVar< T >::variableAccessor
private

Variable accessor function.

Definition at line 99 of file PPDSingleVar.h.


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