27 #ifndef CONTROL_THREAD_H 28 #define CONTROL_THREAD_H 30 #include <yarp/os/Network.h> 31 #include <yarp/os/RateThread.h> 32 #include <yarp/os/Port.h> 33 #include <yarp/os/RpcClient.h> 34 #include <yarp/os/Time.h> 36 #include <Eigen/Dense> 62 out <<
"kp = " << params.
kp << std::endl;
63 out <<
"kd = " << params.
kd << std::endl;
64 out <<
"dimension = " << params.
dimension << std::endl;
65 out <<
"weight = " << params.
weight.transpose() << std::endl;
66 out <<
"desired = " << params.
desired.transpose() << std::endl;
67 out <<
"currentState = " << params.
currentState.transpose() << std::endl;
68 out <<
"type = " << params.
type << std::endl;
69 out <<
"name = " << params.
name << std::endl;
70 out <<
"isActive = " << params.
isActive << std::endl;
83 ControlThread(
int period,
const std::string& taskRpcPortName);
90 virtual bool threadInit();
91 virtual void threadRelease();
95 virtual bool ct_threadInit()=0;
96 virtual void ct_threadRelease()=0;
97 virtual void ct_run()=0;
101 bool deactivateTask();
116 virtual bool read(yarp::os::ConnectionReader& connection);
122 void setThreadType(
const std::string& _threadType =
"ControlThread"){controlThreadType = _threadType;}
137 bool openControlPorts();
138 bool connectControlPorts();
143 bool parseInput(yarp::os::Bottle* input);
145 Eigen::VectorXd getCurrentState();
147 void sendGetStateMessage();
157 bool getTaskDimensions();
164 #endif //CONTROL_THREAD_H
Eigen::VectorXd currentStateVector
yarp::os::RpcClient threadRpcClient
std::string controlThreadType
std::string getInputPortName()
inputCallback * inpCallback
std::string getThreadType()
#define DEFINE_CLASS_POINTER_TYPEDEFS(Class)
Eigen::VectorXd currentState
std::string getOutputPortName()
TaskParameters currentTaskParams
void setThreadType(const std::string &_threadType="ControlThread")
static int CONTROL_THREAD_COUNT
std::string outputPortName
std::string threadRpcClientName
double controlThreadPeriod
yarp::os::Port outputPort
TaskParameters originalTaskParams
friend std::ostream & operator<<(std::ostream &out, const TaskParameters ¶ms)
bool waitingForFirstStateMessage