YARP
Yet Another Robot Platform
IVisualServoing.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_DEV_VISUALSERVOING_H
10 #define YARP_DEV_VISUALSERVOING_H
11 
12 #include <string>
13 #include <vector>
14 
15 #include <yarp/os/Bottle.h>
16 #include <yarp/sig/Vector.h>
17 #include <yarp/dev/api.h>
18 
19 namespace yarp{
20  namespace dev {
21  class IVisualServoing;
22  }
23 }
24 
25 
30 {
31 public:
35  enum class CamSel { left, right };
36 
40  virtual ~IVisualServoing();
41 
53  virtual bool initFacilities(bool use_direct_kin) = 0;
54 
61  virtual bool resetFacilities() = 0;
62 
70  virtual bool stopFacilities() = 0;
71 
87  virtual bool goToGoal(const std::vector<yarp::sig::Vector>& vec_px_l, const std::vector<yarp::sig::Vector>& vec_px_r) = 0;
88 
103  virtual bool goToGoal(const yarp::sig::Vector& vec_x, const yarp::sig::Vector& vec_o) = 0;
104 
116  virtual bool setModality(const std::string& mode) = 0;
117 
127  virtual bool setVisualServoControl(const std::string& control) = 0;
128 
140  virtual bool setControlPoint(const std::string& point) = 0;
141 
149  virtual bool getVisualServoingInfo(yarp::os::Bottle& info) = 0;
150 
158  virtual bool setGoToGoalTolerance(const double tol) = 0;
159 
168  virtual bool checkVisualServoingController() = 0;
169 
184  virtual bool waitVisualServoingDone(const double period = 0.1, const double timeout = 0.0) = 0;
185 
192  virtual bool stopController() = 0;
193 
204  virtual bool setTranslationGain(const double K_x_1, const double K_x_2) = 0;
205 
215  virtual bool setMaxTranslationVelocity(const double max_x_dot) = 0;
216 
223  virtual bool setTranslationGainSwitchTolerance(const double K_x_tol) = 0;
224 
235  virtual bool setOrientationGain(const double K_o_1, const double K_o_2) = 0;
236 
245  virtual bool setMaxOrientationVelocity(const double max_o_dot) = 0;
246 
253  virtual bool setOrientationGainSwitchTolerance(const double K_o_tol) = 0;
254 
267  virtual std::vector<yarp::sig::Vector> get3DGoalPositionsFrom3DPose(const yarp::sig::Vector& x, const yarp::sig::Vector& o) = 0;
268 
282  virtual std::vector<yarp::sig::Vector> getGoalPixelsFrom3DPose(const yarp::sig::Vector& x, const yarp::sig::Vector& o, const CamSel& cam) = 0;
283 
284 
285  /* TO BE DEPRECATED */
297  virtual bool storedInit(const std::string& label) = 0;
298 
310  virtual bool storedGoToGoal(const std::string& label) = 0;
311 
320  virtual bool goToSFMGoal() = 0;
321 };
322 
323 #endif /* YARP_DEV_VISUALSERVOING_H */
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:73
yarp::dev::IVisualServoing::goToGoal
virtual bool goToGoal(const std::vector< yarp::sig::Vector > &vec_px_l, const std::vector< yarp::sig::Vector > &vec_px_r)=0
Set the goal points on both left and right camera image plane and start visual servoing.
yarp::dev::IVisualServoing::~IVisualServoing
virtual ~IVisualServoing()
Destructor.
Vector.h
contains the definition of a Vector type
yarp::dev::IVisualServoing::setControlPoint
virtual bool setControlPoint(const std::string &point)=0
Set the point controlled during visual servoing.
yarp::dev::IVisualServoing
Interface for visual servoing controllers.
Definition: IVisualServoing.h:30
yarp::dev::IVisualServoing::waitVisualServoingDone
virtual bool waitVisualServoingDone(const double period=0.1, const double timeout=0.0)=0
Wait until visual servoing reaches the goal.
yarp::dev::IVisualServoing::CamSel
CamSel
Enumeration class to select left or right camera.
Definition: IVisualServoing.h:35
yarp::dev::IVisualServoing::setTranslationGain
virtual bool setTranslationGain(const double K_x_1, const double K_x_2)=0
Set the translation gains of the visual servoing control algorithm.
yarp::sig::VectorOf< double >
yarp::dev::IVisualServoing::setMaxOrientationVelocity
virtual bool setMaxOrientationVelocity(const double max_o_dot)=0
Set the maximum angular velocity of the axis-angle velocity vector of the visual servoing control alg...
yarp::dev::IVisualServoing::setOrientationGain
virtual bool setOrientationGain(const double K_o_1, const double K_o_2)=0
Set the orientation gains of the visual servoing control algorithm.
yarp::dev::IVisualServoing::stopFacilities
virtual bool stopFacilities()=0
Deallocate support classes, stop modules and disconnect connections used for visual servoing.
yarp::dev::IVisualServoing::stopController
virtual bool stopController()=0
Ask for an immediate stop of the visual servoing controller.
yarp::dev::IVisualServoing::getVisualServoingInfo
virtual bool getVisualServoingInfo(yarp::os::Bottle &info)=0
Return useful information for visual servoing.
yarp::dev::IVisualServoing::setGoToGoalTolerance
virtual bool setGoToGoalTolerance(const double tol)=0
Set visual servoing goal tolerance.
yarp::dev::IVisualServoing::getGoalPixelsFrom3DPose
virtual std::vector< yarp::sig::Vector > getGoalPixelsFrom3DPose(const yarp::sig::Vector &x, const yarp::sig::Vector &o, const CamSel &cam)=0
Helper function: extract four 2D pixel points lying on the plane defined by the frame o in the positi...
yarp::dev::IVisualServoing::setVisualServoControl
virtual bool setVisualServoControl(const std::string &control)=0
Set visual servo control law.
yarp::dev::IVisualServoing::get3DGoalPositionsFrom3DPose
virtual std::vector< yarp::sig::Vector > get3DGoalPositionsFrom3DPose(const yarp::sig::Vector &x, const yarp::sig::Vector &o)=0
Helper function: extract four Cartesian points lying on the plane defined by the frame o in the posit...
yarp::dev::IVisualServoing::storedGoToGoal
virtual bool storedGoToGoal(const std::string &label)=0
Set the robot visual servoing goal.
yarp::dev::IVisualServoing::initFacilities
virtual bool initFacilities(bool use_direct_kin)=0
Initialize support classes, modules and connections to perform visual servoing.
yarp::dev::IVisualServoing::resetFacilities
virtual bool resetFacilities()=0
Reset support classes, modules and connections to perform visual servoing.
yarp::dev::IVisualServoing::checkVisualServoingController
virtual bool checkVisualServoingController()=0
Check once whether the visual servoing controller is running or not.
yarp::dev::IVisualServoing::goToGoal
virtual bool goToGoal(const yarp::sig::Vector &vec_x, const yarp::sig::Vector &vec_o)=0
Set the goal point (3D for the position + 4D axis-angle for the orientation) and start visual servoin...
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::IVisualServoing::setTranslationGainSwitchTolerance
virtual bool setTranslationGainSwitchTolerance(const double K_x_tol)=0
Set the tolerance, in pixels, at which the translation control law swithces its gain value.
yarp::dev::IVisualServoing::setMaxTranslationVelocity
virtual bool setMaxTranslationVelocity(const double max_x_dot)=0
Set the maximum translation velocity of the visual servoing control algorithm (same for each axis).
yarp::dev::IVisualServoing::setModality
virtual bool setModality(const std::string &mode)=0
Set visual servoing operating mode between:
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::dev::IVisualServoing::setOrientationGainSwitchTolerance
virtual bool setOrientationGainSwitchTolerance(const double K_o_tol)=0
Set the tolerance, in pixels, at which the orientation control law swithces its gain value.
api.h
Bottle.h
yarp::dev::IVisualServoing::storedInit
virtual bool storedInit(const std::string &label)=0
Initialize the robot to an initial position.
yarp::dev::IVisualServoing::goToSFMGoal
virtual bool goToSFMGoal()=0
Get goal point from SFM module.