Show EOL distros: 

Package Summary

An extension of ViSP library that interfaces ROS into usual ViSP classes and a basket of generic ros nodes based on ViSP.

Package Summary

An extension of ViSP library that interfaces ROS into usual ViSP classes and a basket of generic ros nodes based on ViSP.

Package Summary

An extension of ViSP library that interfaces ROS into usual ViSP classes and a basket of generic ros nodes based on ViSP.

Package Summary

An extension of ViSP library that interfaces ROS into usual ViSP classes and a basket of generic ros nodes based on ViSP.

  • Maintainer: Fabien Spindler <Fabien.Spindler AT inria DOT fr>
  • Author: Francois Pasteau, Fabien Spindler, Gatien Gaumerais
  • License: GPLv2
  • Source: git https://github.com/lagadic/visp_ros.git (branch: master)

What is visp_ros

visp_ros is an extension of ViSP library developed by Inria. While ViSP is independent to ROS, in visp_ros we benefit from ROS features.

visp_ros.png

visp_ros is a library:

  • with new C++ classes (vpROSGrabber, vpROSRobot, vpROSRobotPioneer) that interface ROS into usual ViSP classes;
  • that makes possible to use ROS in a transparent way, either by building classical binaries without catkin, either by building ROS nodes with catkin but without the need to write ROS specific code;
  • where creating a ROS node out of ViSP becomes simple.

visp_ros contains also a set of ROS nodes that allow to control specific hardware such as for the moment robots (Afma6, Pioneer).

To illustrate visp_ros behavior let us focus on a visual servoing example.

Visual servoing example

In this example we consider the visual servo of a robot equipped with a firewire camera.

Using ViSP

With ViSP, images from a firewire camera connected to a computer running Ubuntu or Fedora can be acquired using vp1394TwoGrabber class. There are also some specific classes like vpRobotAfma6, vpRobotViper850, vpRobotPioneer that are wrapper over robot controllers.

Implementing a visual servo with ViSP is resumed in the next image:

visual-servo-visp.png

The corresponding code looks like the following:

#include <visp/vpImage.h> 
#include <visp/vp1394TwoGrabber.h> 
#include <visp/vpRobotViper850.h>

int main() 
{
  vpImage<unsigned char> I; 
  vpRobotViper850 robot; 
  robot.init();

  vp1394TwoGrabber g; 
  g.open(I); 

  while(1) {
    g.acquire(I); 
    // Visual servoing code 
    robot.setVelocity(vpRobot::CAMERA_FRAME, v);
  }
}

Using visp_ros

Using visp_ros allows to completely separate the code that is specific to the material (frame grabber, robot) from the one that does the visual servoing.

In visp_ros we introduce a new class named vpROSGrabber that is able to subscribe to an image topic. This class can be used to replace any ViSP grabber. We also introduce vpROSRobot that is able to publish cmd_vel velocities on a given topic.

visual-servo-ros.png

Now using visp_ros, we can do the same by subscribing to the /camera/image_raw topic and by publishing velocities to the /myrobot/cmd_vel topic.

#include <visp/vpImage.h> 
#include <visp_ros/vpROSGrabber.h>
#include <visp_ros/vpROSRobot.h>

int main() 
{
  vpImage<unsigned char> I; 
  vpROSRobot robot; 
  robot.setCmdVelTopic("/myrobot/cmd_vel");
  robot.init();

  vpROSGrabber g; 
  g.setImageTopic("/camera/image_raw");
  g.open(I); 

  while(1) {
    g.acquire(I); 
    // Visual servoing code 
    robot.setVelocity(vpRobot::CAMERA_FRAME, v);
  }
}

It is also possible to subscribe to a jpeg topic named for example "/camera/image_jpg" using the following code:

  ...
  vpROSGrabber g; 
  g.setImageTopic("/camera/image_jpg"); // Name of the compressed topic
  g.setImageTransport("jpeg");          // Type of compression. Must differ from "raw"
  g.open(I); 
  ...

Using visp_ros to produce a ROS node

With minor changes, it is possible to modify the previous example in order to create a ROS node that does the visual servoing in a complete transparent way just by passing argc and argv parameters.

visual-servo-ros-node.png

#include <visp/vpImage.h> 
#include <visp_ros/vpROSGrabber.h>
#include <visp_ros/vpROSRobot.h>

int main(int argc, char **argv) 
{
  vpImage<unsigned char> I; 
  vpROSRobot robot; 
  robot.setCmdVelTopic("/myrobot/cmd_vel");
  robot.init(argc, argv);

  vpROSGrabber g; 
  g.setImageTopic("/camera/image_raw");
  g.open(argc, argv); 

  while(1) {
    g.acquire(I); 
    // Visual servoing code 
    robot.setVelocity(vpRobot::CAMERA_FRAME, v);
  }
}

Installation

The tutorial How to install visp_ros explains how to build and install visp_ros in a catkin workspace.

Documentation

Wiki: visp_ros (last edited 2014-06-19 08:50:33 by FabienSpindler)