visual-tracking-control
Public Member Functions | List of all members
VisualServoingIDL Class Reference

VisualServoingIDL IDL Interface to ServerVisualServoing functionalities. More...

#include <VisualServoingIDL.h>

Inheritance diagram for VisualServoingIDL:
[legend]

Public Member Functions

 VisualServoingIDL ()
 
virtual bool init_facilities (const bool use_direct_kin)
 Initialize support modules and connections to perform a visual servoing task. More...
 
virtual bool reset_facilities ()
 Reset support modules and connections to perform the current initialized visual servoing task. More...
 
virtual bool stop_facilities ()
 Stop and disconnect support modules and connections used for visual servoing. More...
 
virtual bool go_to_px_goal (const std::vector< std::vector< double > > &vec_px_l, const std::vector< std::vector< double > > &vec_px_r)
 Set the goal points on both left and right camera image plane and start visual servoing. More...
 
virtual bool go_to_pose_goal (const std::vector< double > &vec_x, const std::vector< double > &vec_o)
 Set the goal point (3D for the position + 4D axis-angle for the orientation) and start visual servoing. More...
 
virtual bool set_modality (const std::string &mode)
 Set visual servoing operating mode between: More...
 
virtual bool set_visual_servo_control (const std::string &control)
 Set visual servo control law between: More...
 
virtual bool set_control_point (const std::string &point)
 Set the point controlled during visual servoing. More...
 
virtual std::vector< std::string > get_visual_servoing_info ()
 Return useful information for visual servoing. More...
 
virtual bool set_go_to_goal_tolerance (const double tol)
 Set visual servoing goal tolerance. More...
 
virtual bool check_visual_servoing_controller ()
 Check once whether the visual servoing controller is running or not. More...
 
virtual bool wait_visual_servoing_done (const double period, const double timeout)
 Wait until visual servoing reaches the goal. More...
 
virtual bool stop_controller ()
 Ask for an immediate stop of the visual servoing controller. More...
 
virtual bool set_translation_gain (const double K_x_1, const double K_x_2)
 Set the translation gains of the visual servoing control algorithm. More...
 
virtual bool set_max_translation_velocity (const double max_x_dot)
 Set the maximum translation velocity of the visual servoing control algorithm (same for each axis). More...
 
virtual bool set_translation_gain_switch_tolerance (const double K_x_tol)
 Set the tolerance, in pixels, at which the translation control law swithces its gain value. More...
 
virtual bool set_orientation_gain (const double K_o_1, const double K_o_2)
 Set the orientation gains of the visual servoing control algorithm. More...
 
virtual bool set_max_orientation_velocity (const double max_o_dot)
 Set the maximum angular velocity of the axis-angle velocity vector of the visual servoing control algorithm. More...
 
virtual bool set_orientation_gain_switch_tolerance (const double K_o_tol)
 Set the tolerance, in pixels, at which the orientation control law swithces its gain value. More...
 
virtual std::vector< std::vector< double > > get_3D_goal_positions_from_3D_pose (const std::vector< double > &x, const std::vector< double > &o)
 Helper function: extract four Cartesian points lying on the plane defined by the frame o in the position x relative to the robot base frame. More...
 
virtual std::vector< std::vector< double > > get_goal_pixels_from_3D_pose (const std::vector< double > &x, const std::vector< double > &o, const std::string &cam)
 Helper function: extract four 2D pixel points lying on the plane defined by the frame o in the position x relative to the robot base frame. More...
 
virtual bool quit ()
 Gently close the visual servoing device, deallocating resources. More...
 
virtual bool stored_init (const std::string &label)
 Initialize the robot to an initial position. More...
 
virtual bool stored_go_to_goal (const std::string &label)
 Set the robot visual servoing goal. More...
 
virtual bool get_goal_from_sfm ()
 Get goal point from SFM module. More...
 
virtual bool read (yarp::os::ConnectionReader &connection) override
 
virtual std::vector< std::string > help (const std::string &functionName="--all")
 

Detailed Description

VisualServoingIDL IDL Interface to ServerVisualServoing functionalities.

Definition at line 17 of file VisualServoingIDL.h.

Constructor & Destructor Documentation

◆ VisualServoingIDL()

VisualServoingIDL::VisualServoingIDL ( )

