iCub-main
Loading...
Searching...
No Matches
Controller Class Reference

#include <controller.h>

Inheritance diagram for Controller:

Public Member Functions

 Controller (PolyDriver *_drvTorso, PolyDriver *_drvHead, ExchangeData *_commData, const double _neckTime, const double _eyesTime, const double _min_abs_vel, const unsigned int _period)
virtual ~Controller ()
void findMinimumAllowedVergence ()
void minAllowedVergenceChanged () override
void resetCtrlEyes ()
void doSaccade (const Vector &ang, const Vector &vel)
bool look (const Vector &x)
void stopControl ()
void printIter (Vector &xd, Vector &fp, Vector &qd, Vector &q, Vector &v, double printTime)
bool threadInit () override
void threadRelease () override
void afterStart (bool s) override
void run () override
void suspend ()
void resume ()
double getTneck () const
double getTeyes () const
void setTneck (const double execTime)
void setTeyes (const double execTime)
bool isMotionDone ()
void setTrackingMode (const bool f)
bool getTrackingMode () const
bool setGazeStabilization (const bool f)
bool getGazeStabilization () const
bool getDesired (Vector &des)
bool getVelocity (Vector &vel)
bool getPose (const string &poseSel, Vector &x, Stamp &stamp)
bool registerMotionOngoingEvent (const double checkPoint)
bool unregisterMotionOngoingEvent (const double checkPoint)
Bottle listMotionOngoingEvents ()
 Controller (ResourceFinder &_rf, inPort *_port_q, exchangeData *_commData, unsigned int period)
virtual bool threadInit ()
virtual void afterStart (bool s)
virtual void run ()
virtual void threadRelease ()
Public Member Functions inherited from GazeComponent
virtual bool getExtrinsicsMatrix (const string &type, Matrix &M)
virtual bool setExtrinsicsMatrix (const string &type, const Matrix &M)

Protected Member Functions

Vector computedxFP (const Matrix &H, const Vector &v, const Vector &w, const Vector &x_FP)
Vector computeNeckVelFromdxFP (const Vector &fp, const Vector &dfp)
Vector computeEyesVelFromdxFP (const Vector &dfp)
bool areJointsHealthyAndSet ()
void setJointsCtrlMode ()
void stopLimb (const bool execStopPosition=true)
void notifyEvent (const string &event, const double checkPoint=-1.0)
void motionOngoingEventsHandling ()
void motionOngoingEventsFlush ()
void stopControlHelper ()

Protected Attributes

iCubHeadCenter * neck
iCubInertialSensor * imu
iKinChain * chainNeck
iKinChain * chainEyeL
iKinChain * chainEyeR
PolyDriver * drvTorso
PolyDriver * drvHead
IControlMode * modHead
IPositionControl * posHead
IVelocityControl * velHead
IPositionDirect * posNeck
ExchangeData * commData
minJerkVelCtrl * mjCtrlNeck
minJerkVelCtrl * mjCtrlEyes
Integrator * IntState
Integrator * IntPlan
Integrator * IntStabilizer
BufferedPort< Vector > port_x
BufferedPort< Vector > port_q
BufferedPort< Bottle > port_event
BufferedPort< Bottle > port_debug
Stamp txInfo_x
Stamp txInfo_q
Stamp txInfo_pose
Stamp txInfo_event
Stamp txInfo_debug
mutex mutexRun
mutex mutexChain
mutex mutexCtrl
mutex mutexData
mutex mutexLook
mutex mtx_eventLook
condition_variable cv_eventLook
unsigned int period
bool unplugCtrlEyes
bool ctrlInhibited
bool motionDone
bool reliableGyro
bool stabilizeGaze
int nJointsTorso
int nJointsHead
double ctrlActiveRisingEdgeTime
double saccadeStartTime
double printAccTime
double neckTime
double eyesTime
double pathPerc
double min_abs_vel
double startupMinVer
double q_stamp
double Ts
Matrix lim
Vector qddeg
Vector qdeg
Vector vdeg
Vector v
Vector vNeck
Vector vEyes
Vector q0
Vector qd
Vector qdNeck
Vector qdEyes
Vector fbTorso
Vector fbHead
Vector fbNeck
Vector fbEyes
vector< int > neckJoints
vector< int > eyesJoints
vector< int > jointsToSet
multiset< double > motionOngoingEvents
multiset< double > motionOngoingEventsCurrent
ResourceFinder & rf
iKinLimb * limb
iKinChain * chain
MultiRefMinJerkCtrl * ctrl
exchangeData * commData
inPort * port_q
Port port_v
Port port_x
Protected Attributes inherited from GazeComponent
iCubEye * eyeL {nullptr}
iCubEye * eyeR {nullptr}

