IRI ROS Specific Driver Class. More...
#include <bumblebee2_driver.h>
Public Types | |
typedef iri_bumblebee2::Bumblebee2Config | Config |
define config type | |
Public Member Functions | |
Bumblebee2Driver (void) | |
constructor | |
bool | closeDriver (void) |
close driver | |
void | config_update (Config &new_cfg, uint32_t level=0) |
config update | |
void | get_calibration_files (std::vector< std::string > &calibration_files) |
void | get_current_config (TCameraConfig *current_conf) |
void | get_frame_ids (std::vector< std::string > &frame_ids) |
void | get_images (char **left_image, char **right_image) |
std::string | get_new_frame_event (void) |
bool | openDriver (void) |
open driver | |
bool | startDriver (void) |
start driver | |
bool | stopDriver (void) |
stop driver | |
~Bumblebee2Driver (void) | |
Destructor. | |
Public Attributes | |
Config | config_ |
config variable | |
Protected Member Functions | |
void | change_config (TCameraConfig *new_conf) |
Private Attributes | |
std::vector< std::string > | calibration_files |
CBumblebee * | camera |
uint64_t | camera_id |
TCameraConfig | current_conf |
TCameraConfig | default_conf |
TCameraConfig | desired_conf |
std::vector< std::string > | frame_ids |
CFirewireServer * | server |
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 Bumblebee2Driver 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 Bumblebee2Config.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 63 of file bumblebee2_driver.h.
typedef iri_bumblebee2::Bumblebee2Config Bumblebee2Driver::Config |
define config type
Define a Config type with the Bumblebee2Config. All driver implementations will then use the same variable type Config.
Definition at line 95 of file bumblebee2_driver.h.
Bumblebee2Driver::Bumblebee2Driver | ( | void | ) |
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 bumblebee2_driver.cpp.
Bumblebee2Driver::~Bumblebee2Driver | ( | void | ) |
Destructor.
This destructor is called when the object is about to be destroyed.
Definition at line 269 of file bumblebee2_driver.cpp.
void Bumblebee2Driver::change_config | ( | TCameraConfig * | new_conf | ) | [protected] |
Definition at line 181 of file bumblebee2_driver.cpp.
bool Bumblebee2Driver::closeDriver | ( | void | ) | [virtual] |
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.
Implements iri_base_driver::IriBaseDriver.
Definition at line 70 of file bumblebee2_driver.cpp.
void Bumblebee2Driver::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.
new_cfg | the new driver configuration state |
level | level in which the update is taken place |
Definition at line 121 of file bumblebee2_driver.cpp.
void Bumblebee2Driver::get_calibration_files | ( | std::vector< std::string > & | calibration_files | ) |
Definition at line 255 of file bumblebee2_driver.cpp.
void Bumblebee2Driver::get_current_config | ( | TCameraConfig * | current_conf | ) |
Definition at line 226 of file bumblebee2_driver.cpp.
void Bumblebee2Driver::get_frame_ids | ( | std::vector< std::string > & | frame_ids | ) |
Definition at line 262 of file bumblebee2_driver.cpp.
void Bumblebee2Driver::get_images | ( | char ** | left_image, |
char ** | right_image | ||
) |
Definition at line 234 of file bumblebee2_driver.cpp.
std::string Bumblebee2Driver::get_new_frame_event | ( | void | ) |
Definition at line 245 of file bumblebee2_driver.cpp.
bool Bumblebee2Driver::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.
Implements iri_base_driver::IriBaseDriver.
Definition at line 40 of file bumblebee2_driver.cpp.
bool Bumblebee2Driver::startDriver | ( | void | ) | [virtual] |
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.
Implements iri_base_driver::IriBaseDriver.
Definition at line 81 of file bumblebee2_driver.cpp.
bool Bumblebee2Driver::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.
Implements iri_base_driver::IriBaseDriver.
Definition at line 101 of file bumblebee2_driver.cpp.
std::vector<std::string> Bumblebee2Driver::calibration_files [private] |
Definition at line 79 of file bumblebee2_driver.h.
CBumblebee* Bumblebee2Driver::camera [private] |
Definition at line 68 of file bumblebee2_driver.h.
uint64_t Bumblebee2Driver::camera_id [private] |
Definition at line 71 of file bumblebee2_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 103 of file bumblebee2_driver.h.
TCameraConfig Bumblebee2Driver::current_conf [private] |
Definition at line 75 of file bumblebee2_driver.h.
TCameraConfig Bumblebee2Driver::default_conf [private] |
Definition at line 73 of file bumblebee2_driver.h.
TCameraConfig Bumblebee2Driver::desired_conf [private] |
Definition at line 77 of file bumblebee2_driver.h.
std::vector<std::string> Bumblebee2Driver::frame_ids [private] |
Definition at line 81 of file bumblebee2_driver.h.
CFirewireServer* Bumblebee2Driver::server [private] |
Definition at line 69 of file bumblebee2_driver.h.