Member Function Documentation

◆ check_visual_servoing_controller()

virtual bool VisualServoingIDL::check_visual_servoing_controller ( )
virtual

Check once whether the visual servoing controller is running or not.

Returns
true/false on it is running/not running.
Note
The visual servoing controller may be terminated due to many different reasons, not strictly related to reaching the goal.

Reimplemented in VisualServoingServer.

◆ get_3D_goal_positions_from_3D_pose()

virtual std::vector<std::vector<double> > VisualServoingIDL::get_3D_goal_positions_from_3D_pose ( const std::vector< double > &  x,
const std::vector< double > &  o 
)
virtual

Helper function: extract four Cartesian points lying on the plane defined by the frame o in the position x relative to the robot base frame.

Parameters
xa 3D vector which is filled with the actual position (x, y, z) [m].
oa 4D vector which is filled with the actual orientation using axis-angle representation (xa, ya, za) and (theta) [rad].
Returns
on success: a collection of four Cartesian points (position only) extracted from the plane defined by x and o; on failure: an empty list.
Note
It is always suggested to check whether the returned list is empty or not and to take proper counter actions.

Reimplemented in VisualServoingServer.

◆ get_goal_from_sfm()

virtual bool VisualServoingIDL::get_goal_from_sfm ( )
virtual

Get goal point from SFM module.

The point is taken by clicking on a dedicated 'yarpview' GUI and the orientation is hard-coded.

Note
This service is experimental and should be used with care.
Returns
true upon success, false otherwise.

Reimplemented in VisualServoingServer.

◆ get_goal_pixels_from_3D_pose()

virtual std::vector<std::vector<double> > VisualServoingIDL::get_goal_pixels_from_3D_pose ( const std::vector< double > &  x,
const std::vector< double > &  o,
const std::string &  cam 
)
virtual

Helper function: extract four 2D pixel points lying on the plane defined by the frame o in the position x relative to the robot base frame.

Parameters
xa 3D vector which is filled with the actual position (x, y, z) [m].
oa 4D vector which is filled with the actual orientation using axis-angle representation (xa, ya, za) and (theta) [m]/[rad].
cameither "left" or "right" to select left or right camera.
Returns
on success: a collection of three (u, v) pixel points extracted from the plane defined by x and o; on failure: an empty list.
Note
It is always suggested to check whether the returned list is empty or not and to take proper counter actions.

Reimplemented in VisualServoingServer.

◆ get_visual_servoing_info()

virtual std::vector<std::string> VisualServoingIDL::get_visual_servoing_info ( )
virtual

Return useful information for visual servoing.

Returns
All the visual servoing information.

Reimplemented in VisualServoingServer.

◆ go_to_pose_goal()

virtual bool VisualServoingIDL::go_to_pose_goal ( const std::vector< double > &  vec_x,
const std::vector< double > &  vec_o 
)
virtual

Set the goal point (3D for the position + 4D axis-angle for the orientation) and start visual servoing.

Parameters
vec_xa 3D vector which contains the (x, y, z) Cartesian coordinates of the goal.
vec_oa 4D vector which contains the (x, y, z) axis and theta angle of rotation of the goal.
Note
By invoking this method, the visual servoing goal will be reached in position and orientation together with two parallel tasks.
Returns
true/false on success/failure.

Reimplemented in VisualServoingServer.

◆ go_to_px_goal()

virtual bool VisualServoingIDL::go_to_px_goal ( const std::vector< std::vector< double > > &  vec_px_l,
const std::vector< std::vector< double > > &  vec_px_r 
)
virtual

Set the goal points on both left and right camera image plane and start visual servoing.

Parameters
vec_px_la collection of four 2D vectors which contains the (u, v) coordinates of the pixels within the left image plane.
vec_px_ra collection of four 2D vectors which contains the (u, v) coordinates of the pixels within the right image plane.
Note
By invoking this method, the visual servoing goal will be reached in orientation first, then in position. This is because there may not be a feasible position solution for every possible orientation.
Returns
true/false on success/failure.

◆ help()

virtual std::vector<std::string> VisualServoingIDL::help ( const std::string &  functionName = "--all")
virtual

◆ init_facilities()

virtual bool VisualServoingIDL::init_facilities ( const bool  use_direct_kin)
virtual

