IRI ROS Specific Driver Class. More...
#include <tibi_dabo_arm_driver.h>
Public Types | |
typedef tibi_dabo_arm_node::TibiDaboArmConfig | 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< float > &position) |
function to get the current position of all motors | |
std::string | get_position_reached_event_id (void) |
void | get_velocity (std::vector< float > &velocity) |
function to get the current velocity of all motors | |
void | move (std::vector< float > &position, std::vector< float > &velocity, std::vector< float > &acceleration) |
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_absolute_motion (bool status) |
void | set_position_control (bool status) |
void | start_motion_sequence (std::string &filename) |
void | start_motion_sequence (std::vector< TMotionStep > &seq) |
bool | startDriver (void) |
start driver | |
void | stop (void) |
function to stop all motors | |
void | stop_motion_sequence (void) |
bool | stopDriver (void) |
stop driver | |
TibiDaboArmDriver () | |
constructor | |
bool | using_absolute_motion (void) |
bool | using_position_control (void) |
~TibiDaboArmDriver () | |
Destructor. | |
Public Attributes | |
Config | config_ |
config variable | |
Protected Member Functions | |
void | scan_XML_files (void) |
Private Attributes | |
bool | absolute_motion |
std::string | arm_config_file |
CSegwayArm | arm_driver |
std::vector< std::string > | config_files |
int | feedback_rate |
std::vector< std::string > | motion_seq_files |
CMotionSequence * | motion_sequence |
bool | position_control |
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 TibiDaboArmDriver 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 TibiDaboArmConfig.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 57 of file tibi_dabo_arm_driver.h.
typedef tibi_dabo_arm_node::TibiDaboArmConfig TibiDaboArmDriver::Config |
define config type
Define a Config type with the TibiDaboArmConfig. All driver implementations will then use the same variable type Config.
Definition at line 82 of file tibi_dabo_arm_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 16 of file tibi_dabo_arm_driver.cpp.
Destructor.
This destructor is called when the object is about to be destroyed.
Definition at line 397 of file tibi_dabo_arm_driver.cpp.
bool TibiDaboArmDriver::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 108 of file tibi_dabo_arm_driver.cpp.
void TibiDaboArmDriver::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 123 of file tibi_dabo_arm_driver.cpp.
std::string TibiDaboArmDriver::get_config_file | ( | unsigned int | index | ) |
Definition at line 369 of file tibi_dabo_arm_driver.cpp.
int TibiDaboArmDriver::get_feedback_rate | ( | void | ) |
Definition at line 392 of file tibi_dabo_arm_driver.cpp.
std::string TibiDaboArmDriver::get_motion_seq_file | ( | unsigned int | index | ) |
Definition at line 383 of file tibi_dabo_arm_driver.cpp.
std::string TibiDaboArmDriver::get_motion_sequence_complete_event_id | ( | void | ) |
Definition at line 246 of file tibi_dabo_arm_driver.cpp.
float TibiDaboArmDriver::get_motion_sequence_completed_percentage | ( | void | ) |
Definition at line 270 of file tibi_dabo_arm_driver.cpp.
std::string TibiDaboArmDriver::get_motion_sequence_error_event_id | ( | void | ) |
Definition at line 254 of file tibi_dabo_arm_driver.cpp.
std::string TibiDaboArmDriver::get_motion_sequence_error_message | ( | void | ) |
Definition at line 262 of file tibi_dabo_arm_driver.cpp.
unsigned int TibiDaboArmDriver::get_num_config_files | ( | void | ) |
Definition at line 364 of file tibi_dabo_arm_driver.cpp.
unsigned int TibiDaboArmDriver::get_num_motion_seq_files | ( | void | ) |
Definition at line 378 of file tibi_dabo_arm_driver.cpp.
void TibiDaboArmDriver::get_position | ( | std::vector< float > & | position | ) |
function to get the current position of all motors
Definition at line 316 of file tibi_dabo_arm_driver.cpp.
std::string TibiDaboArmDriver::get_position_reached_event_id | ( | void | ) |
Definition at line 279 of file tibi_dabo_arm_driver.cpp.
void TibiDaboArmDriver::get_velocity | ( | std::vector< float > & | velocity | ) |
function to get the current velocity of all motors
Definition at line 321 of file tibi_dabo_arm_driver.cpp.
void TibiDaboArmDriver::move | ( | std::vector< float > & | position, |
std::vector< float > & | velocity, | ||
std::vector< float > & | acceleration | ||
) |
functions to move the group of motors in position control
Definition at line 284 of file tibi_dabo_arm_driver.cpp.
bool TibiDaboArmDriver::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 67 of file tibi_dabo_arm_driver.cpp.
void TibiDaboArmDriver::pause_motion_sequence | ( | void | ) |
Definition at line 231 of file tibi_dabo_arm_driver.cpp.
void TibiDaboArmDriver::resume_motion_sequence | ( | void | ) |
Definition at line 236 of file tibi_dabo_arm_driver.cpp.
void TibiDaboArmDriver::scan_XML_files | ( | void | ) | [protected] |
Definition at line 31 of file tibi_dabo_arm_driver.cpp.
void TibiDaboArmDriver::set_absolute_motion | ( | bool | status | ) |
Definition at line 326 of file tibi_dabo_arm_driver.cpp.
void TibiDaboArmDriver::set_position_control | ( | bool | status | ) |
Definition at line 341 of file tibi_dabo_arm_driver.cpp.
void TibiDaboArmDriver::start_motion_sequence | ( | std::string & | filename | ) |
Definition at line 197 of file tibi_dabo_arm_driver.cpp.
void TibiDaboArmDriver::start_motion_sequence | ( | std::vector< TMotionStep > & | seq | ) |
Definition at line 210 of file tibi_dabo_arm_driver.cpp.
bool TibiDaboArmDriver::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 113 of file tibi_dabo_arm_driver.cpp.
void TibiDaboArmDriver::stop | ( | void | ) |
function to stop all motors
Reimplemented from driver_base::Driver.
Definition at line 311 of file tibi_dabo_arm_driver.cpp.
void TibiDaboArmDriver::stop_motion_sequence | ( | void | ) |
Definition at line 241 of file tibi_dabo_arm_driver.cpp.
bool TibiDaboArmDriver::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 118 of file tibi_dabo_arm_driver.cpp.
Definition at line 354 of file tibi_dabo_arm_driver.cpp.
Definition at line 359 of file tibi_dabo_arm_driver.cpp.
bool TibiDaboArmDriver::absolute_motion [private] |
Definition at line 71 of file tibi_dabo_arm_driver.h.
std::string TibiDaboArmDriver::arm_config_file [private] |
Definition at line 64 of file tibi_dabo_arm_driver.h.
CSegwayArm TibiDaboArmDriver::arm_driver [private] |
Definition at line 61 of file tibi_dabo_arm_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 90 of file tibi_dabo_arm_driver.h.
std::vector<std::string> TibiDaboArmDriver::config_files [private] |
Definition at line 67 of file tibi_dabo_arm_driver.h.
int TibiDaboArmDriver::feedback_rate [private] |
Definition at line 70 of file tibi_dabo_arm_driver.h.
std::vector<std::string> TibiDaboArmDriver::motion_seq_files [private] |
Definition at line 68 of file tibi_dabo_arm_driver.h.
CMotionSequence* TibiDaboArmDriver::motion_sequence [private] |
Definition at line 62 of file tibi_dabo_arm_driver.h.
bool TibiDaboArmDriver::position_control [private] |
Definition at line 72 of file tibi_dabo_arm_driver.h.
std::string TibiDaboArmDriver::xml_path [private] |
Definition at line 65 of file tibi_dabo_arm_driver.h.