1 #ifndef TASK_CONNECTION_H 2 #define TASK_CONNECTION_H 9 #include <yarp/os/RpcClient.h> 10 #include <yarp/os/Network.h> 11 #include <yarp/os/PortReader.h> 12 #include <yarp/os/Log.h> 13 #include <yarp/os/LogStream.h> 17 #include <Eigen/Dense> 40 yarp::os::Network yarp;
42 yarp::os::RpcClient taskRpcClient;
44 std::string taskRpcServerName;
45 std::string taskRpcClientName;
47 std::string taskOutputPortName;
48 std::string taskInputPortName;
49 std::string inputPortName;
50 std::string outputPortName;
52 std::string taskDesiredStateOutputPortName;
53 std::string desiredStateInputPortName;
55 yarp::os::Port desiredStateInputPort;
56 yarp::os::Port inputPort;
57 yarp::os::Port outputPort;
61 bool firstUpdateOfTaskStateHasOccured;
62 bool firstUpdateOfTaskDesiredStateHasOccured;
63 bool controlPortsAreOpen;
65 static int TASK_CONNECTION_COUNT;
66 int taskConnectionNumber;
69 void parseInput(yarp::os::Bottle& input);
70 void parseDesiredStateInput(yarp::os::Bottle& input);
179 void setWeight(Eigen::VectorXd& weights);
240 virtual bool read(yarp::os::ConnectionReader& connection);
251 virtual bool read(yarp::os::ConnectionReader& connection);
256 std::shared_ptr<InputCallback> inpCallback;
257 std::shared_ptr<DesiredStateInputCallback> desiredStateInputCallback;
264 #endif // TASK_CONNECTION_H ocra::TaskState getTaskState()
std::string getTaskTypeAsString()
bool openControlPorts(bool connect=true)
Eigen::Twistd getTaskFrameVelocity()
ocra::Task::META_TASK_TYPE getTaskType()
std::string getTaskOutputPortName()
Eigen::Twistd getTaskFrameAcceleration()
Eigen::Rotation3d getTaskFrameOrientation()
std::string getTaskName()
ocra::TaskState getDesiredTaskState()
Eigen::VectorXd getWeight()
#define DEFINE_CLASS_POINTER_TYPEDEFS(Class)
void setStiffness(double K)
Eigen::Vector3d getTaskFrameAngularVelocity()
void setDesiredTaskState(const ocra::TaskState &newDesiredTaskState)
Eigen::Vector3d getTaskFrameAngularAcceleration()
Eigen::MatrixXd getStiffnessMatrix()
std::string getPortName()
void setDesiredTaskStateDirect(const ocra::TaskState &newDesiredTaskState)
Eigen::Vector3d getTaskFramePosition()
Eigen::Vector3d getTaskFrameLinearAcceleration()
void setWeight(double weight)
Eigen::Vector3d getTaskFrameLinearVelocity()
virtual ~TaskConnection()
Eigen::MatrixXd getDampingMatrix()
std::string getTaskInputPortName()
void setDamping(double B)
void queryTask(ocra::TASK_MESSAGE tag, yarp::os::Bottle &bottle)
Eigen::Displacementd getTaskFrameDisplacement()
double getTaskErrorNorm()
Eigen::VectorXd getTaskError()