Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes
FirewireCameraDriver Class Reference

IRI ROS Specific Driver Class. More...

#include <firewire_camera_driver.h>

Inheritance diagram for FirewireCameraDriver:
Inheritance graph
[legend]

List of all members.

Public Types

typedef
iri_firewire_camera::FirewireCameraConfig 
Config
 define config type

Public Member Functions

bool closeDriver (void)
 close driver
void config_update (Config &new_cfg, uint32_t level=0)
 config update
 FirewireCameraDriver ()
 constructor
std::string get_calibration_file (void)
void get_current_config (TCameraConfig *current_conf)
void get_default_config (TCameraConfig *default_conf)
void get_desired_config (TCameraConfig *desired_conf)
std::string get_frame_id (void)
void get_image (char **image_data)
std::string get_new_frame_event (void)
bool openDriver (void)
 open driver
void set_config (TCameraConfig *new_conf)
void set_ISO_speed (int iso_speed)
bool startDriver (void)
 start driver
bool stopDriver (void)
 stop driver
 ~FirewireCameraDriver ()
 Destructor.

Public Attributes

Config config_
 config variable

Protected Member Functions

void camera_to_dyn_rec (TCameraConfig &camera_config, iri_firewire_camera::FirewireCameraConfig &dyn_rec_config)
void change_config (TCameraConfig *new_conf)
void dyn_rec_to_camera (iri_firewire_camera::FirewireCameraConfig &dyn_rec_config, TCameraConfig &camera_config)
void set_gain (bool *enable, int *mode, int *value)
void set_shutter (bool *enable, int *mode, int *value)
void set_white_balance (bool *enable, int *mode, int *u_b_value, int *v_r_value)

Private Attributes

std::string calibration_file
CFirewireCamera * camera
long int camera_id
TCameraConfig current_conf
TCameraConfig default_conf
TCameraConfig desired_conf
std::string frame_id
int ISO_speed
CFirewireServer * server

Detailed Description

IRI ROS Specific Driver Class.

This class inherits from the IRI Base class IriBaseDriver, which provides the guidelines to implement any specific driver. The IriBaseDriver class offers an easy framework to integrate functional drivers implemented in C++ with the ROS driver structure. ROS driver_base state transitions are already managed by IriBaseDriver.

The FirewireCameraDriver class must implement all specific driver requirements to safetely open, close, run and stop the driver at any time. It also must guarantee an accessible interface for all driver's parameters.

The FirewireCameraConfig.cfg needs to be filled up with those parameters suitable to be changed dynamically by the ROS dyanmic reconfigure application. The implementation of the CIriNode class will manage those parameters through methods like postNodeOpenHook() and reconfigureNodeHook().

Definition at line 55 of file firewire_camera_driver.h.


Member Typedef Documentation

typedef iri_firewire_camera::FirewireCameraConfig FirewireCameraDriver::Config

define config type

Define a Config type with the FirewireCameraConfig. All driver implementations will then use the same variable type Config.

Definition at line 111 of file firewire_camera_driver.h.


Constructor & Destructor Documentation

constructor

In this constructor parameters related to the specific driver can be initalized. Those parameters can be also set in the openDriver() function. Attributes from the main node driver class IriBaseDriver such as loop_rate, may be also overload here.

Definition at line 3 of file firewire_camera_driver.cpp.

Destructor.

This destructor is called when the object is about to be destroyed.

Definition at line 573 of file firewire_camera_driver.cpp.


Member Function Documentation

void FirewireCameraDriver::camera_to_dyn_rec ( TCameraConfig camera_config,
iri_firewire_camera::FirewireCameraConfig &  dyn_rec_config 
) [protected]

Definition at line 228 of file firewire_camera_driver.cpp.

void FirewireCameraDriver::change_config ( TCameraConfig new_conf) [protected]

Definition at line 255 of file firewire_camera_driver.cpp.

close driver

In this function, the driver must be closed. Variables related to the driver state must also be taken into account. This function is automatically called by IriBaseDriver::doClose(), an state transition is performed if return value equals true.

Returns:
bool successful

Implements iri_base_driver::IriBaseDriver.

