18 #ifndef __D4C_HELPERS_H__
19 #define __D4C_HELPERS_H__
23 #include <yarp/os/all.h>
24 #include <yarp/sig/all.h>
26 #define D4C_VOCAB_CMD_PING VOCAB4('p','i','n','g')
27 #define D4C_VOCAB_CMD_ADD VOCAB3('a','d','d')
28 #define D4C_VOCAB_CMD_DEL VOCAB3('d','e','l')
29 #define D4C_VOCAB_CMD_SET VOCAB3('s','e','t')
30 #define D4C_VOCAB_CMD_GET VOCAB3('g','e','t')
31 #define D4C_VOCAB_CMD_LIST VOCAB4('l','i','s','t')
32 #define D4C_VOCAB_CMD_CLEAR VOCAB4('c','l','e','a')
33 #define D4C_VOCAB_CMD_ENFIELD VOCAB4('f','e','n','a')
34 #define D4C_VOCAB_CMD_DISFIELD VOCAB4('f','d','i','s')
35 #define D4C_VOCAB_CMD_STATFIELD VOCAB4('f','s','t','a')
36 #define D4C_VOCAB_CMD_ENCTRL VOCAB4('c','e','n','a')
37 #define D4C_VOCAB_CMD_DISCTRL VOCAB4('c','d','i','s')
38 #define D4C_VOCAB_CMD_STATCTRL VOCAB4('c','s','t','a')
39 #define D4C_VOCAB_CMD_ENSIM VOCAB4('m','e','n','a')
40 #define D4C_VOCAB_CMD_DISSIM VOCAB4('m','d','i','s')
41 #define D4C_VOCAB_CMD_STATSIM VOCAB4('m','s','t','a')
42 #define D4C_VOCAB_CMD_SETPER VOCAB4('s','p','e','r')
43 #define D4C_VOCAB_CMD_GETPER VOCAB4('g','p','e','r')
44 #define D4C_VOCAB_CMD_SETACTIF VOCAB4('s','a','i','f')
45 #define D4C_VOCAB_CMD_GETACTIF VOCAB4('g','a','i','f')
46 #define D4C_VOCAB_CMD_GETTRAJ VOCAB4('g','t','r','j')
47 #define D4C_VOCAB_CMD_EXECTRAJ VOCAB4('e','t','r','j')
48 #define D4C_VOCAB_CMD_SETSTATETOTOOL VOCAB4('s','s','t','t')
49 #define D4C_VOCAB_CMD_SETSTATE VOCAB4('s','s','t','a')
50 #define D4C_VOCAB_CMD_SETORIEN VOCAB4('s','o','r','i')
51 #define D4C_VOCAB_CMD_GETSTATE VOCAB4('g','s','t','a')
52 #define D4C_VOCAB_CMD_ATTACHTOOLFRAME VOCAB4('t','a','t','f')
53 #define D4C_VOCAB_CMD_GETTOOLFRAME VOCAB4('t','g','e','f')
54 #define D4C_VOCAB_CMD_REMOVETOOLFRAME VOCAB4('t','r','e','f')
55 #define D4C_VOCAB_CMD_GETTOOL VOCAB4('t','g','e','t')
56 #define D4C_VOCAB_CMD_ACK VOCAB3('a','c','k')
57 #define D4C_VOCAB_CMD_NACK VOCAB4('n','a','c','k')
59 #define extractProperty(value) (Property(value.asList()->toString().c_str()))
70 enum { no_info, info, warning, error };
73 inline yarp::sig::Vector getVectorPos(
const yarp::sig::Vector &x)
75 return x.subVector(0,2);
78 inline yarp::sig::Vector getVectorOrien(
const yarp::sig::Vector &x)
80 return x.subVector(3,6);
83 bool copyVectorData(
const yarp::sig::Vector &src, yarp::sig::Vector &dest);
85 bool extractVector(
const yarp::os::Property &prop,
const std::string &option,
86 yarp::sig::Vector &res);