19#ifndef __CLIENTCARTESIANCONTROLLER_H__
20#define __CLIENTCARTESIANCONTROLLER_H__
26#include <yarp/os/all.h>
27#include <yarp/dev/all.h>
28#include <yarp/sig/all.h>
42 void onRead(yarp::os::Bottle &event);
64 public yarp::dev::ICartesianControl,
77 yarp::os::BufferedPort<yarp::sig::Vector>
portState;
78 yarp::os::BufferedPort<yarp::os::Bottle>
portCmd;
82 std::map<std::string,yarp::dev::CartesianEvent*>
eventsMap;
95 bool open(yarp::os::Searchable &config);
104 bool getPose(yarp::sig::Vector &
x, yarp::sig::Vector &o, yarp::os::Stamp *stamp=NULL);
105 bool getPose(
const int axis, yarp::sig::Vector &
x, yarp::sig::Vector &o, yarp::os::Stamp *stamp=NULL);
106 bool goToPose(
const yarp::sig::Vector &xd,
const yarp::sig::Vector &od,
const double t=0.0);
107 bool goToPosition(
const yarp::sig::Vector &xd,
const double t=0.0);
108 bool goToPoseSync(
const yarp::sig::Vector &xd,
const yarp::sig::Vector &od,
const double t=0.0);
110 bool getDesired(yarp::sig::Vector &xdhat, yarp::sig::Vector &odhat,yarp::sig::Vector &qdhat);
111 bool askForPose(
const yarp::sig::Vector &xd,
const yarp::sig::Vector &od, yarp::sig::Vector &xdhat,
112 yarp::sig::Vector &odhat, yarp::sig::Vector &qdhat);
113 bool askForPose(
const yarp::sig::Vector &q0,
const yarp::sig::Vector &xd,
const yarp::sig::Vector &od,
114 yarp::sig::Vector &xdhat, yarp::sig::Vector &odhat, yarp::sig::Vector &qdhat);
115 bool askForPosition(
const yarp::sig::Vector &xd, yarp::sig::Vector &xdhat, yarp::sig::Vector &odhat,
116 yarp::sig::Vector &qdhat);
117 bool askForPosition(
const yarp::sig::Vector &q0,
const yarp::sig::Vector &xd, yarp::sig::Vector &xdhat,
118 yarp::sig::Vector &odhat, yarp::sig::Vector &qdhat);
119 bool getDOF(yarp::sig::Vector &curDof);
120 bool setDOF(
const yarp::sig::Vector &newDof, yarp::sig::Vector &curDof);
121 bool getRestPos(yarp::sig::Vector &curRestPos);
122 bool setRestPos(
const yarp::sig::Vector &newRestPos, yarp::sig::Vector &curRestPos);
124 bool setRestWeights(
const yarp::sig::Vector &newRestWeights, yarp::sig::Vector &curRestWeights);
125 bool getLimits(
const int axis,
double *min,
double *max);
126 bool setLimits(
const int axis,
const double min,
const double max);
133 bool setTaskVelocities(
const yarp::sig::Vector &xdot,
const yarp::sig::Vector &odot);
134 bool attachTipFrame(
const yarp::sig::Vector &
x,
const yarp::sig::Vector &o);
135 bool getTipFrame(yarp::sig::Vector &
x, yarp::sig::Vector &o);
143 bool getInfo(yarp::os::Bottle &info);
146 bool tweakSet(
const yarp::os::Bottle &options);
147 bool tweakGet(yarp::os::Bottle &options);
void setInterface(ClientCartesianController *interface)
ClientCartesianController * interface
void onRead(yarp::os::Bottle &event)
clientcartesiancontroller : implements the client part of the Cartesian Interface.
bool askForPose(const yarp::sig::Vector &q0, const yarp::sig::Vector &xd, const yarp::sig::Vector &od, yarp::sig::Vector &xdhat, yarp::sig::Vector &odhat, yarp::sig::Vector &qdhat)
bool getPosePriority(std::string &p)
bool getTrackingMode(bool *f)
CartesianEventHandler portEvents
bool goToPosition(const yarp::sig::Vector &xd, const double t=0.0)
virtual ~ClientCartesianController()
bool getJointsVelocities(yarp::sig::Vector &qdot)
bool getRestPos(yarp::sig::Vector &curRestPos)
bool checkMotionDone(bool *f)
bool getRestWeights(yarp::sig::Vector &curRestWeights)
bool tweakGet(yarp::os::Bottle &options)
bool getTipFrame(yarp::sig::Vector &x, yarp::sig::Vector &o)
bool getReferenceMode(bool *f)
bool deleteContext(const int id)
bool getPose(yarp::sig::Vector &x, yarp::sig::Vector &o, yarp::os::Stamp *stamp=NULL)
bool open(yarp::os::Searchable &config)
bool askForPosition(const yarp::sig::Vector &q0, const yarp::sig::Vector &xd, yarp::sig::Vector &xdhat, yarp::sig::Vector &odhat, yarp::sig::Vector &qdhat)
ClientCartesianController()
bool goToPoseSync(const yarp::sig::Vector &xd, const yarp::sig::Vector &od, const double t=0.0)
bool getInfoHelper(yarp::os::Bottle &info)
bool getInTargetTol(double *tol)
bool getTaskVelocities(yarp::sig::Vector &xdot, yarp::sig::Vector &odot)
bool setPosePriority(const std::string &p)
bool getInfo(yarp::os::Bottle &info)
yarp::os::BufferedPort< yarp::os::Bottle > portCmd
bool getPose(const int axis, yarp::sig::Vector &x, yarp::sig::Vector &o, yarp::os::Stamp *stamp=NULL)
bool getLimits(const int axis, double *min, double *max)
bool askForPosition(const yarp::sig::Vector &xd, yarp::sig::Vector &xdhat, yarp::sig::Vector &odhat, yarp::sig::Vector &qdhat)
bool attachTipFrame(const yarp::sig::Vector &x, const yarp::sig::Vector &o)
bool setRestPos(const yarp::sig::Vector &newRestPos, yarp::sig::Vector &curRestPos)
bool setInTargetTol(const double tol)
std::map< std::string, yarp::dev::CartesianEvent * > eventsMap
bool setRestWeights(const yarp::sig::Vector &newRestWeights, yarp::sig::Vector &curRestWeights)
std::set< int > contextIdList
double lastPoseMsgArrivalTime
ClientCartesianController(yarp::os::Searchable &config)
void eventHandling(yarp::os::Bottle &event)
bool waitMotionDone(const double period=0.1, const double timeout=0.0)
bool setTaskVelocities(const yarp::sig::Vector &xdot, const yarp::sig::Vector &odot)
yarp::os::BufferedPort< yarp::sig::Vector > portState
bool setDOF(const yarp::sig::Vector &newDof, yarp::sig::Vector &curDof)
bool unregisterEvent(yarp::dev::CartesianEvent &event)
bool getDesired(yarp::sig::Vector &xdhat, yarp::sig::Vector &odhat, yarp::sig::Vector &qdhat)
bool restoreContext(const int id)
bool registerEvent(yarp::dev::CartesianEvent &event)
bool goToPositionSync(const yarp::sig::Vector &xd, const double t=0.0)
bool setLimits(const int axis, const double min, const double max)
bool getTrajTime(double *t)
bool setTrajTime(const double t)
bool goToPose(const yarp::sig::Vector &xd, const yarp::sig::Vector &od, const double t=0.0)
bool getDOF(yarp::sig::Vector &curDof)
yarp::os::RpcClient portRpc
bool storeContext(int *id)
bool askForPose(const yarp::sig::Vector &xd, const yarp::sig::Vector &od, yarp::sig::Vector &xdhat, yarp::sig::Vector &odhat, yarp::sig::Vector &qdhat)
bool tweakSet(const yarp::os::Bottle &options)
bool setReferenceMode(const bool f)
bool setTrackingMode(const bool f)
yarp::os::Stamp poseStamp
Helper class providing useful methods to deal with Cartesian Solver options.