IRI ROS Specific Driver Class. More...
#include <tibi_dabo_head_driver.h>
Public Types | |
typedef tibi_dabo_head_node::TibiDaboHeadConfig | Config |
define config type | |
Public Member Functions | |
bool | closeDriver (void) |
close driver | |
void | config_update (Config &new_cfg, uint32_t level=0) |
config update | |
std::string | get_config_file (unsigned int index) |
int | get_feedback_rate (void) |
std::string | get_motion_seq_file (unsigned int index) |
std::string | get_motion_sequence_complete_event_id (void) |
float | get_motion_sequence_completed_percentage (void) |
std::string | get_motion_sequence_error_event_id (void) |
std::string | get_motion_sequence_error_message (void) |
unsigned int | get_num_config_files (void) |
unsigned int | get_num_motion_seq_files (void) |
void | get_position (std::vector< double > &position) |
function to get the current position of all motors | |
void | get_velocity (std::vector< double > &velocity) |
function to get the current velocity of all motors | |
void | move_absolute_angle (std::vector< double > &position, std::vector< double > &velocity) |
functions to move the group of motors in position control | |
void | move_relative_angle (std::vector< double > &position, std::vector< double > &velocity) |
functions to move the group of motors in position control | |
bool | openDriver (void) |
open driver | |
void | pause_motion_sequence (void) |
void | resume_motion_sequence (void) |
void | set_brightness (float brightness) |
void | set_face_expression (std::string &expression) |
void | set_face_expression (int index) |
void | start_motion_sequence (std::string &filename) |
void | start_motion_sequence (std::vector< TDynamixelMotionStep > &seq) |
bool | startDriver (void) |
start driver | |
void | stop (void) |
function to stop all motors | |
void | stop_motion_sequence (void) |
bool | stopDriver (void) |
stop driver | |
TibiDaboHeadDriver () | |
constructor | |
~TibiDaboHeadDriver () | |
Destructor. | |
Public Attributes | |
Config | config_ |
config variable | |
Protected Member Functions | |
void | scan_XML_files (void) |
Private Attributes | |
std::vector< std::string > | config_files |
int | feedback_rate |
std::string | head_config_file |
CSegwayHead * | head_driver |
std::vector< std::string > | motion_seq_files |
std::string | xml_path |
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 TibiDaboHeadDriver 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 TibiDaboHeadConfig.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 56 of file tibi_dabo_head_driver.h.
typedef tibi_dabo_head_node::TibiDaboHeadConfig TibiDaboHeadDriver::Config |
define config type
Define a Config type with the TibiDaboHeadConfig. All driver implementations will then use the same variable type Config.
Definition at line 78 of file tibi_dabo_head_driver.h.
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 17 of file tibi_dabo_head_driver.cpp.
Destructor.
This destructor is called when the object is about to be destroyed.
Definition at line 357 of file tibi_dabo_head_driver.cpp.
bool TibiDaboHeadDriver::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 88 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::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 109 of file tibi_dabo_head_driver.cpp.
std::string TibiDaboHeadDriver::get_config_file | ( | unsigned int | index | ) |
Definition at line 329 of file tibi_dabo_head_driver.cpp.
int TibiDaboHeadDriver::get_feedback_rate | ( | void | ) |
Definition at line 352 of file tibi_dabo_head_driver.cpp.
std::string TibiDaboHeadDriver::get_motion_seq_file | ( | unsigned int | index | ) |
Definition at line 343 of file tibi_dabo_head_driver.cpp.
std::string TibiDaboHeadDriver::get_motion_sequence_complete_event_id | ( | void | ) |
Definition at line 193 of file tibi_dabo_head_driver.cpp.
float TibiDaboHeadDriver::get_motion_sequence_completed_percentage | ( | void | ) |
Definition at line 217 of file tibi_dabo_head_driver.cpp.
std::string TibiDaboHeadDriver::get_motion_sequence_error_event_id | ( | void | ) |
Definition at line 201 of file tibi_dabo_head_driver.cpp.
std::string TibiDaboHeadDriver::get_motion_sequence_error_message | ( | void | ) |
Definition at line 209 of file tibi_dabo_head_driver.cpp.
unsigned int TibiDaboHeadDriver::get_num_config_files | ( | void | ) |
Definition at line 324 of file tibi_dabo_head_driver.cpp.
unsigned int TibiDaboHeadDriver::get_num_motion_seq_files | ( | void | ) |
Definition at line 338 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::get_position | ( | std::vector< double > & | position | ) |
function to get the current position of all motors
Definition at line 254 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::get_velocity | ( | std::vector< double > & | velocity | ) |
function to get the current velocity of all motors
Definition at line 260 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::move_absolute_angle | ( | std::vector< double > & | position, |
std::vector< double > & | velocity | ||
) |
functions to move the group of motors in position control
Definition at line 226 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::move_relative_angle | ( | std::vector< double > & | position, |
std::vector< double > & | velocity | ||
) |
functions to move the group of motors in position control
Definition at line 237 of file tibi_dabo_head_driver.cpp.
bool TibiDaboHeadDriver::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 63 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::pause_motion_sequence | ( | void | ) |
Definition at line 175 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::resume_motion_sequence | ( | void | ) |
Definition at line 181 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::scan_XML_files | ( | void | ) | [protected] |
Definition at line 27 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::set_brightness | ( | float | brightness | ) |
Definition at line 318 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::set_face_expression | ( | std::string & | expression | ) |
Definition at line 267 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::set_face_expression | ( | int | index | ) |
Definition at line 290 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::start_motion_sequence | ( | std::string & | filename | ) |
Definition at line 148 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::start_motion_sequence | ( | std::vector< TDynamixelMotionStep > & | seq | ) |
Definition at line 161 of file tibi_dabo_head_driver.cpp.
bool TibiDaboHeadDriver::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 99 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::stop | ( | void | ) |
function to stop all motors
Reimplemented from driver_base::Driver.
Definition at line 248 of file tibi_dabo_head_driver.cpp.
void TibiDaboHeadDriver::stop_motion_sequence | ( | void | ) |
Definition at line 187 of file tibi_dabo_head_driver.cpp.
bool TibiDaboHeadDriver::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 104 of file tibi_dabo_head_driver.cpp.
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 86 of file tibi_dabo_head_driver.h.
std::vector<std::string> TibiDaboHeadDriver::config_files [private] |
Definition at line 65 of file tibi_dabo_head_driver.h.
int TibiDaboHeadDriver::feedback_rate [private] |
Definition at line 68 of file tibi_dabo_head_driver.h.
std::string TibiDaboHeadDriver::head_config_file [private] |
Definition at line 62 of file tibi_dabo_head_driver.h.
CSegwayHead* TibiDaboHeadDriver::head_driver [private] |
Definition at line 60 of file tibi_dabo_head_driver.h.
std::vector<std::string> TibiDaboHeadDriver::motion_seq_files [private] |
Definition at line 66 of file tibi_dabo_head_driver.h.
std::string TibiDaboHeadDriver::xml_path [private] |
Definition at line 63 of file tibi_dabo_head_driver.h.