YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IVisualServoing.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_DEV_VISUALSERVOING_H
7#define YARP_DEV_VISUALSERVOING_H
8
9#include <string>
10#include <vector>
11
12#include <yarp/os/Bottle.h>
13#include <yarp/sig/Vector.h>
14#include <yarp/dev/api.h>
15
16namespace yarp::dev {
17class IVisualServoing;
18}
19
20
27{
28public:
32 enum class CamSel { left, right };
33
38
50 virtual bool initFacilities(bool use_direct_kin) = 0;
51
58 virtual bool resetFacilities() = 0;
59
67 virtual bool stopFacilities() = 0;
68
84 virtual bool goToGoal(const std::vector<yarp::sig::Vector>& vec_px_l, const std::vector<yarp::sig::Vector>& vec_px_r) = 0;
85
100 virtual bool goToGoal(const yarp::sig::Vector& vec_x, const yarp::sig::Vector& vec_o) = 0;
101
113 virtual bool setModality(const std::string& mode) = 0;
114
124 virtual bool setVisualServoControl(const std::string& control) = 0;
125
137 virtual bool setControlPoint(const std::string& point) = 0;
138
147
155 virtual bool setGoToGoalTolerance(const double tol) = 0;
156
166
181 virtual bool waitVisualServoingDone(const double period = 0.1, const double timeout = 0.0) = 0;
182
189 virtual bool stopController() = 0;
190
201 virtual bool setTranslationGain(const double K_x_1, const double K_x_2) = 0;
202
212 virtual bool setMaxTranslationVelocity(const double max_x_dot) = 0;
213
220 virtual bool setTranslationGainSwitchTolerance(const double K_x_tol) = 0;
221
232 virtual bool setOrientationGain(const double K_o_1, const double K_o_2) = 0;
233
242 virtual bool setMaxOrientationVelocity(const double max_o_dot) = 0;
243
250 virtual bool setOrientationGainSwitchTolerance(const double K_o_tol) = 0;
251
264 virtual std::vector<yarp::sig::Vector> get3DGoalPositionsFrom3DPose(const yarp::sig::Vector& x, const yarp::sig::Vector& o) = 0;
265
279 virtual std::vector<yarp::sig::Vector> getGoalPixelsFrom3DPose(const yarp::sig::Vector& x, const yarp::sig::Vector& o, const CamSel& cam) = 0;
280
281
282 /* TO BE DEPRECATED */
294 virtual bool storedInit(const std::string& label) = 0;
295
307 virtual bool storedGoToGoal(const std::string& label) = 0;
308
317 virtual bool goToSFMGoal() = 0;
318};
319
320#endif /* YARP_DEV_VISUALSERVOING_H */
contains the definition of a Vector type
Interface for visual servoing controllers.
virtual bool stopFacilities()=0
Deallocate support classes, stop modules and disconnect connections used for visual servoing.
virtual bool goToSFMGoal()=0
Get goal point from SFM module.
virtual bool setVisualServoControl(const std::string &control)=0
Set visual servo control law.
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.
virtual bool initFacilities(bool use_direct_kin)=0
Initialize support classes, modules and connections to perform visual servoing.
virtual bool setOrientationGainSwitchTolerance(const double K_o_tol)=0
Set the tolerance, in pixels, at which the orientation control law swithces its gain value.
virtual bool storedInit(const std::string &label)=0
Initialize the robot to an initial position.
virtual bool setOrientationGain(const double K_o_1, const double K_o_2)=0
Set the orientation gains of the visual servoing control algorithm.
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...
virtual bool stopController()=0
Ask for an immediate stop of the visual servoing controller.
virtual bool storedGoToGoal(const std::string &label)=0
Set the robot visual servoing goal.
virtual bool resetFacilities()=0
Reset support classes, modules and connections to perform visual servoing.
virtual bool setGoToGoalTolerance(const double tol)=0
Set visual servoing goal tolerance.
virtual bool waitVisualServoingDone(const double period=0.1, const double timeout=0.0)=0
Wait until visual servoing reaches the goal.
virtual bool checkVisualServoingController()=0
Check once whether the visual servoing controller is running or not.
virtual ~IVisualServoing()
Destructor.
virtual bool setModality(const std::string &mode)=0
Set visual servoing operating mode between:
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...
virtual bool getVisualServoingInfo(yarp::os::Bottle &info)=0
Return useful information for visual servoing.
virtual bool setTranslationGain(const double K_x_1, const double K_x_2)=0
Set the translation gains of the visual servoing control algorithm.
virtual bool setTranslationGainSwitchTolerance(const double K_x_tol)=0
Set the tolerance, in pixels, at which the translation control law swithces its gain value.
virtual bool setMaxTranslationVelocity(const double max_x_dot)=0
Set the maximum translation velocity of the visual servoing control algorithm (same for each axis).
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...
virtual bool setControlPoint(const std::string &point)=0
Set the point controlled during visual servoing.
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...
CamSel
Enumeration class to select left or right camera.
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:64
For streams capable of holding different kinds of content, check what they actually have.
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18