All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dynamicgraph::sot::Device Class Reference

#include <sot/core/device.hh>

Inheritance diagram for dynamicgraph::sot::Device:
[legend]

Public Types

enum  ForceSignalSource {
  FORCE_SIGNAL_RLEG,
  FORCE_SIGNAL_LLEG,
  FORCE_SIGNAL_RARM,
  FORCE_SIGNAL_LARM
}
 
- Public Types inherited from dynamicgraph::Entity
typedef std::map< std::string,
SignalBase< int > * > 
SignalMap
 
typedef std::map< const
std::string, command::Command * > 
CommandMap_t
 

Public Member Functions

virtual const std::string & getClassName (void) const
 
 Device (const std::string &name)
 
virtual ~Device ()
 
virtual void setStateSize (const unsigned int &size)
 
virtual void setState (const dg::Vector &st)
 
void setVelocitySize (const unsigned int &size)
 
virtual void setVelocity (const dg::Vector &vel)
 
virtual void setSecondOrderIntegration ()
 
virtual void setNoIntegration ()
 
virtual void setControlInputType (const std::string &cit)
 
virtual void increment (const double &dt=5e-2)
 
virtual void display (std::ostream &os) const
 
virtual void cmdDisplay ()
 
virtual void setRoot (const dg::Matrix &root)
 
virtual void setRoot (const MatrixHomogeneous &worldMwaist)
 
Sanity check parameterization
void setSanityCheck (const bool &enableCheck)
 
void setPositionBounds (const Vector &lower, const Vector &upper)
 
void setVelocityBounds (const Vector &lower, const Vector &upper)
 
void setTorqueBounds (const Vector &lower, const Vector &upper)
 
- Public Member Functions inherited from dynamicgraph::Entity
 Entity (const std::string &name)
 
virtual ~Entity ()
 
const std::string & getName () const
 
virtual std::string getDocString () const
 
bool hasSignal (const std::string &signame) const
 
SignalBase< int > & getSignal (const std::string &signalName)
 
const SignalBase< int > & getSignal (const std::string &signalName) const
 
std::ostream & displaySignalList (std::ostream &os) const
 
virtual std::ostream & writeGraph (std::ostream &os) const
 
virtual std::ostream & writeCompletionList (std::ostream &os) const
 
virtual SignalBase< int > * test ()
 
virtual void test2 (SignalBase< int > *)
 
const std::string & getCommandList () const
 
CommandMap_t getNewStyleCommandMap ()
 
command::CommandgetNewStyleCommand (const std::string &cmdName)
 
SignalMap getSignalMap () const
 
void sendMsg (const std::string &msg, MsgType t=MSG_TYPE_INFO, const char *file="", int line=0)
 
void setLoggerVerbosityLevel (LoggerVerbosity lv)
 
LoggerVerbosity getLoggerVerbosityLevel ()
 

Public Attributes

dynamicgraph::SignalPtr
< dg::Vector, int > 
controlSIN
 
dynamicgraph::SignalPtr
< dg::Vector, int > 
attitudeSIN
 
dynamicgraph::SignalPtr
< dg::Vector, int > 
zmpSIN
 
Device current state.
dynamicgraph::Signal
< dg::Vector, int > 
stateSOUT
 
dynamicgraph::Signal
< dg::Vector, int > 
velocitySOUT
 
dynamicgraph::Signal
< MatrixRotation, int > 
attitudeSOUT
 
dynamicgraph::Signal
< dg::Vector, int > 
motorcontrolSOUT
 The current state of the robot from the command viewpoint. More...
 
dynamicgraph::Signal
< dg::Vector, int > 
previousControlSOUT
 
dynamicgraph::Signal
< dg::Vector, int > 
ZMPPreviousControllerSOUT
 The ZMP reference send by the previous controller. More...
 
Real robot current state

This corresponds to the real encoders values and take into account the stabilization step.

Therefore, this usually does not match the state control input signal.

Motor positions

dynamicgraph::Signal
< dg::Vector, int > 
robotState_
 
dynamicgraph::Signal
< dg::Vector, int > 
robotVelocity_
 Motor velocities. More...
 
