Fawkes API  Fawkes Development Version
firevision::SwissRangerCamera Class Reference

SwissRanger camera. More...

#include <>>

Inheritance diagram for firevision::SwissRangerCamera:

Public Types

enum  mode_t {
  DISTANCE, DISTANCE_GRAY_8, AMPLITUDE, AMPLITUDE_GRAY,
  AMPLITUDE_GRAY_8, CONF_MAP, CARTESIAN_UINT16, CARTESIAN_FLOAT,
  CARTESIAN_DOUBLE
}
 Operation mode of the camera. More...
 

Public Member Functions

 SwissRangerCamera (const CameraArgumentParser *cap)
 Constructor. More...
 
virtual ~SwissRangerCamera ()
 Empty destructor. More...
 
virtual void open ()
 Open the camera. More...
 
virtual void start ()
 Start image transfer from the camera. More...
 
virtual void stop ()
 Stop image transfer from the camera. More...
 
virtual void close ()
 Close camera. More...
 
virtual void flush ()
 Flush image queue. More...
 
virtual void capture ()
 Capture an image. More...
 
virtual void print_info ()
 Print out camera information. More...
 
virtual bool ready ()
 Camera is ready for taking pictures. More...
 
virtual unsigned char * buffer ()
 Get access to current image buffer. More...
 
virtual unsigned int buffer_size ()
 Size of buffer. More...
 
virtual void dispose_buffer ()
 Dispose current buffer. More...
 
virtual unsigned int pixel_width ()
 Width of image in pixels. More...
 
virtual unsigned int pixel_height ()
 Height of image in pixels. More...
 
virtual colorspace_t colorspace ()
 Colorspace of returned image. More...
 
virtual void set_image_number (unsigned int n)
 Set image number to retrieve. More...
 
virtual const char * model () const
 Get camera model. More...
 
- Public Member Functions inherited from firevision::Camera
virtual ~Camera ()
 Virtual empty destructor. More...
 
virtual fawkes::Timecapture_time ()
 Get the Time of the last successfully captured image. More...
 

Static Public Member Functions

static void print_available_cams ()
 Print list of cameras. More...
 

Protected Attributes

bool _opened
 true if camera has been opened, false otherwise More...
 
bool _started
 true if camera has been started, false otherwise More...
 
bool _valid_frame_received
 true, if a valid frame has been received, false otherwise More...
 

Detailed Description

SwissRanger camera.

This camera implementation provides access to the SwissRanger SR4000 camera (and probably other models supported by libmesasr, but cannot test).

Author
Tim Niemueller

Definition at line 40 of file swissranger.h.

Member Enumeration Documentation

◆ mode_t

Operation mode of the camera.

Enumerator
DISTANCE 

raw distance image, unsigned short distance values

DISTANCE_GRAY_8 

gray distance image, plain gray 8bpp buffer

AMPLITUDE 

raw amplitude image, unsigned short values

AMPLITUDE_GRAY 

amplitude gray image, 16bpp

AMPLITUDE_GRAY_8 

amplitude gray image, 8bpp

CONF_MAP 

confidence map, 16bpp

CARTESIAN_UINT16 

Cartesian coordinates, three consecutive planes for X, Y, Z data, each with unsigned short values (mm)

CARTESIAN_FLOAT 

Cartesian coordinates, three consecutive planes for X, Y, Z data, each with float values (meters)

CARTESIAN_DOUBLE 

Cartesian coordinates, three consecutive planes for X, Y, Z data, each with double values (meters)

Definition at line 45 of file swissranger.h.

Constructor & Destructor Documentation

◆ SwissRangerCamera()

firevision::SwissRangerCamera::SwissRangerCamera ( const CameraArgumentParser cap)

Constructor.

Initialize and take parameters from camera argument parser. The following arguments are supported:

  • mode=MODE where MODE is one of
  • DISTANCE
  • DISTANCE_GRAY_8
  • AMPLITUDE
  • AMPLITUDE_GRAY
  • AMPLITUDE_GRAY_8
  • CONF_MAP
  • CARTESIAN_UINT16
  • CARTESIAN_FLOAT
  • CARTESIAN_DOUBLE
  • median=on (enable median filter)
  • denoise=on (enable denoise filter)
  • modfreq=MODFREQ where MODFREQ (modulation frequency) is one of
    • 40MHz
    • 30MHz
    • 21MHz
    • 20MHz
    • 19MHz
    • 60MHz
    • 15MHz
    • 10MHz
    • 29MHz
    • 31MHz
    • 14.5MHz
    • 15.5MHz
  • integration_time=NUM integration time, confer camera's API documentation
  • amplitude_threshold=NUM amplitude threshold, must be unsigned 16 bit value
    Parameters
    capcamera argument parser

Definition at line 413 of file swissranger.cpp.

References firevision::CameraArgumentParser::get(), firevision::CameraArgumentParser::get_int(), and firevision::CameraArgumentParser::has().

◆ ~SwissRangerCamera()

firevision::SwissRangerCamera::~SwissRangerCamera ( )
virtual

Empty destructor.

Definition at line 60 of file swissranger.cpp.

Member Function Documentation

◆ buffer()

unsigned char * firevision::SwissRangerCamera::buffer ( )
virtual

Get access to current image buffer.

This will return a pointer to the current buffer. The buffer contains an image of the given colorspace, width and height.

Returns
pointer to image buffer

Implements firevision::Camera.

Definition at line 294 of file swissranger.cpp.

◆ buffer_size()

unsigned int firevision::SwissRangerCamera::buffer_size ( )
virtual

Size of buffer.

Gets the size in bytes of the buffer returned by buffer().

Returns
size of buffer in bytes

Implements firevision::Camera.

Definition at line 305 of file swissranger.cpp.

◆ capture()

void firevision::SwissRangerCamera::capture ( )
virtual

Capture an image.

Although cameras shall operate with a continuous image flow where possible sometimes capturing an image means copying a buffer or advancing a buffer list pointer. This shall be done in this method. For a camera-using application it is mandatory to call capture() just before accessing the image buffer.

Implements firevision::Camera.

Definition at line 245 of file swissranger.cpp.

◆ close()

void firevision::SwissRangerCamera::close ( )
virtual

Close camera.

This closes the camera device. The camera must have been stopped before calling close().

Implements firevision::Camera.

Definition at line 204 of file swissranger.cpp.

◆ colorspace()

colorspace_t firevision::SwissRangerCamera::colorspace ( )
virtual

Colorspace of returned image.

Returns
colorspace of image returned by buffer()

Implements firevision::Camera.

Definition at line 344 of file swissranger.cpp.

◆ dispose_buffer()

void firevision::SwissRangerCamera::dispose_buffer ( )
virtual

Dispose current buffer.

Some cameras need disposal of the current buffer (for example to free space in a queue to retrieve the next image). This is done with this method. It has to be called after all work has been done on the image as desired. After dispose_buffer() has been called no further access may happen to the image buffer or undesired behavior may happen.

Implements firevision::Camera.

Definition at line 315 of file swissranger.cpp.

◆ flush()

void firevision::SwissRangerCamera::flush ( )
virtual

Flush image queue.

Some cameras may have an image buffer queue. With this it can happen that if the processing of an image took longer than desired it is needed to flush this buffer queue.

Implements firevision::Camera.

Definition at line 288 of file swissranger.cpp.

◆ model()

const char * firevision::SwissRangerCamera::model ( ) const
virtual

Get camera model.

Returns
string with the camera model name

Definition at line 234 of file swissranger.cpp.

◆ open()

void firevision::SwissRangerCamera::open ( )
virtual

Open the camera.

The camera is opened, but image transfer not yet started. This can be used to detect general problems with the camera while delaying the real transfer startup until it is needed.

Implements firevision::Camera.

Definition at line 71 of file swissranger.cpp.

◆ pixel_height()

unsigned int firevision::SwissRangerCamera::pixel_height ( )
virtual

Height of image in pixels.

Returns
height of image in pixels

Implements firevision::Camera.

Definition at line 333 of file swissranger.cpp.

◆ pixel_width()

unsigned int firevision::SwissRangerCamera::pixel_width ( )
virtual

Width of image in pixels.

Returns
width of image in pixels

Implements firevision::Camera.

Definition at line 322 of file swissranger.cpp.

◆ print_available_cams()

void firevision::SwissRangerCamera::print_available_cams ( )
static

Print list of cameras.

Prints a list of available cameras to stdout.

Definition at line 510 of file swissranger.cpp.

◆ print_info()

void firevision::SwissRangerCamera::print_info ( )
virtual

Print out camera information.

Shall print out camera information and current setup information on stdout.

Implements firevision::Camera.

Definition at line 194 of file swissranger.cpp.

◆ ready()

bool firevision::SwissRangerCamera::ready ( )
virtual

Camera is ready for taking pictures.

The camera has been opened and started correctly and may now provide images.

Returns
true, if the camera is ready, false otherwise

Implements firevision::Camera.

Definition at line 368 of file swissranger.cpp.

◆ set_image_number()

void firevision::SwissRangerCamera::set_image_number ( unsigned int  n)
virtual

Set image number to retrieve.

If a camera is able to retrieve several images this method can be used to select the image to be retrieved with the next call to capture().

Parameters
nimage number to set

Implements firevision::Camera.

Definition at line 375 of file swissranger.cpp.

◆ start()

void firevision::SwissRangerCamera::start ( )
virtual

Start image transfer from the camera.

For many cameras opening the camera and starting transmission of images are two tasks. This method will simply initiate the transfer after the camera as been opened. And exception shall be thrown if the camera has not been opened.

Implements firevision::Camera.

Definition at line 174 of file swissranger.cpp.

◆ stop()

void firevision::SwissRangerCamera::stop ( )
virtual

Stop image transfer from the camera.

This will stop the image transfer initiated with start(). This can be used to start and stop the image transfer at will without opening and closing operations inbetween.

Implements firevision::Camera.

Definition at line 187 of file swissranger.cpp.

Member Data Documentation

◆ _opened

bool firevision::SwissRangerCamera::_opened
protected

true if camera has been opened, false otherwise

Definition at line 89 of file swissranger.h.

◆ _started

bool firevision::SwissRangerCamera::_started
protected

true if camera has been started, false otherwise

Definition at line 91 of file swissranger.h.

◆ _valid_frame_received

bool firevision::SwissRangerCamera::_valid_frame_received
protected

true, if a valid frame has been received, false otherwise

Definition at line 93 of file swissranger.h.


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