Detailed Description

Definition at line 53 of file controller.h.

Constructor & Destructor Documentation

◆ Controller() [1/2]

Controller::Controller ( PolyDriver * _drvTorso,
PolyDriver * _drvHead,
ExchangeData * _commData,
const double _neckTime,
const double _eyesTime,
const double _min_abs_vel,
const unsigned int _period )

Definition at line 28 of file controller.cpp.

◆ ~Controller()

Controller::~Controller ( )
virtual

Definition at line 158 of file controller.cpp.

◆ Controller() [2/2]

Controller::Controller ( ResourceFinder & _rf,
inPort * _port_q,
exchangeData * _commData,
unsigned int period )
inline

Definition at line 271 of file main.cpp.

Member Function Documentation

◆ afterStart() [1/2]

virtual void Controller::afterStart ( bool s)
inlinevirtual

Definition at line 317 of file main.cpp.

◆ afterStart() [2/2]

void Controller::afterStart ( bool s)
override

Definition at line 402 of file controller.cpp.

◆ areJointsHealthyAndSet()

bool Controller::areJointsHealthyAndSet ( )
protected

Definition at line 547 of file controller.cpp.

◆ computedxFP()

Vector Controller::computedxFP ( const Matrix & H,
const Vector & v,
const Vector & w,
const Vector & x_FP )
protected

Definition at line 412 of file controller.cpp.

◆ computeEyesVelFromdxFP()

Vector Controller::computeEyesVelFromdxFP ( const Vector & dfp)
protected

Definition at line 464 of file controller.cpp.

◆ computeNeckVelFromdxFP()

Vector Controller::computeNeckVelFromdxFP ( const Vector & fp,
const Vector & dfp )
protected

Definition at line 435 of file controller.cpp.

◆ doSaccade()

void Controller::doSaccade ( const Vector & ang,
const Vector & vel )

Definition at line 476 of file controller.cpp.

◆ findMinimumAllowedVergence()

void Controller::findMinimumAllowedVergence ( )

Definition at line 173 of file controller.cpp.

◆ getDesired()

bool Controller::getDesired ( Vector & des)

Definition at line 1104 of file controller.cpp.

◆ getGazeStabilization()

bool Controller::getGazeStabilization ( ) const

Definition at line 635 of file controller.cpp.

◆ getPose()

bool Controller::getPose ( const string & poseSel,
Vector & x,
Stamp & stamp )

Definition at line 1122 of file controller.cpp.

◆ getTeyes()

double Controller::getTeyes ( ) const

Definition at line 1033 of file controller.cpp.

◆ getTneck()

double Controller::getTneck ( ) const

Definition at line 1026 of file controller.cpp.

◆ getTrackingMode()

bool Controller::getTrackingMode ( ) const

Definition at line 1097 of file controller.cpp.

◆ getVelocity()

bool Controller::getVelocity ( Vector & vel)

Definition at line 1113 of file controller.cpp.

◆ isMotionDone()

bool Controller::isMotionDone ( )

Definition at line 1073 of file controller.cpp.

◆ listMotionOngoingEvents()

Bottle Controller::listMotionOngoingEvents ( )

Definition at line 1183 of file controller.cpp.

◆ look()

bool Controller::look ( const Vector & x)