dynamicgraph::Signal
< dg::Vector, int > * 
forcesSOUT [4]
 The force torque sensors. More...
 
dynamicgraph::Signal
< dg::Vector, int > 
pseudoTorqueSOUT
 Motor torques. More...
 

Static Public Attributes

static const std::string CLASS_NAME
 

Protected Member Functions

void integrateRollPitchYaw (dg::Vector &state, const dg::Vector &control, double dt)
 Compute roll pitch yaw angles of freeflyer joint. More...
 
virtual void integrate (const double &dt)
 Compute the new position, from the current control. More...
 
const MatrixHomogeneousfreeFlyerPose () const
 Get freeflyer pose. More...
 
- Protected Member Functions inherited from dynamicgraph::Entity
void addCommand (const std::string &name, command::Command *command)
 
void entityRegistration ()
 
void entityDeregistration ()
 
void signalRegistration (const SignalArray< int > &signals)
 
void signalDeregistration (const std::string &name)
 

Protected Attributes

dg::Vector state_
 
dg::Vector velocity_
 
bool sanityCheck_
 
dg::Vector vel_control_
 
ControlInput controlInputType_
 
bool withForceSignals [4]
 
PeriodicCall periodicCallBefore_
 
PeriodicCall periodicCallAfter_
 
double timestep_
 
MatrixHomogeneous ffPose_
 Store Position of free flyer joint. More...
 
Robot bounds used for sanity checks
Vector upperPosition_
 
Vector upperVelocity_
 
Vector upperTorque_
 
Vector lowerPosition_
 
Vector lowerVelocity_
 
Vector lowerTorque_
 
- Protected Attributes inherited from dynamicgraph::Entity
std::string name
 
SignalMap signalMap
 
CommandMap_t commandMap
 
Logger logger_
 

Friends

SOT_CORE_EXPORT friend
std::ostream & 
operator<< (std::ostream &os, const Device &r)
 

Member Enumeration Documentation

Enumerator
FORCE_SIGNAL_RLEG 
FORCE_SIGNAL_LLEG 
FORCE_SIGNAL_RARM 
FORCE_SIGNAL_LARM 

Constructor & Destructor Documentation

dynamicgraph::sot::Device::Device ( const std::string &  name)
virtual dynamicgraph::sot::Device::~Device ( )
virtual

Member Function Documentation

virtual void dynamicgraph::sot::Device::cmdDisplay ( )
virtual
virtual void dynamicgraph::sot::Device::display ( std::ostream &  os) const
virtual

Reimplemented from dynamicgraph::Entity.

const MatrixHomogeneous& dynamicgraph::sot::Device::freeFlyerPose ( ) const
protected

Get freeflyer pose.

virtual const std::string& dynamicgraph::sot::Device::getClassName ( void  ) const
inlinevirtual

Reimplemented from dynamicgraph::Entity.

Reimplemented in dynamicgraph::sot::RobotSimu.

virtual void dynamicgraph::sot::Device::increment ( const double &  dt = 5e-2)
virtual
virtual void dynamicgraph::sot::Device::integrate ( const double &  dt)
protectedvirtual

Compute the new position, from the current control.

When sanity checks are enabled, this checks that the control is within bounds. There are three cases, depending on what the control is:

  • position: checks that the position is within bounds,
  • velocity: checks that the velocity and the future position are within bounds,
  • acceleration: checks that the acceleration, the future velocity and position are within bounds.
    Todo:
    in order to check the acceleration, we need pinocchio and the contact forces in order to estimate the joint torques for the given acceleration.
void dynamicgraph::sot::Device::integrateRollPitchYaw ( dg::Vector state,
const dg::Vector control,
double  dt 
)
protected

Compute roll pitch yaw angles of freeflyer joint.