Initialize support modules and connections to perform a visual servoing task.

This method must be called before any other visual servoing methods. Returns upon successful or failure setup.

Parameters
use_direct_kininstruct the visual servoing control to either use direct kinematic or an estimated/refined pose of the end-effector.
Note
Default value: false. There usually is an error in the robot direct kinematics that should be compensated to perform precise visual servoing. To this end, a recursive Bayesian estimation filter is used to compensate for this error. Such filter is initialized during initialization execution.
Returns
true/false on success/failure.

Reimplemented in VisualServoingServer.

◆ quit()

virtual bool VisualServoingIDL::quit ( )
virtual

Gently close the visual servoing device, deallocating resources.

Reimplemented in VisualServoingServer.

◆ read()

virtual bool VisualServoingIDL::read ( yarp::os::ConnectionReader &  connection)
overridevirtual

◆ reset_facilities()

virtual bool VisualServoingIDL::reset_facilities ( )
virtual

Reset support modules and connections to perform the current initialized visual servoing task.

Returns upon successful or failure setup.

Note
This method also resets the recursive Bayesian estimation filter. It may happen that the recursive Bayesian filter does not provide satisfactory pose estimation or diverges. Thus this method can be used to reset the filter.
Returns
true/false on success/failure.

Reimplemented in VisualServoingServer.

◆ set_control_point()

virtual bool VisualServoingIDL::set_control_point ( const std::string &  point)
virtual

Set the point controlled during visual servoing.

Parameters
pointlabel of the point to control.
Returns
true/false on success/failure.
Note
The points available to control are identified by a distinct, unique label. Such labels can are stored in the bottle returned by the getInfo() method.

Reimplemented in VisualServoingServer.

◆ set_go_to_goal_tolerance()

virtual bool VisualServoingIDL::set_go_to_goal_tolerance ( const double  tol)
virtual

Set visual servoing goal tolerance.

Parameters
tolthe tolerance in pixel.
Returns
true/false on success/failure.
Note
Default value: 15.0 [pixel].

Reimplemented in VisualServoingServer.

◆ set_max_orientation_velocity()

virtual bool VisualServoingIDL::set_max_orientation_velocity ( const double  max_o_dot)
virtual

Set the maximum angular velocity of the axis-angle velocity vector of the visual servoing control algorithm.

Parameters
max_x_dotthe maximum allowed angular velocity [rad/s].
Returns
true/false on success/failure.
Note
Default value: 5 * (PI / 180.0) [rad/s].

Reimplemented in VisualServoingServer.

◆ set_max_translation_velocity()

virtual bool VisualServoingIDL::set_max_translation_velocity ( const double  max_x_dot)
virtual

Set the maximum translation velocity of the visual servoing control algorithm (same for each axis).

Parameters
max_x_dotthe maximum allowed velocity for x, y, z coordinates [m/s].
Returns
true/false on success/failure.
Note
Default value: max_x_dot = 0.025 [m/s].

Reimplemented in VisualServoingServer.

◆ set_modality()

virtual bool VisualServoingIDL::set_modality ( const std::string &  mode)
virtual

Set visual servoing operating mode between:

  1. 'position': position-only visual servo control;
  2. 'orientation': orientation-only visual servo control;
  3. 'pose': position + orientation visual servo control.
    Parameters
    modea label referring to one of the three operating mode, i.e. 'position', 'orientation' or 'pose'.
    Returns
    true/false on success/failure.

Reimplemented in VisualServoingServer.

◆ set_orientation_gain()

virtual bool VisualServoingIDL::set_orientation_gain ( const double  K_o_1,
const double  K_o_2 
)
virtual

Set the orientation gains of the visual servoing control algorithm.

The two values are used, respectively, when the end-effector is far away from and close to the goal.

Returns
true/false on success/failure.
Note
Warning: higher values of the gain corresponds to higher orientation velocities and oscillation about the goal.
Default values: K_o_1 = 1.5, K_o_2 = 0.375.

Reimplemented in VisualServoingServer.

◆ set_orientation_gain_switch_tolerance()

virtual bool VisualServoingIDL::set_orientation_gain_switch_tolerance ( const double  K_o_tol)
virtual

