ROS 2 Visual Servoing Controllers

Hello ROS community!

Over the past few months, I have been working on the visual_servoing_controllers repository, a set of controllers for Visual Servoing tasks in ROS2 Jazzy. Specifically, it includes a Position-Based Visual Servoing and an Image-Based Visual Servoing controller. The controllers include an action server providing a parametrizable PBVS/IBVS task, mimicking the joint trajectory controller’s functionality.

:warning: Important: The controllers only manage the kinematic part of the Visual Servoing tasks, leaving the visual detection outside the controller. The controllers rely on a stream of 2D/6D poses received through topics to calculate the robot movements, decoupling the target detection and tracking to facilitate the integration of different implementations.

Thanks for reading, below there is some additional information about the controller:

Motivation

Visual Servoing is a well-established technique that facilitates robot positioning in classic applications with stationary objects, as well as dynamic environments with moving objects. The encapsulation of Visual Servoing control in ROS2 controllers would facilitate the development of these types of applications, enabling the deployment of a simple pipeline consisting of a detection module that streams the estimated poses directly to ROS2 controllers.

Additionally, the capability to parametrize Visual Servoing processes with custom task-oriented parameters such as destination, final tolerances, or timeouts, enables the utilization of the same controllers in distinct operations.

Features

Both the Position-Based Visual Servoing and the Image-Based Visual Servoing controllers provide the following general features:

  • ROS2 controllers including an action server that executes PBVS and IBVS tasks.
  • The control law calculates a twist value, which is internally managed to generate joint positions using KDL to calculate the Jacobian matrix and Eigen to estimate the pseudo-inverse using SVD.
  • Allows an open-loop mode in which the previously commanded joint positions are used instead of the joint positions from the state interfaces, avoiding the injection of hardware feedback latency and transport delays into the command generation loop.
  • The controllers include the option to enable the action feedback to continuously publish the pose error and the twist both in camera and tip link of the kinematic chain.

Additionally, the IBVS controller has this specific feature:

  • Due to kinematic redundancies in Image-Based Visual Servoing (IBVS), this controller includes a feature to enable or disable specific camera motion axes during 2D image-plane error correction (e.g., restricting movement to X/Y translation or pure rotation only). This ensures a predictable, task-tailored motion and prevents undesired robot movements.

Testing

The controllers have been tested on an industrial setup consisting of a UR16e robot, an Igus linear track, and a Realsense D435 RGBD camera. These tests included the use of the controllers in multiple configurations using an ArUco marker and the aruco_opencv package.

PBVS Controller

Position-Based Visual Servoing task following an ArUco marker with a UR16e robot.

pbvs

Position-Based Visual Servoing task following an ArUco marker with a 7 DoF setup consisting of a UR16e robot mounted on a linear axis.

pbvs_7_axis

IBVS Controller

Image-Based Visual Servoing task following an ArUco marker with a UR16e robot, moving only on the X/Y translation axes of the camera.

IBVS-trans

Image-Based Visual Servoing task following an ArUco marker with a UR16e robot, moving only on the X/Y rotation axes of the camera.

IBVS-rot

IBVS controller chained with the adaptive_admittence_controller, creating a compliant Visual Servoing.

IBVS-admittance

Repo

GitHub: GitHub - aitor-ibarguren/visual_servoing_controllers: ROS2 Visual Servoing controllers designed to provide actions for vision-guided tasks. · GitHub

The README includes information about the configuration of the controllers.

Feedback

I would appreciate feedback on:

  • API design
  • Additional features
    • Multiple target IBVS to enable a 6D positioning by staking image Jacobians
3 Likes

If an accuracy urdf is available, then we can move robot to target pose by IK and Plan directly, so PBVS is for the situation that good urdf is not available. Is it right ?

I would suggest PBVS for scenarios with noisy detections, where precision increases as we approach and center the target. URDF inaccuracies will affect reaching final tolerances (if high precision is required), as the controller uses this kinematic chain to the manage twist commands.

In principle, IBVS should be more tolerant of kinematic inaccuracies (based on the literature), but I have used these controllers on a UR16e, which has a reasonably good calibration.

Nevertheless, I think it is an interesting topic—maybe there are people around here who have struggled with inaccurate URDFs! :wink: