ocra-wbi-plugins
Doxygen documentation for the ocra-wbi-plugins repository
Thread Class Reference

The meat and potatoes of the controller server. More...

#include <Thread.h>

Collaboration diagram for Thread:
[legend]

List of all members.

Classes

class  ControllerRpcServerCallback
 A callback function which binds the rpc server port opened in the contoller server module to the controller thread's parsing function. More...
class  DebugRpcServerCallback
 A callback function which binds the rpc server port opened in the contoller server module to the controller thread's parsing function. More...

Public Member Functions

 Thread (OcraControllerOptions &controller_options, std::shared_ptr< wbi::wholeBodyInterface > wbi)
virtual ~Thread ()
bool threadInit ()
void run ()
void threadRelease ()

Private Member Functions

ocra_icub::OCRA_ICUB_MESSAGE convertStringToOcraIcubMessage (const std::string &s)
void parseIncomingMessage (yarp::os::Bottle &input, yarp::os::Bottle &reply)
void parseDebugMessage (yarp::os::Bottle &input, yarp::os::Bottle &reply)
void writeDebugData ()
void putAnklesIntoIdle (double idleTime)
void sendTorqueReferenceToDebugJoint (int idx)
bool setDebugJointToTorqueMode (int idx)

Private Attributes

ocra::Model::Ptr model
std::shared_ptr
< IcubControllerServer
ctrlServer
Eigen::ArrayXd minTorques
Eigen::ArrayXd maxTorques
OcraControllerOptions ctrlOptions
std::shared_ptr
< wbi::wholeBodyInterface > 
yarpWbi
Eigen::VectorXd torques
Eigen::VectorXd initialPosture
ocra_icub::OCRA_ICUB_MESSAGE controllerStatus
ControllerRpcServerCallback::shared_ptr rpcServerCallback
yarp::os::RpcServer rpcServerPort
int debugJointIndex
yarp::os::RpcServer debugRpcPort
yarp::os::Port debugRefOutPort
yarp::os::Port debugRealOutPort
DebugRpcServerCallback::shared_ptr debugRpcCallback
Eigen::VectorXd measuredTorques
bool debuggingAllJoints
bool userHasSetDebugIndex
Eigen::Displacementd l_foot_disp_inverse
iDynTree::SimpleLeggedOdometry odometry

Static Private Attributes

static const int ALL_JOINTS = -1
static const int TORQUE_MIN = -24
static const int TORQUE_MAX = 24

Detailed Description

The meat and potatoes of the controller server.

Todo:
Remove task sequences. This class sets up an ocra::Model which is constructed from an OcraWbiModel and an ocra::Controller which can be specified as either a WocraController, a GocraController, or a HocraController. The thread is looped at the period specified by the user (defaults to 10ms) and on each loop the Model is updated and the control torques are recalculated. *At the writing of this comment, task sequences are still in use and they too are initialized and updated here. They will be removed eventually.*

Constructor & Destructor Documentation

Thread::Thread ( OcraControllerOptions controller_options,
std::shared_ptr< wbi::wholeBodyInterface >  wbi 
)

Constructor

Parameters:
controller_optionsThe various arguments and options used to define what type of controller and tasks to use. See OcraControllerOptions.
wbiA shared pointer to a wholeBodyInterface object.
Thread::~Thread ( ) [virtual]

Member Function Documentation

void Thread::parseDebugMessage ( yarp::os::Bottle &  input,
yarp::os::Bottle &  reply 
) [private]
void Thread::parseIncomingMessage ( yarp::os::Bottle &  input,
yarp::os::Bottle &  reply 
) [private]
void Thread::putAnklesIntoIdle ( double  idleTime) [private]
void Thread::run ( )
void Thread::sendTorqueReferenceToDebugJoint ( int  idx) [private]
bool Thread::setDebugJointToTorqueMode ( int  idx) [private]
void Thread::writeDebugData ( ) [private]

Member Data Documentation

const int Thread::ALL_JOINTS = -1 [static, private]

Maximum possible actuator torques

The controller options.

std::shared_ptr<IcubControllerServer> Thread::ctrlServer [private]
int Thread::debugJointIndex [private]
yarp::os::Port Thread::debugRealOutPort [private]
yarp::os::Port Thread::debugRefOutPort [private]
DebugRpcServerCallback::shared_ptr Thread::debugRpcCallback [private]

Rpc server port callback function.

yarp::os::RpcServer Thread::debugRpcPort [private]
Eigen::VectorXd Thread::initialPosture [private]

The torques calculated at each run() loop.

Eigen::Displacementd Thread::l_foot_disp_inverse [private]

For gazebo visualization. You can't get the l_sole pose directly in gazebo, but you can get the l_foot, so since all poses from ocra::Model are calculated in the l_sole then we need to go from l_sole to l_foot.

Eigen::ArrayXd Thread::maxTorques [private]

An eigen array filled with the max torques.

Eigen::VectorXd Thread::measuredTorques [private]
Eigen::ArrayXd Thread::minTorques [private]

An eigen array filled with the min torques.

ocra::Model::Ptr Thread::model [private]
iDynTree::SimpleLeggedOdometry Thread::odometry [private]

Odometry object

ControllerRpcServerCallback::shared_ptr Thread::rpcServerCallback [private]

Rpc server port callback function.

yarp::os::RpcServer Thread::rpcServerPort [private]

Rpc server port.

const int Thread::TORQUE_MAX = 24 [static, private]

Maximum possible actuator torques

const int Thread::TORQUE_MIN = -24 [static, private]

Minimum possible actuator torques

Eigen::VectorXd Thread::torques [private]

The torques calculated at each run() loop.

std::shared_ptr<wbi::wholeBodyInterface> Thread::yarpWbi [private]

The WBI used to talk to the robot.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines