This website uses browsing/session and functional cookies to ensure you get the best experience. Learn More

YARP and PlayerStage

From Wiki for iCub and Friends
Jump to: navigation, search

Player/Stage has a driver called "yarpimage" that allows it to read images from a YARP Network.

Example configuration file:

   name "yarpimage"
   provides ["camera:0"]
   # network protocol to use - tcp, udp, mcast, shmem, etc
   carrier "tcp"
   # name of yarp port to get images from
   image_port "/grabber"
   # name to call local yarp port
   port "/player/image"
   image_format 1

To test this out, make an image source called "/grabber":

 yarpdev --device test_grabber  --name /grabber

Run the player server with the configuration file given above. Then running playercam should show a scrolling line.

Messages from the player server look like:

 $ player yarp.config 
 * Part of the Player/Stage/Gazebo Project [1].
 * Copyright (C) 2000 - 2006 Brian Gerkey, Richard Vaughan, Andrew Howard,
 * Nate Koenig, and contributors. Released under the GNU General Public License.
 * Player comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
 * are welcome to redistribute it under certain conditions; see COPYING
 * for details.
 Listening on ports: 6665 
 accepted TCP client 0 on port 6665, fd 6
 yarp: Port /player/image listening at tcp://
 carrier is tcp
 > Yarp_Image starting up... [done]
 warning : skipping subscription to unknown device 7:0
 yarp: Receiving input from /grabber to /player/image using tcp

Messages from the playercam client look like:

 $ playercam
 playerc error   : got NACK from request
 playerc error   : failed to get response
 blobfinder error: failed to get response
 playercam will attempt to continue without a blobfinder
 camera: [w 128 h 128 d 0] [16384/16384 bytes]

If you have problems make sure that the image source is working:

 yarpview --name /viewer &
 yarp connect /grabber /viewer


If you don't have a recent CVS version, you may need to patch player/stage a little bit:

  • added to acinclude.m4:
   after: for header in $header_list; do
   add: ac_ext=cc

( otherwise header file usage fails (they contain C++ constructs)

  • Needed to modify this line in acinclude.m4
       ["yarp/os/all.h yarp/sig/all.h"],[],
       ["-lYARP_sig -lYARP_OS -lACE"])
  • (Added ACE library)
Personal tools