Set the tolerance, in pixels, at which the orientation control law swithces its gain value.

Returns
true/false on success/failure.
Note
Default value: K_o_tol = 30.0 [pixel].

Reimplemented in VisualServoingServer.

◆ set_translation_gain()

virtual bool VisualServoingIDL::set_translation_gain ( const double  K_x_1,
const double  K_x_2 
)
virtual

Set the translation gains of the visual servoing control algorithm.

The two values are used, respectively, when the end-effector is far away from and close to the goal.

Returns
true/false on success/failure.
Note
Warning: higher values of the gain corresponds to higher translation velocities and oscillation about the goal.
Default values: K_x_1 = 1.0, K_x_2 = 0.25.

Reimplemented in VisualServoingServer.

◆ set_translation_gain_switch_tolerance()

virtual bool VisualServoingIDL::set_translation_gain_switch_tolerance ( const double  K_x_tol)
virtual

Set the tolerance, in pixels, at which the translation control law swithces its gain value.

Returns
true/false on success/failure.
Note
Default value: K_x_tol = 30.0 [pixel].

Reimplemented in VisualServoingServer.

◆ set_visual_servo_control()

virtual bool VisualServoingIDL::set_visual_servo_control ( const std::string &  control)
virtual

Set visual servo control law between:

  1. 'decoupled': image-based visual servoing with decoupled position and orientation control law, the control law was proposed in [1];
  2. 'robust': image-based visual servoing with averaged image Jacobians, the control law was proposed in [2];
    Parameters
    modea label referring to one of the three visual servo controls, i.e. 'position', 'orientation' or 'pose'.
    Note
    [1] C. Fantacci, G. Vezzani, U. Pattacini, V. Tikhanoff and L. Natale, "Precise markerless visual servoing on unknown objects for humanoid robot platforms", to appear. [2] E. Malis, “Improving vision-based control using efficient second-order minimization techniques”, IEEE ICRA, vol. 2, p. 1843–1848, 2004.
    Returns
    true/false on success/failure.

Reimplemented in VisualServoingServer.

◆ stop_controller()

virtual bool VisualServoingIDL::stop_controller ( )
virtual

Ask for an immediate stop of the visual servoing controller.

[wait for reply]

Returns
true/false on success/failure.

Reimplemented in VisualServoingServer.

◆ stop_facilities()

virtual bool VisualServoingIDL::stop_facilities ( )
virtual

Stop and disconnect support modules and connections used for visual servoing.

This method must be called when visual servoing is no longer needed or a new visual servoing task need to be initialized.

Note
This method also stops the recursive Bayesian estimation filter. Thus it is suggested to call this method every time visual servoing has been completed/interrupted to have the filter stopped and initialized again during the next init call.
Returns
true/false on success/failure.

Reimplemented in VisualServoingServer.

◆ stored_go_to_goal()

virtual bool VisualServoingIDL::stored_go_to_goal ( const std::string &  label)
virtual

Set the robot visual servoing goal.

The goals are stored on an external file and are referenced by a unique label.

Parameters
labela label referring to one of the available goals; the string shall be one of the available modes returned by the get_info() method.
Returns
true upon success, false otherwise.

Reimplemented in VisualServoingServer.

◆ stored_init()

virtual bool VisualServoingIDL::stored_init ( const std::string &  label)
virtual

Initialize the robot to an initial position.

The initial positions are stored on an external file and are referenced by a unique label.

Parameters
labela label referring to one of the available initial positions; the string shall be one of the available modes returned by the get_info() method.
Returns
true upon success, false otherwise.

Reimplemented in VisualServoingServer.

◆ wait_visual_servoing_done()

virtual bool VisualServoingIDL::wait_visual_servoing_done ( const double  period,
const double  timeout 
)
virtual

Wait until visual servoing reaches the goal.

[wait for reply]

Parameters
periodthe check time period [s].
timeoutthe check expiration time [s]. If timeout <= 0 (as by default) the check will be performed without time limitation.
Returns
true for success, false for failure and timeout expired.
Note
The tolerance to which the goal is considered achieved can be set with the method setGoToGoalTolerance().
Default values: period 0.1 [s], timeout 0.0 [s].

Reimplemented in VisualServoingServer.


The documentation for this class was generated from the following file: