Computational Embodied Neuroscience Simulator  1.1
3D simulation library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Types | Public Member Functions | Public Attributes | List of all members
cens::CENSSerializedRobot Struct Reference

#include <cens_serialized_engine.h>

Inheritance diagram for cens::CENSSerializedRobot:
Inheritance graph
Collaboration diagram for cens::CENSSerializedRobot:
Collaboration graph

Public Types

typedef std::map< std::string,
typedef std::map< std::string,
btTypedConstraint * > 
typedef std::map< std::string,
btRigidBody * > 
typedef std::map< std::string,
btTransform > 
- Public Types inherited from CENSParameterManager
typedef std::map< std::string,
std::string * > 
typedef strvalues::iterator striter
typedef std::map< std::string,
Vector4f * > 
typedef v4values::iterator v4iter
typedef std::map< std::string,
Vector3f * > 
typedef v3values::iterator v3iter
typedef std::map< std::string,
double * > 
typedef dvalues::iterator diter
typedef std::map< std::string,
float * > 
typedef fvalues::iterator fiter
typedef std::map< std::string,
int * > 
typedef ivalues::iterator iiter
typedef std::map< int,
std::string > 
typedef labels::iterator liter

Public Member Functions

 CENSSerializedRobot (const std::string robotName, CENSEngine *en)
 ~CENSSerializedRobot ()
void addHinge (std::string hingeName, CENSHingeConstraint *_hinge)
void addGenericConstraint (std::string constraintName, btTypedConstraint *_constraint)
void addBody (std::string bodyName, btRigidBody *_body)
void addTransform (std::string transformName, btTransform _transform)
bool init ()
void disableBodies ()
void enableBodies ()
void update ()
void move (const std::string hingeName, double target_angle, double impulse=0)
- Public Member Functions inherited from CENSParameterManager
 CENSParameterManager (std::string _filename, const char *sep="-------", const char *vsep=";", const char *filedir="parameters/")
 CENSParameterManager (const CENSParameterManager &copy)
void addParameter (std::string parname, std::string &par)
void addParameter (std::string parname, Vector4f &par)
void addParameter (std::string parname, Vector3f &par)
void addParameter (std::string parname, double &par)
void addParameter (std::string parname, float &par)
void addParameter (std::string parname, int &par)
bool loadParameters ()
void saveParameters ()

Public Attributes

std::string robotName
Hinges hinges
GenericConstraints constraints
Bodies bodies
Transforms transforms

Additional Inherited Members

- Protected Attributes inherited from CENSParameterManager
std::string filename
const char * separator
const char * vseparator
strvalues strparlist
v4values v4parlist
v3values v3parlist
dvalues dparlist
fvalues fparlist
ivalues iparlist
labels order
int added

Detailed Description

Data structure to import and maintain a group of serialized hinges

Definition at line 159 of file cens_serialized_engine.h.

Member Typedef Documentation

typedef std::map<std::string, btRigidBody *> cens::CENSSerializedRobot::Bodies

Definition at line 163 of file cens_serialized_engine.h.

typedef std::map<std::string, btTypedConstraint *> cens::CENSSerializedRobot::GenericConstraints

Definition at line 162 of file cens_serialized_engine.h.

typedef std::map<std::string, CENSHingeData> cens::CENSSerializedRobot::Hinges

Definition at line 161 of file cens_serialized_engine.h.

typedef std::map<std::string, btTransform> cens::CENSSerializedRobot::Transforms

Definition at line 164 of file cens_serialized_engine.h.

Constructor & Destructor Documentation

cens::CENSSerializedRobot::CENSSerializedRobot ( const std::string  robotName,
CENSEngine en 
robotNamethe name of the gorup of hinges
enthe engine that uses it

Definition at line 190 of file cens_serialized_engine.h.

cens::CENSSerializedRobot::~CENSSerializedRobot ( )

Definition at line 196 of file cens_serialized_engine.h.

Member Function Documentation

void cens::CENSSerializedRobot::addBody ( std::string  bodyName,
btRigidBody *  _body 

Adds a body to the group

bodyNamethe name of the body
_bodypointer to the body

Definition at line 89 of file cens_serialized_engine.cpp.

References bodies.

Referenced by cens::CENSSerializedEngine::loadBulletFile().

void cens::CENSSerializedRobot::addGenericConstraint ( std::string  constraintName,
btTypedConstraint *  _constraint 

Adds a non-hinge constraint to the group

constraintNamethe name of the constraint
_constraintpointer to the constraint

Definition at line 81 of file cens_serialized_engine.cpp.

References constraints.

Referenced by cens::CENSSerializedEngine::loadBulletFile().

void cens::CENSSerializedRobot::addHinge ( std::string  hingeName,
CENSHingeConstraint _hinge 

Adds an hinge to the group

hingeNamethe name of the hinge
_hingethe hinge struct

Definition at line 34 of file cens_serialized_engine.cpp.

References CENSParameterManager::addParameter(), and hinges.

Referenced by cens::CENSSerializedEngine::loadBulletFile().

void cens::CENSSerializedRobot::addTransform ( std::string  transformName,
btTransform  _transform 

Adds a transform to the group

transformNamethe name of the body
_transformposition and rotation of the body

Definition at line 96 of file cens_serialized_engine.cpp.

References transforms.

Referenced by cens::CENSSerializedEngine::loadBulletFile().

void cens::CENSSerializedRobot::disableBodies ( )

Definition at line 141 of file cens_serialized_engine.cpp.

References bodies, hinges, move(), and transforms.

void cens::CENSSerializedRobot::enableBodies ( )
bool cens::CENSSerializedRobot::init ( )
void cens::CENSSerializedRobot::move ( const std::string  hingeName,
double  target_angle,
double  impulse = 0 

Move a hinge by changing its status (target_angle, inpulse)

hingeNamethe name of the hinge to move
target_anglethe new angle to be reached
impulsethe maximum impulse that can be acquired while changing angle. This changes hinge.max_motor_impulse in case of CENS_DEFAULT_CONTROL or in case of CENS_PD_CONTROL
propthe proportion between and hinge.kd (only for CENS_PD_CONTROL).

Definition at line 221 of file cens_serialized_engine.cpp.

References cens::CENS_DEFAULT_CONTROL, cens::CENS_PD_CONTROL, and hinges.

Referenced by disableBodies().

void cens::CENSSerializedRobot::update ( )

Member Data Documentation

Bodies cens::CENSSerializedRobot::bodies

Map of hinges to their names

Definition at line 177 of file cens_serialized_engine.h.

Referenced by addBody(), disableBodies(), and enableBodies().

GenericConstraints cens::CENSSerializedRobot::constraints

Map of non-hinge constraints to their names

Definition at line 174 of file cens_serialized_engine.h.

Referenced by addGenericConstraint().

CENSEngine* cens::CENSSerializedRobot::engine

A pointer to the engine

Definition at line 183 of file cens_serialized_engine.h.

Referenced by enableBodies(), init(), and update().

Hinges cens::CENSSerializedRobot::hinges

Map of hinges to their names

Definition at line 171 of file cens_serialized_engine.h.

Referenced by addHinge(), disableBodies(), init(), move(), and update().

std::string cens::CENSSerializedRobot::robotName

Name of the group (corresponds to a file in the params directory)

Definition at line 168 of file cens_serialized_engine.h.

Transforms cens::CENSSerializedRobot::transforms

Map of transforms to body names

Definition at line 180 of file cens_serialized_engine.h.

Referenced by addTransform(), and disableBodies().

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