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

IRI ROS Specific Driver Class. More...

#include <tibi_arm_node_driver.h>

Inheritance diagram for TibiArmNodeDriver:
Inheritance graph
[legend]

List of all members.

Public Types

typedef
tibi_arm_node::TibiArmNodeConfig 
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 start_motion_sequence (std::string &filename)
void start_motion_sequence (std::vector< TPTUD46MotionStep > &seq)
bool startDriver (void)
 start driver
void stop (void)
 function to stop all motors
void stop_motion_sequence (void)
bool stopDriver (void)
 stop driver
 TibiArmNodeDriver (void)
 constructor
 ~TibiArmNodeDriver (void)
 Destructor.

Public Attributes

Config config_
 config variable

Protected Member Functions

void scan_XML_files (void)

Private Attributes

std::string arm_config_file
CPTUD46 * arm_driver
std::vector< std::string > config_files
int feedback_rate
std::vector< std::string > motion_seq_files
std::string xml_path

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 TibiArmNodeDriver 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 TibiArmNodeConfig.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_arm_node_driver.h.


Member Typedef Documentation

typedef tibi_arm_node::TibiArmNodeConfig TibiArmNodeDriver::Config

define config type

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

Definition at line 79 of file tibi_arm_node_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 17 of file tibi_arm_node_driver.cpp.

Destructor.

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

Definition at line 303 of file tibi_arm_node_driver.cpp.


Member Function Documentation

bool TibiArmNodeDriver::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.

Returns:
bool successful

Implements iri_base_driver::IriBaseDriver.

Definition at line 91 of file tibi_arm_node_driver.cpp.

void TibiArmNodeDriver::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 112 of file tibi_arm_node_driver.cpp.

std::string TibiArmNodeDriver::get_config_file ( unsigned int  index)

Definition at line 275 of file tibi_arm_node_driver.cpp.

Definition at line 298 of file tibi_arm_node_driver.cpp.

std::string TibiArmNodeDriver::get_motion_seq_file ( unsigned int  index)

Definition at line 289 of file tibi_arm_node_driver.cpp.

Definition at line 197 of file tibi_arm_node_driver.cpp.

Definition at line 221 of file tibi_arm_node_driver.cpp.

Definition at line 205 of file tibi_arm_node_driver.cpp.

Definition at line 213 of file tibi_arm_node_driver.cpp.

unsigned int TibiArmNodeDriver::get_num_config_files ( void  )

Definition at line 270 of file tibi_arm_node_driver.cpp.

Definition at line 284 of file tibi_arm_node_driver.cpp.

void TibiArmNodeDriver::get_position ( std::vector< double > &  position)

function to get the current position of all motors

Definition at line 258 of file tibi_arm_node_driver.cpp.

void TibiArmNodeDriver::get_velocity ( std::vector< double > &  velocity)

function to get the current velocity of all motors

Definition at line 264 of file tibi_arm_node_driver.cpp.

void TibiArmNodeDriver::move_absolute_angle ( std::vector< double > &  position,
std::vector< double > &  velocity 
)

functions to move the group of motors in position control

Definition at line 230 of file tibi_arm_node_driver.cpp.

void TibiArmNodeDriver::move_relative_angle ( std::vector< double > &  position,
std::vector< double > &  velocity 
)

functions to move the group of motors in position control

Definition at line 241 of file tibi_arm_node_driver.cpp.

bool TibiArmNodeDriver::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 64 of file tibi_arm_node_driver.cpp.

Definition at line 179 of file tibi_arm_node_driver.cpp.

Definition at line 185 of file tibi_arm_node_driver.cpp.

void TibiArmNodeDriver::scan_XML_files ( void  ) [protected]

Definition at line 27 of file tibi_arm_node_driver.cpp.

void TibiArmNodeDriver::start_motion_sequence ( std::string &  filename)

Definition at line 151 of file tibi_arm_node_driver.cpp.

void TibiArmNodeDriver::start_motion_sequence ( std::vector< TPTUD46MotionStep > &  seq)

Definition at line 165 of file tibi_arm_node_driver.cpp.

bool TibiArmNodeDriver::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.

Returns:
bool successful

Implements iri_base_driver::IriBaseDriver.

Definition at line 102 of file tibi_arm_node_driver.cpp.

void TibiArmNodeDriver::stop ( void  )

function to stop all motors

Reimplemented from driver_base::Driver.

Definition at line 252 of file tibi_arm_node_driver.cpp.

Definition at line 191 of file tibi_arm_node_driver.cpp.

bool TibiArmNodeDriver::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 107 of file tibi_arm_node_driver.cpp.


Member Data Documentation

std::string TibiArmNodeDriver::arm_config_file [private]

Definition at line 63 of file tibi_arm_node_driver.h.

CPTUD46* TibiArmNodeDriver::arm_driver [private]

Definition at line 61 of file tibi_arm_node_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 87 of file tibi_arm_node_driver.h.

Definition at line 66 of file tibi_arm_node_driver.h.

Definition at line 69 of file tibi_arm_node_driver.h.

Definition at line 67 of file tibi_arm_node_driver.h.

std::string TibiArmNodeDriver::xml_path [private]

Definition at line 64 of file tibi_arm_node_driver.h.


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


tibi_arm_node
Author(s): Sergi Hernandez Juan
autogenerated on Fri Dec 6 2013 22:58:42