18 #ifndef __D4C_CLIENT_H__
19 #define __D4C_CLIENT_H__
23 #include <yarp/os/all.h>
24 #include <yarp/sig/all.h>
26 #include <iCub/d4c/d4c.h>
34 class D4CClient :
public D4C
44 mutable yarp::sig::Vector field;
45 mutable yarp::sig::Vector xdot;
46 mutable yarp::sig::Vector x;
47 mutable yarp::sig::Vector xhat;
48 mutable yarp::sig::Vector qhat;
50 mutable yarp::os::BufferedPort<yarp::os::Property> data;
51 yarp::os::RpcClient rpc;
53 virtual void printMessage(
const int logtype,
const int level,
54 const char *format, ...)
const;
58 bool open(
const yarp::os::Property &options);
60 bool addItem(
const yarp::os::Property &options,
int &item);
61 bool eraseItem(
const int item);
63 bool getItems(yarp::os::Bottle &items);
64 bool setProperty(
const int item,
const yarp::os::Property &options);
65 bool getProperty(
const int item, yarp::os::Property &options);
68 bool getFieldStatus(
bool &status);
70 bool disableControl();
71 bool enableSimulation();
72 bool disableSimulation();
73 bool getSimulationStatus(
bool &status);
74 bool getControlStatus(
bool &status);
75 bool setPeriod(
const int period);
76 bool getPeriod(
int &period);
77 bool setPointStateToTool();
78 bool attachToolFrame(
const yarp::sig::Vector &x,
const yarp::sig::Vector &o);
79 bool getToolFrame(yarp::sig::Vector &x, yarp::sig::Vector &o);
80 bool removeToolFrame();
81 bool getTool(yarp::sig::Vector &x, yarp::sig::Vector &o);
82 bool setPointState(
const yarp::sig::Vector &x,
const yarp::sig::Vector &o,
83 const yarp::sig::Vector &xdot,
const yarp::sig::Vector &odot);
84 bool setPointOrientation(
const yarp::sig::Vector &o,
const yarp::sig::Vector &odot);
85 bool getPointState(yarp::sig::Vector &x, yarp::sig::Vector &o,
86 yarp::sig::Vector &xdot, yarp::sig::Vector &odot);
87 bool getField(yarp::sig::Vector &field);
88 bool getSimulation(yarp::sig::Vector &xhat, yarp::sig::Vector &ohat,
89 yarp::sig::Vector &qhat);
90 bool getActiveIF(std::string &activeIF);
91 bool setActiveIF(
const std::string &activeIF);
92 bool getTrajectory(std::deque<yarp::sig::Vector> &trajPos,
93 std::deque<yarp::sig::Vector> &trajOrien,
94 const unsigned int maxIterations=D4C_DEFAULT_MAXITERATIONS,
95 const double Ts=D4C_DEFAULT_TS_DISABLED);
96 bool executeTrajectory(
const std::deque<yarp::sig::Vector> &trajPos,
97 const std::deque<yarp::sig::Vector> &trajOrien,
98 const double trajTime);