6 #ifndef __VELCONTROLTHREAD__
7 #define __VELCONTROLTHREAD__
12 #include <yarp/os/PeriodicThread.h>
13 #include <yarp/os/Bottle.h>
14 #include <yarp/dev/ControlBoardInterfaces.h>
15 #include <yarp/dev/PolyDriver.h>
16 #include <yarp/sig/Vector.h>
17 #include <yarp/os/Time.h>
25 yarp::dev::IVelocityControl *ivel;
26 yarp::dev::IPositionControl *ipos;
27 yarp::dev::IEncoders *ienc;
28 yarp::dev::IControlMode *imod;
29 yarp::dev::IPidControl *ipid;
31 yarp::dev::PolyDriver *driver;
33 yarp::sig::Vector encoders;
34 yarp::sig::Vector encoders_speed;
38 yarp::sig::Vector targets;
39 yarp::sig::Vector ffVelocities;
40 yarp::sig::Vector command;
42 yarp::sig::Vector error;
43 yarp::sig::Vector error_d;
45 yarp::sig::Vector maxVel;
55 yarp::os::BufferedPort<yarp::os::Bottle> command_port;
56 yarp::os::BufferedPort<yarp::os::Bottle> command_port2;
62 FILE *currentSpeedFile;
63 FILE *targetSpeedFile;
69 bool init(yarp::dev::PolyDriver *d, std::string partName,
70 std::string robotName);
74 void setRef(
int i,
double pos);
76 void setVel(
int i,
double vel);
77 void setGain(
int i,
double gain);
void setGain(int i, double gain)
void setRef(int i, double pos)
velControlThread(int rate)
bool init(yarp::dev::PolyDriver *d, std::string partName, std::string robotName)
void limitSpeed(yarp::sig::Vector &command)
void setVel(int i, double vel)