Definition at line 519 of file controller.cpp.

◆ minAllowedVergenceChanged()

void Controller::minAllowedVergenceChanged ( )
overridevirtual

Reimplemented from GazeComponent.

Definition at line 210 of file controller.cpp.

◆ motionOngoingEventsFlush()

void Controller::motionOngoingEventsFlush ( )
protected

Definition at line 253 of file controller.cpp.

◆ motionOngoingEventsHandling()

void Controller::motionOngoingEventsHandling ( )
protected

Definition at line 238 of file controller.cpp.

◆ notifyEvent()

void Controller::notifyEvent ( const string & event,
const double checkPoint = -1.0 )
protected

Definition at line 218 of file controller.cpp.

◆ printIter()

void Controller::printIter ( Vector & xd,
Vector & fp,
Vector & qd,
Vector & q,
Vector & v,
double printTime )

Definition at line 343 of file controller.cpp.

◆ registerMotionOngoingEvent()

bool Controller::registerMotionOngoingEvent ( const double checkPoint)

Definition at line 1149 of file controller.cpp.

◆ resetCtrlEyes()

void Controller::resetCtrlEyes ( )

Definition at line 538 of file controller.cpp.

◆ resume()

void Controller::resume ( )

Definition at line 1013 of file controller.cpp.

◆ run() [1/2]

virtual void Controller::run ( )
inlinevirtual

Definition at line 326 of file main.cpp.

◆ run() [2/2]

void Controller::run ( )
override

Definition at line 642 of file controller.cpp.

◆ setGazeStabilization()

bool Controller::setGazeStabilization ( const bool f)

Definition at line 600 of file controller.cpp.

◆ setJointsCtrlMode()

void Controller::setJointsCtrlMode ( )
protected

Definition at line 576 of file controller.cpp.

◆ setTeyes()

void Controller::setTeyes ( const double execTime)

Definition at line 1055 of file controller.cpp.

◆ setTneck()

void Controller::setTneck ( const double execTime)

Definition at line 1040 of file controller.cpp.

◆ setTrackingMode()

void Controller::setTrackingMode ( const bool f)

Definition at line 1081 of file controller.cpp.

◆ stopControl()

void Controller::stopControl ( )

Definition at line 321 of file controller.cpp.

◆ stopControlHelper()

void Controller::stopControlHelper ( )
protected

Definition at line 329 of file controller.cpp.

◆ stopLimb()

void Controller::stopLimb ( const bool execStopPosition = true)
protected

Definition at line 265 of file controller.cpp.

◆ suspend()

void Controller::suspend ( )

Definition at line 1001 of file controller.cpp.

◆ threadInit() [1/2]

virtual bool Controller::threadInit ( )
inlinevirtual

Definition at line 280 of file main.cpp.

◆ threadInit() [2/2]

bool Controller::threadInit ( )
override

Definition at line 362 of file controller.cpp.

◆ threadRelease() [1/2]

virtual void Controller::threadRelease ( )
inlinevirtual

Definition at line 347 of file main.cpp.

◆ threadRelease() [2/2]

void Controller::threadRelease ( )
override

Definition at line 379 of file controller.cpp.

◆ unregisterMotionOngoingEvent()

bool Controller::unregisterMotionOngoingEvent ( const double checkPoint)

Definition at line 1163 of file controller.cpp.

Member Data Documentation

◆ chain

iKinChain* Controller::chain
protected

Definition at line 261 of file main.cpp.

◆ chainEyeL

iKinChain * Controller::chainEyeL
protected

Definition at line 58 of file controller.h.

◆ chainEyeR

iKinChain * Controller::chainEyeR
protected

Definition at line 58 of file controller.h.

◆ chainNeck

iKinChain* Controller::chainNeck
protected

Definition at line 58 of file controller.h.

◆ commData [1/2]

ExchangeData* Controller::commData
protected

Definition at line 64 of file controller.h.

◆ commData [2/2]

exchangeData* Controller::commData
protected

