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

#include <PPDSphereRadius.h>

Inheritance diagram for Rcs::PPDSphereRadius:
Collaboration diagram for Rcs::PPDSphereRadius:

Public Member Functions

 PPDSphereRadius (std::string prevBodyName, unsigned int shapeIdx=0, unsigned int shapeIdxPrevBody=0)
 
virtual ~PPDSphereRadius ()
 
virtual void setValues (PropertySource *inValues)
 
- Public Member Functions inherited from Rcs::PPDSingleVar< double >
 PPDSingleVar (std::string name, int modifiedFlag, VariableAccessor variableAccessor)
 
virtual ~PPDSingleVar ()=default
 
virtual void getValues (PropertySink *outValues)
 
- Public Member Functions inherited from Rcs::PhysicsParameterDescriptor
 PhysicsParameterDescriptor ()
 
virtual ~PhysicsParameterDescriptor ()
 

Protected Member Functions

virtual void init (BodyParamInfo *bodyParamInfo)
 

Private Attributes

std::string prevBodyName
 
unsigned int shapeIdx
 
unsigned int shapeIdxPrevBody
 

Additional Inherited Members

- Public Types inherited from Rcs::PPDSingleVar< double >
typedef std::function< double &(BodyParamInfo &)> VariableAccessor
 
- Protected Attributes inherited from Rcs::PhysicsParameterDescriptor
BodyParamInfobodyParamInfo
 

Detailed Description

Descriptor for the radius of a sphere-shaped body.

The sphere must be the first shape of the body for this to work. This is specific to the ball-on-plate task since it also has to adjust the ball's position to prevent it from clipping through the plate.

Note that this does not update the inertia based on the shape changes, for that, add PPDMassProperties after this descriptor.

Exposes:

  • radius: Radius of the sphere [m]

Definition at line 54 of file PPDSphereRadius.h.

Constructor & Destructor Documentation

◆ PPDSphereRadius()

Rcs::PPDSphereRadius::PPDSphereRadius ( std::string  prevBodyName,
unsigned int  shapeIdx = 0,
unsigned int  shapeIdxPrevBody = 0 
)

Constructor

Parameters
shapeIdxThe spheres's index within given the body. This is given by the order of the shapes in the config xml-file.
prevBodyNameName of the previous body if the graph to which the sphere is placed relative to, Use "" if the sphere is defined in world coordinates

Definition at line 39 of file PPDSphereRadius.cpp.

◆ ~PPDSphereRadius()

Rcs::PPDSphereRadius::~PPDSphereRadius ( )
virtualdefault

Member Function Documentation

◆ init()

void Rcs::PPDSphereRadius::init ( BodyParamInfo bodyParamInfo)
protectedvirtual

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

Reimplemented from Rcs::PPDSingleVar< double >.

Definition at line 98 of file PPDSphereRadius.cpp.

◆ setValues()

void Rcs::PPDSphereRadius::setValues ( PropertySource inValues)
virtual

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.

Reimplemented from Rcs::PPDSingleVar< double >.

Definition at line 46 of file PPDSphereRadius.cpp.

Member Data Documentation

◆ prevBodyName

std::string Rcs::PPDSphereRadius::prevBodyName
private

Name of the previous body if the graph to which the sphere is placed relative to.

Definition at line 76 of file PPDSphereRadius.h.

◆ shapeIdx

unsigned int Rcs::PPDSphereRadius::shapeIdx
private

The spheres's index within given the body. This is given by the order of the shapes in the config xml-file.

Definition at line 79 of file PPDSphereRadius.h.

◆ shapeIdxPrevBody

unsigned int Rcs::PPDSphereRadius::shapeIdxPrevBody
private

The spheres's index within the previous body. This is given by the order of the shapes in the config xml-file.

Definition at line 81 of file PPDSphereRadius.h.


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