Ucamserver: Difference between revisions

From Rsewiki
No edit summary
Line 155: Line 155:


This may advance the image.log file too (to the same log-time), and thus trigger another image and any command related to that image.
This may advance the image.log file too (to the same log-time), and thus trigger another image and any command related to that image.
===Image.log file format===
The image log file has one line per image, like:
1287579606.142885 159 120 160 1050.00 2 0.000 0.000 0.000 0.0000 0.0000 0.0000 img00000159-cam02-20101020_150006.142.png
1287579608.842862 186 120 160 1050.00 2 0.000 0.000 0.000 0.0000 0.0000 0.0000 img00000186-cam02-20101020_150008.842.png
1287579609.642899 194 120 160 1050.00 2 0.000 0.000 0.000 0.0000 0.0000 0.0000 img00000194-cam02-20101020_150009.642.png
1287579610.242894 200 120 160 1050.00 2 0.000 0.000 0.000 0.0000 0.0000 0.0000 img00000200-cam02-20101020_150010.242.png
and the following format on each line:
* timestamp (seconds since 1 jan 1970)
* image serial number
* image height
* image width
* camera focal length in pixels (as set in camera configuration file ''ucamserver.ini'')
* camera x pose relative to robot (forward)
* camera y pose relative to robot (left)
* camera z pose relative to robot (up)
* camera Omega Rotation (in radians) around x-axis
* camera Phi  Rotation (in radians) around y-axis
* camera Kappa Rotation (in radians) around z-axis
* image filename

Revision as of 16:23, 20 October 2010

Introduction

Intended for image handling functions.

The following camera-related plug-ins are available:

  • Camera control (camget, camset etc)
  • Image access (imageget, imageset) access to fresh images.
  • Image pool handling (poolget poollist etc.) pool of imege buffers with image handling functionality.
  • Guidemark detection (gmkget) giudemark 3D pose and code
  • Road outline plugin (pathget) polygon with road outline matching a seed area.
  • Sample plugin (center of gravity)

The following cameras are supported:

  • all USB cameras supported by the pwc (Philips Web Cam) driver, e.g.
  • - Philips 740K, 840K,
  • - Logitech Orbit
  • A few frame-grapper cards (I have not tried for a long time)
  • IEEE1394 DCI-standard
  • IEEE1394 DVI - not supported
  • palantir streaming video - not supported p.t.

Run the server

Run the server in a directory with a configuration file (ucamserver.ini)

ucamserver

It then shows a command prompt:

>>

To monitor images and results use the monitoring client UCLIENT or AUCLIENT (or the server console directly - or as a last resort TELNET)

See:

>> module list

For further help about the server and a list of all available commands (from all plug-ins) use:

>> help

Each of the listed commands should have an on-line help function, e.g:

>> camset help

Typical configuration SMR

A camera server configuration (ucamserver.ini) for the SMR could be:

server dataPath="/vhome/jca/logfiles"
server imagepath="/vhome/jca/logfiles/imgorg"
module load=var
module load=gmk
module load=odopose
odopose log
# camera parameters for GUPPY camera (device 10)
camset device=10 focallength=650
camset device=10 posx=0.4 posy=0.0 posz=0.87 rotphi=0.3
module load=path
# ballfinder and configuration
module load="./aub2.so.0"
var b2.redlim="105 127 129 180"
var b2.bluelim="115 200 95 132"
var b2.ballsize=0.12
var b2.topline=75
var b2.minsize=20
var b2.maxsize=65
# log images from device 10
camset device=10 log
# use an image every 1.5 seconds (image is logged and available in image pool)
push t=1.5 cmd="imageget img=10"
# use the image to find balls every time image 10 is updated
poolpush img=10 cmd="ball blue debug='true'"


Logfile for odometry and used images will then be produced in datapath, and the images saved in the imagepata.

These files cam be replayed for repeated function testing.

Replay configuration

Make a directory for the replay configuration, e.g. replay/ballfinder:

mkdir ~/replay/ballfinder
cd ~/replay/ballfinder

place a copy of the cameraserver configuration file ucamserver.ini in this directory.

Make a subdirectory in this directory, e.g. called log

mkdir log
cd log

Place the logfiles (odoPose.log and image.log) in this directory

cp <sourcedir>/*.log .

Make a further subdirectory for the images, this directory MUST be called imgorg

mkdir imgorg
cp <imagepath>/*.png imgorg/

The ucamserver.ini need to be modified slightly to enable the replay:

server dataPath="/vhome/jca/logfiles"
server imagepath="/vhome/jca/logfiles/imgorg"
server replayPath="/vhome/jca/replay/ballfinder"              <--- new
module load=var
module load=gmk
module load=odopose
odopose replay                                                <--- new
# odopose log                                                 <--- changed to comment
# camera parameters for GUPPY camera (device 10)
camset device=10 focallength=650
camset device=10 posx=0.4 posy=0.0 posz=0.87 rotphi=0.3
camset device=10 replay                                       <--- new
module load=path
# ballfinder and configuration
module load="./aub2.so.0"
var b2.redlim="105 127 129 180"
var b2.bluelim="115 200 95 132"
var b2.ballsize=0.12
var b2.topline=75
var b2.minsize=20
var b2.maxsize=65
# log images from device 10
# camset device=10 log=false                                  <--- changed to comment
# use an image every 1.5 seconds (image is logged and available in image pool)
# push t=1.5 cmd="imageget img=10"                            <--- changed to comment
# use the image to find balls every time image 10 is updated
poolpush img=10 cmd="ball blue debug='true'"

Then the replay can commence, first start the camera server in the configuration directory

cd ~/replay/ballfinder
ucamserver 

When the cameraserver is started, then the stepping can start

>> camset step
<camset info="Stepped to 1266588079.109762 line 2 in image.log"/>
Ball position  x:   4.1385  y:   0.5525  z:   0.2767
>>

This will advance to the next image in the logfile, and some messages may be printed on the console. The image will be loaded into the image-pool with the same image number as the original device number (here 10).

The odometry pose may be stepped too:

>> odopose step
<odopose tod="1266588094.529696" time="15:01:34.529" logLine="2"/>
>>

This may advance the image.log file too (to the same log-time), and thus trigger another image and any command related to that image.

Image.log file format

The image log file has one line per image, like:

1287579606.142885 159 120 160 1050.00 2 0.000 0.000 0.000 0.0000 0.0000 0.0000 img00000159-cam02-20101020_150006.142.png
1287579608.842862 186 120 160 1050.00 2 0.000 0.000 0.000 0.0000 0.0000 0.0000 img00000186-cam02-20101020_150008.842.png
1287579609.642899 194 120 160 1050.00 2 0.000 0.000 0.000 0.0000 0.0000 0.0000 img00000194-cam02-20101020_150009.642.png
1287579610.242894 200 120 160 1050.00 2 0.000 0.000 0.000 0.0000 0.0000 0.0000 img00000200-cam02-20101020_150010.242.png

and the following format on each line:

  • timestamp (seconds since 1 jan 1970)
  • image serial number
  • image height
  • image width
  • camera focal length in pixels (as set in camera configuration file ucamserver.ini)
  • camera x pose relative to robot (forward)
  • camera y pose relative to robot (left)
  • camera z pose relative to robot (up)
  • camera Omega Rotation (in radians) around x-axis
  • camera Phi Rotation (in radians) around y-axis
  • camera Kappa Rotation (in radians) around z-axis
  • image filename