Definition at line 263 of file main.cpp.

◆ ctrl

MultiRefMinJerkCtrl* Controller::ctrl
protected

Definition at line 262 of file main.cpp.

◆ ctrlActiveRisingEdgeTime

double Controller::ctrlActiveRisingEdgeTime
protected

Definition at line 97 of file controller.h.

◆ ctrlInhibited

bool Controller::ctrlInhibited
protected

Definition at line 91 of file controller.h.

◆ cv_eventLook

condition_variable Controller::cv_eventLook
protected

Definition at line 88 of file controller.h.

◆ drvHead

PolyDriver * Controller::drvHead
protected

Definition at line 59 of file controller.h.

◆ drvTorso

PolyDriver* Controller::drvTorso
protected

Definition at line 59 of file controller.h.

◆ eyesJoints

vector<int> Controller::eyesJoints
protected

Definition at line 113 of file controller.h.

◆ eyesTime

double Controller::eyesTime
protected

Definition at line 101 of file controller.h.

◆ fbEyes

Vector Controller::fbEyes
protected

Definition at line 112 of file controller.h.

◆ fbHead

Vector Controller::fbHead
protected

Definition at line 112 of file controller.h.

◆ fbNeck

Vector Controller::fbNeck
protected

Definition at line 112 of file controller.h.

◆ fbTorso

Vector Controller::fbTorso
protected

Definition at line 112 of file controller.h.

◆ imu

iCubInertialSensor* Controller::imu
protected

Definition at line 57 of file controller.h.

◆ IntPlan

Integrator* Controller::IntPlan
protected

Definition at line 69 of file controller.h.

◆ IntStabilizer

Integrator* Controller::IntStabilizer
protected

Definition at line 70 of file controller.h.

◆ IntState

Integrator* Controller::IntState
protected

Definition at line 68 of file controller.h.

◆ jointsToSet

vector<int> Controller::jointsToSet
protected

Definition at line 114 of file controller.h.

◆ lim

Matrix Controller::lim
protected

Definition at line 108 of file controller.h.

◆ limb

iKinLimb* Controller::limb
protected

Definition at line 260 of file main.cpp.

◆ min_abs_vel

double Controller::min_abs_vel
protected

Definition at line 103 of file controller.h.

◆ mjCtrlEyes

minJerkVelCtrl* Controller::mjCtrlEyes
protected

Definition at line 67 of file controller.h.

◆ mjCtrlNeck

minJerkVelCtrl* Controller::mjCtrlNeck
protected

Definition at line 66 of file controller.h.

◆ modHead

IControlMode* Controller::modHead
protected

Definition at line 60 of file controller.h.

◆ motionDone

bool Controller::motionDone
protected

Definition at line 92 of file controller.h.

◆ motionOngoingEvents

multiset<double> Controller::motionOngoingEvents
protected

Definition at line 116 of file controller.h.

◆ motionOngoingEventsCurrent

multiset<double> Controller::motionOngoingEventsCurrent
protected

Definition at line 117 of file controller.h.

◆ mtx_eventLook

mutex Controller::mtx_eventLook
protected

Definition at line 87 of file controller.h.

◆ mutexChain

mutex Controller::mutexChain
protected

Definition at line 83 of file controller.h.

◆ mutexCtrl

mutex Controller::mutexCtrl
protected

Definition at line 84 of file controller.h.

◆ mutexData

mutex Controller::mutexData
protected

Definition at line 85 of file controller.h.

◆ mutexLook

mutex Controller::mutexLook
protected

Definition at line 86 of file controller.h.

◆ mutexRun

mutex Controller::mutexRun
protected

Definition at line 82 of file controller.h.

◆ neck

iCubHeadCenter* Controller::neck
protected

Definition at line 56 of file controller.h.

◆ neckJoints

vector<int> Controller::neckJoints
protected

Definition at line 113 of file controller.h.

◆ neckTime

double Controller::neckTime
protected

Definition at line 100 of file controller.h.

◆ nJointsHead

