icub-client
Classes

Motor babbling with the iCub Version:1.0. More...

+ Collaboration diagram for babbling:

Classes

class  Babbling
 

Detailed Description

Motor babbling with the iCub Version:1.0.

Author
Martina Zambelli m.zam.nosp@m.bell.nosp@m.i13@i.nosp@m.mper.nosp@m.ial.a.nosp@m.c.uk

Description

A module to issue pseudo random (sinusoids) commands to the iCub (either several joints, or individual joints)

Parameters

Input Ports

Output Ports

Services


Class Documentation

◆ Babbling

class Babbling

Definition at line 28 of file babbling.h.

+ Inheritance diagram for Babbling:

Public Member Functions

bool configure (yarp::os::ResourceFinder &rf)
 
bool interruptModule ()
 
bool close ()
 
bool respond (const yarp::os::Bottle &command, yarp::os::Bottle &reply)
 
double getPeriod ()
 
bool updateModule ()
 

Protected Member Functions

bool init_iCub ()
 Initializes all the device controllers. More...
 
bool init_left_arm ()
 Create PolyDriver for left arm. More...
 
bool init_right_arm ()
 Create PolyDriver for left arm. More...
 
bool doBabbling ()
 Sets the joints to be in velocity control, then goes in a loop to call babblingCommands for duration seconds. More...
 
void babblingCommands (double &t, int j_idx)
 Issues the actual velocity commands for time t. More...
 
bool moveHeadToStartPos ()
 Use iGazeController to move head in start position. More...
 
bool gotoStartPos ()
 Move head + arm in start position. More...
 

Protected Attributes

yarp::os::RpcServer handlerPort
 
yarp::dev::IPositionControl * posLeftArm
 
yarp::dev::IVelocityControl * velLeftArm
 
yarp::dev::ITorqueControl * itrqLeftArm
 
yarp::dev::IEncoders * encsLeftArm
 
yarp::dev::IControlMode * ictrlLeftArm
 
yarp::dev::IControlLimits * ictrlLimLeftArm
 
yarp::dev::IPositionControl * posRightArm
 
yarp::dev::IVelocityControl * velRightArm
 
yarp::dev::ITorqueControl * itrqRightArm
 
yarp::dev::IEncoders * encsRightArm
 
yarp::dev::IControlMode * ictrlRightArm
 
yarp::dev::IControlLimits * ictrlLimRightArm
 
yarp::dev::IGazeControl * igaze
 
yarp::dev::PolyDriver leftArmDev
 
yarp::dev::PolyDriver rightArmDev
 
yarp::dev::PolyDriver headDev
 
yarp::sig::VectorOf< double > encodersLeftArm
 
yarp::sig::VectorOf< double > encodersRightArm
 
std::string part
 Should be "left_arm" or "right_arm". More...
 
std::string robot
 Should be "icub" or "icubSim". More...
 
std::string part_babbling
 Whether to do babbling with the whole "arm" or "hand" (should be either one or the other) More...
 
int single_joint
 Which joint to do babbling with in case it is a single joint. More...
 
double freq
 Frequency for sin wave. More...
 
double amp
 Amplitude for sin wave. More...
 
double duration
 Duration for the babbling. More...
 
double start_command_arm [16]
 Start command for the 16 arm joints. More...
 
yarp::sig::VectorOf< double > start_command_head
 Target for head in start position. More...
 

Member Function Documentation

◆ babblingCommands()

void Babbling::babblingCommands ( double &  t,
int  j_idx 
)
protected

Issues the actual velocity commands for time t.

Parameters
t- time to be used for the sin wave
j_idx- if -1, do whole arm / whole hand babbling, otherwise babble single joint

Definition at line 281 of file babbling.cpp.

◆ close()

bool Babbling::close ( )

Definition at line 99 of file babbling.cpp.

◆ configure()

bool Babbling::configure ( yarp::os::ResourceFinder &  rf)

Definition at line 27 of file babbling.cpp.

◆ doBabbling()

bool Babbling::doBabbling ( )
protected

Sets the joints to be in velocity control, then goes in a loop to call babblingCommands for duration seconds.

Returns
True if successful, false if not

Definition at line 244 of file babbling.cpp.

◆ getPeriod()

double Babbling::getPeriod ( )

Definition at line 240 of file babbling.cpp.

◆ gotoStartPos()

bool Babbling::gotoStartPos ( )
protected

Move head + arm in start position.

Returns
true if successful

Definition at line 372 of file babbling.cpp.

◆ init_iCub()

bool Babbling::init_iCub ( )
protected

Initializes all the device controllers.

Returns
True if successful

Definition at line 538 of file babbling.cpp.

◆ init_left_arm()

bool Babbling::init_left_arm ( )
protected

Create PolyDriver for left arm.