virtual void dynamicgraph::sot::Device::setControlInputType ( const std::string &  cit)
virtual
virtual void dynamicgraph::sot::Device::setNoIntegration ( )
virtual
void dynamicgraph::sot::Device::setPositionBounds ( const Vector lower,
const Vector upper 
)
virtual void dynamicgraph::sot::Device::setRoot ( const dg::Matrix root)
virtual
virtual void dynamicgraph::sot::Device::setRoot ( const MatrixHomogeneous worldMwaist)
virtual
void dynamicgraph::sot::Device::setSanityCheck ( const bool &  enableCheck)
virtual void dynamicgraph::sot::Device::setSecondOrderIntegration ( )
virtual
virtual void dynamicgraph::sot::Device::setState ( const dg::Vector st)
virtual
virtual void dynamicgraph::sot::Device::setStateSize ( const unsigned int &  size)
virtual
void dynamicgraph::sot::Device::setTorqueBounds ( const Vector lower,
const Vector upper 
)
virtual void dynamicgraph::sot::Device::setVelocity ( const dg::Vector vel)
virtual
void dynamicgraph::sot::Device::setVelocityBounds ( const Vector lower,
const Vector upper 
)
void dynamicgraph::sot::Device::setVelocitySize ( const unsigned int &  size)

Friends And Related Function Documentation

SOT_CORE_EXPORT friend std::ostream& operator<< ( std::ostream &  os,
const Device r 
)
friend

Member Data Documentation

dynamicgraph::SignalPtr<dg::Vector,int> dynamicgraph::sot::Device::attitudeSIN
dynamicgraph::Signal<MatrixRotation,int> dynamicgraph::sot::Device::attitudeSOUT
const std::string dynamicgraph::sot::Device::CLASS_NAME
static
ControlInput dynamicgraph::sot::Device::controlInputType_
protected
dynamicgraph::SignalPtr<dg::Vector,int> dynamicgraph::sot::Device::controlSIN
MatrixHomogeneous dynamicgraph::sot::Device::ffPose_
protected

Store Position of free flyer joint.

dynamicgraph::Signal<dg::Vector,int>* dynamicgraph::sot::Device::forcesSOUT[4]

The force torque sensors.

Vector dynamicgraph::sot::Device::lowerPosition_
protected
Vector dynamicgraph::sot::Device::lowerTorque_
protected
Vector dynamicgraph::sot::Device::lowerVelocity_
protected
dynamicgraph::Signal<dg::Vector,int> dynamicgraph::sot::Device::motorcontrolSOUT

The current state of the robot from the command viewpoint.

PeriodicCall dynamicgraph::sot::Device::periodicCallAfter_
protected
PeriodicCall dynamicgraph::sot::Device::periodicCallBefore_
protected
dynamicgraph::Signal<dg::Vector,int> dynamicgraph::sot::Device::previousControlSOUT
dynamicgraph::Signal<dg::Vector,int> dynamicgraph::sot::Device::pseudoTorqueSOUT

Motor torques.

Todo:
why pseudo ?
dynamicgraph::Signal<dg::Vector, int> dynamicgraph::sot::Device::robotState_
dynamicgraph::Signal<dg::Vector, int> dynamicgraph::sot::Device::robotVelocity_

Motor velocities.

bool dynamicgraph::sot::Device::sanityCheck_
protected
dg::Vector dynamicgraph::sot::Device::state_
protected
dynamicgraph::Signal<dg::Vector,int> dynamicgraph::sot::Device::stateSOUT
double dynamicgraph::sot::Device::timestep_
protected
Vector dynamicgraph::sot::Device::upperPosition_
protected
Vector dynamicgraph::sot::Device::upperTorque_
protected
Vector dynamicgraph::sot::Device::upperVelocity_
protected
dg::Vector dynamicgraph::sot::Device::vel_control_
protected
dg::Vector dynamicgraph::sot::Device::velocity_
protected
dynamicgraph::Signal<dg::Vector,int> dynamicgraph::sot::Device::velocitySOUT
bool dynamicgraph::sot::Device::withForceSignals[4]
protected
dynamicgraph::Signal<dg::Vector,int> dynamicgraph::sot::Device::ZMPPreviousControllerSOUT

The ZMP reference send by the previous controller.

dynamicgraph::SignalPtr<dg::Vector,int> dynamicgraph::sot::Device::zmpSIN