int Controller::nJointsHead
protected

Definition at line 96 of file controller.h.

◆ nJointsTorso

int Controller::nJointsTorso
protected

Definition at line 95 of file controller.h.

◆ pathPerc

double Controller::pathPerc
protected

Definition at line 102 of file controller.h.

◆ period

unsigned int Controller::period
protected

Definition at line 89 of file controller.h.

◆ port_debug

BufferedPort<Bottle> Controller::port_debug
protected

Definition at line 75 of file controller.h.

◆ port_event

BufferedPort<Bottle> Controller::port_event
protected

Definition at line 74 of file controller.h.

◆ port_q [1/2]

BufferedPort<Vector> Controller::port_q
protected

Definition at line 73 of file controller.h.

◆ port_q [2/2]

inPort* Controller::port_q
protected

Definition at line 265 of file main.cpp.

◆ port_v

Port Controller::port_v
protected

Definition at line 266 of file main.cpp.

◆ port_x [1/2]

BufferedPort<Vector> Controller::port_x
protected

Definition at line 72 of file controller.h.

◆ port_x [2/2]

Port Controller::port_x
protected

Definition at line 267 of file main.cpp.

◆ posHead

IPositionControl* Controller::posHead
protected

Definition at line 61 of file controller.h.

◆ posNeck

IPositionDirect* Controller::posNeck
protected

Definition at line 63 of file controller.h.

◆ printAccTime

double Controller::printAccTime
protected

Definition at line 99 of file controller.h.

◆ q0

Vector Controller::q0
protected

Definition at line 111 of file controller.h.

◆ q_stamp

double Controller::q_stamp
protected

Definition at line 105 of file controller.h.

◆ qd

Vector Controller::qd
protected

Definition at line 111 of file controller.h.

◆ qddeg

Vector Controller::qddeg
protected

Definition at line 109 of file controller.h.

◆ qdeg

Vector Controller::qdeg
protected

Definition at line 109 of file controller.h.

◆ qdEyes

Vector Controller::qdEyes
protected

Definition at line 111 of file controller.h.

◆ qdNeck

Vector Controller::qdNeck
protected

Definition at line 111 of file controller.h.

◆ reliableGyro

bool Controller::reliableGyro
protected

Definition at line 93 of file controller.h.

◆ rf

ResourceFinder& Controller::rf
protected

Definition at line 259 of file main.cpp.

◆ saccadeStartTime

double Controller::saccadeStartTime
protected

Definition at line 98 of file controller.h.

◆ stabilizeGaze

bool Controller::stabilizeGaze
protected

Definition at line 94 of file controller.h.

◆ startupMinVer

double Controller::startupMinVer
protected

Definition at line 104 of file controller.h.

◆ Ts

double Controller::Ts
protected

Definition at line 106 of file controller.h.

◆ txInfo_debug

Stamp Controller::txInfo_debug
protected

Definition at line 80 of file controller.h.

◆ txInfo_event

Stamp Controller::txInfo_event
protected

Definition at line 79 of file controller.h.

◆ txInfo_pose

Stamp Controller::txInfo_pose
protected

Definition at line 78 of file controller.h.

◆ txInfo_q

Stamp Controller::txInfo_q
protected

Definition at line 77 of file controller.h.

◆ txInfo_x

Stamp Controller::txInfo_x
protected

Definition at line 76 of file controller.h.

◆ unplugCtrlEyes

bool Controller::unplugCtrlEyes
protected

Definition at line 90 of file controller.h.

◆ v

Vector Controller::v
protected

Definition at line 110 of file controller.h.

◆ vdeg

Vector Controller::vdeg
protected

Definition at line 109 of file controller.h.

◆ velHead

IVelocityControl* Controller::velHead
protected

Definition at line 62 of file controller.h.

◆ vEyes

Vector Controller::vEyes
protected

Definition at line 110 of file controller.h.

◆ vNeck

Vector Controller::vNeck
protected

Definition at line 110 of file controller.h.


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