Definition at line 425 of file babbling.cpp.

◆ init_right_arm()

bool Babbling::init_right_arm ( )
protected

Create PolyDriver for left arm.

Definition at line 481 of file babbling.cpp.

◆ interruptModule()

bool Babbling::interruptModule ( )

Definition at line 91 of file babbling.cpp.

◆ moveHeadToStartPos()

bool Babbling::moveHeadToStartPos ( )
protected

Use iGazeController to move head in start position.

Returns
true if successful

Definition at line 364 of file babbling.cpp.

◆ respond()

bool Babbling::respond ( const yarp::os::Bottle &  command,
yarp::os::Bottle &  reply 
)

Definition at line 114 of file babbling.cpp.

◆ updateModule()

bool Babbling::updateModule ( )

Definition at line 236 of file babbling.cpp.

Member Data Documentation

◆ amp

double Babbling::amp
protected

Amplitude for sin wave.

Definition at line 60 of file babbling.h.

◆ duration

double Babbling::duration
protected

Duration for the babbling.

Definition at line 61 of file babbling.h.

◆ encodersLeftArm

yarp::sig::VectorOf<double> Babbling::encodersLeftArm
protected

Definition at line 52 of file babbling.h.

◆ encodersRightArm

yarp::sig::VectorOf<double> Babbling::encodersRightArm
protected

Definition at line 52 of file babbling.h.

◆ encsLeftArm

yarp::dev::IEncoders* Babbling::encsLeftArm
protected

Definition at line 35 of file babbling.h.

◆ encsRightArm

yarp::dev::IEncoders* Babbling::encsRightArm
protected

Definition at line 42 of file babbling.h.

◆ freq

double Babbling::freq
protected

Frequency for sin wave.

Definition at line 59 of file babbling.h.

◆ handlerPort

yarp::os::RpcServer Babbling::handlerPort
protected

Definition at line 30 of file babbling.h.

◆ headDev

yarp::dev::PolyDriver Babbling::headDev
protected

Definition at line 50 of file babbling.h.

◆ ictrlLeftArm

yarp::dev::IControlMode* Babbling::ictrlLeftArm
protected

Definition at line 36 of file babbling.h.

◆ ictrlLimLeftArm

yarp::dev::IControlLimits* Babbling::ictrlLimLeftArm
protected

Definition at line 37 of file babbling.h.

◆ ictrlLimRightArm

yarp::dev::IControlLimits* Babbling::ictrlLimRightArm
protected

Definition at line 44 of file babbling.h.

◆ ictrlRightArm

yarp::dev::IControlMode* Babbling::ictrlRightArm
protected

Definition at line 43 of file babbling.h.

◆ igaze

yarp::dev::IGazeControl* Babbling::igaze
protected

Definition at line 46 of file babbling.h.

◆ itrqLeftArm

yarp::dev::ITorqueControl* Babbling::itrqLeftArm
protected

Definition at line 34 of file babbling.h.

◆ itrqRightArm

yarp::dev::ITorqueControl* Babbling::itrqRightArm
protected

Definition at line 41 of file babbling.h.

◆ leftArmDev

yarp::dev::PolyDriver Babbling::leftArmDev
protected

Definition at line 48 of file babbling.h.

◆ part

std::string Babbling::part
protected

Should be "left_arm" or "right_arm".

Definition at line 54 of file babbling.h.

◆ part_babbling

std::string Babbling::part_babbling
protected

Whether to do babbling with the whole "arm" or "hand" (should be either one or the other)

Definition at line 56 of file babbling.h.

◆ posLeftArm

yarp::dev::IPositionControl* Babbling::posLeftArm
protected

Definition at line 32 of file babbling.h.

◆ posRightArm

yarp::dev::IPositionControl* Babbling::posRightArm
protected

Definition at line 39 of file babbling.h.

◆ rightArmDev

yarp::dev::PolyDriver Babbling::rightArmDev
protected

Definition at line 49 of file babbling.h.

◆ robot

std::string Babbling::robot
protected

Should be "icub" or "icubSim".

Definition at line 55 of file babbling.h.

◆ single_joint

int Babbling::single_joint
protected

Which joint to do babbling with in case it is a single joint.

Definition at line 57 of file babbling.h.

◆ start_command_arm

double Babbling::start_command_arm[16]
protected

Start command for the 16 arm joints.

Definition at line 63 of file babbling.h.

◆ start_command_head

yarp::sig::VectorOf<double> Babbling::start_command_head
protected

Target for head in start position.

Definition at line 64 of file babbling.h.

◆ velLeftArm

yarp::dev::IVelocityControl* Babbling::velLeftArm
protected

Definition at line 33 of file babbling.h.

◆ velRightArm

yarp::dev::IVelocityControl* Babbling::velRightArm
protected

Definition at line 40 of file babbling.h.