Definition at line 72 of file firewire_camera_driver.cpp.

void FirewireCameraDriver::config_update ( Config new_cfg,
uint32_t  level = 0 
)

config update

In this function the driver parameters must be updated with the input config variable. Then the new configuration state will be stored in the Config attribute.

Parameters:
new_cfgthe new driver configuration state
levellevel in which the update is taken place

Definition at line 123 of file firewire_camera_driver.cpp.

void FirewireCameraDriver::dyn_rec_to_camera ( iri_firewire_camera::FirewireCameraConfig &  dyn_rec_config,
TCameraConfig camera_config 
) [protected]

Definition at line 189 of file firewire_camera_driver.cpp.

Definition at line 563 of file firewire_camera_driver.cpp.

Definition at line 520 of file firewire_camera_driver.cpp.

Definition at line 542 of file firewire_camera_driver.cpp.

Definition at line 531 of file firewire_camera_driver.cpp.

std::string FirewireCameraDriver::get_frame_id ( void  )

Definition at line 568 of file firewire_camera_driver.cpp.

void FirewireCameraDriver::get_image ( char **  image_data)

Definition at line 495 of file firewire_camera_driver.cpp.

Definition at line 553 of file firewire_camera_driver.cpp.

bool FirewireCameraDriver::openDriver ( void  ) [virtual]

open driver

In this function, the driver must be openned. Openning errors must be taken into account. This function is automatically called by IriBaseDriver::doOpen(), an state transition is performed if return value equals true.

Returns:
bool successful

Implements iri_base_driver::IriBaseDriver.

Definition at line 41 of file firewire_camera_driver.cpp.

Definition at line 508 of file firewire_camera_driver.cpp.

void FirewireCameraDriver::set_gain ( bool enable,
int *  mode,
int *  value 
) [protected]

Definition at line 430 of file firewire_camera_driver.cpp.

void FirewireCameraDriver::set_ISO_speed ( int  iso_speed)

Definition at line 503 of file firewire_camera_driver.cpp.

void FirewireCameraDriver::set_shutter ( bool enable,
int *  mode,
int *  value 
) [protected]

Definition at line 365 of file firewire_camera_driver.cpp.

void FirewireCameraDriver::set_white_balance ( bool enable,
int *  mode,
int *  u_b_value,
int *  v_r_value 
) [protected]

Definition at line 300 of file firewire_camera_driver.cpp.

start driver

After this function, the driver and its thread will be started. The driver and related variables should be properly setup. This function is automatically called by IriBaseDriver::doStart(), an state transition is performed if return value equals true.

Returns:
bool successful

Implements iri_base_driver::IriBaseDriver.

Definition at line 83 of file firewire_camera_driver.cpp.

bool FirewireCameraDriver::stopDriver ( void  ) [virtual]

stop driver

After this function, the driver's thread will stop its execution. The driver and related variables should be properly setup. This function is automatically called by IriBaseDriver::doStop(), an state transition is performed if return value equals true.

Returns:
bool successful

Implements iri_base_driver::IriBaseDriver.

Definition at line 103 of file firewire_camera_driver.cpp.


Member Data Documentation

Definition at line 70 of file firewire_camera_driver.h.

CFirewireCamera* FirewireCameraDriver::camera [private]

Definition at line 59 of file firewire_camera_driver.h.

long int FirewireCameraDriver::camera_id [private]

Definition at line 61 of file firewire_camera_driver.h.

config variable

This variable has all the driver parameters defined in the cfg config file. Is updated everytime function config_update() is called.

Definition at line 119 of file firewire_camera_driver.h.

Definition at line 66 of file firewire_camera_driver.h.

Definition at line 68 of file firewire_camera_driver.h.

Definition at line 64 of file firewire_camera_driver.h.

std::string FirewireCameraDriver::frame_id [private]

Definition at line 72 of file firewire_camera_driver.h.

Definition at line 62 of file firewire_camera_driver.h.

CFirewireServer* FirewireCameraDriver::server [private]

Definition at line 60 of file firewire_camera_driver.h.


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


iri_firewire_camera
Author(s): Sergi Hernandez Juan
autogenerated on Fri Dec 6 2013 22:28:49