IRI ROS Specific Driver Class. More...
#include <segway_rmp200_driver.h>
Public Types | |
typedef iri_segway_rmp200::SegwayRmp200Config | Config |
define config type | |
enum | segway_events_enum { NO_USB = 0, POWER_OFF, NO_HEART_BEAT, NEW_STATUS } |
Public Member Functions | |
bool | closeDriver (void) |
close driver | |
void | config_update (Config &new_cfg, uint32_t level=0) |
config update | |
float | get_forward_displacement (void) |
gain | get_gain_schedule (void) |
float | get_left_motor_torque (void) |
float | get_left_wheel_displacement (void) |
float | get_left_wheel_velocity (void) |
op_mode | get_operation_mode (void) |
float | get_pitch_angle (void) |
float | get_pitch_rate (void) |
float | get_powerbase_battery_voltage (void) |
float | get_right_motor_torque (void) |
float | get_right_wheel_displacement (void) |
float | get_right_wheel_velocity (void) |
float | get_roll_angle (void) |
float | get_roll_rate (void) |
iri_segway_rmp_msgs::SegwayRMP200Status | get_status (void) |
float | get_ui_battery_voltage (void) |
float | get_uptime (void) |
float | get_yaw_displacement (void) |
float | get_yaw_rate (void) |
const std::list< std::string > & | getSegwayEvents () const |
void | move_platform (float vT, float vR) |
bool | openDriver (void) |
open driver | |
void | reset (void) |
SegwayRmp200Driver () | |
constructor | |
void | setSegwayEvents (void) |
bool | startDriver (void) |
start driver | |
void | stop_platform (void) |
bool | stopDriver (void) |
stop driver | |
~SegwayRmp200Driver () | |
Destructor. | |
Static Public Member Functions | |
static const std::string & | getSegwayEventName (const unsigned int &ev) |
Public Attributes | |
Config | config_ |
config variable | |
Private Attributes | |
std::list< std::string > | events_ |
CFTDIServer * | ftdi_server_ |
CSegwayRMP200 * | segway_ |
std::string | serial_number_ |
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 SegwayRmp200Driver 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 SegwayRmp200Config.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 58 of file segway_rmp200_driver.h.
typedef iri_segway_rmp200::SegwayRmp200Config segway_rmp200_node::SegwayRmp200Driver::Config |
define config type
Define a Config type with the SegwayRmp200Config. All driver implementations will then use the same variable type Config.
Definition at line 76 of file segway_rmp200_driver.h.
Definition at line 68 of file segway_rmp200_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 7 of file segway_rmp200_driver.cpp.
Destructor.
This destructor is called when the object is about to be destroyed.
Definition at line 139 of file segway_rmp200_driver.cpp.
bool SegwayRmp200Driver::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 65 of file segway_rmp200_driver.cpp.
void SegwayRmp200Driver::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 96 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_forward_displacement | ( | void | ) |
Definition at line 264 of file segway_rmp200_driver.cpp.
gain SegwayRmp200Driver::get_gain_schedule | ( | void | ) |
Definition at line 314 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_left_motor_torque | ( | void | ) |
Definition at line 284 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_left_wheel_displacement | ( | void | ) |
Definition at line 244 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_left_wheel_velocity | ( | void | ) |
Definition at line 204 of file segway_rmp200_driver.cpp.
op_mode SegwayRmp200Driver::get_operation_mode | ( | void | ) |
Definition at line 304 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_pitch_angle | ( | void | ) |
Definition at line 164 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_pitch_rate | ( | void | ) |
Definition at line 174 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_powerbase_battery_voltage | ( | void | ) |
Definition at line 334 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_right_motor_torque | ( | void | ) |
Definition at line 294 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_right_wheel_displacement | ( | void | ) |
Definition at line 254 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_right_wheel_velocity | ( | void | ) |
Definition at line 214 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_roll_angle | ( | void | ) |
Definition at line 184 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_roll_rate | ( | void | ) |
Definition at line 194 of file segway_rmp200_driver.cpp.
Definition at line 154 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_ui_battery_voltage | ( | void | ) |
Definition at line 324 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_uptime | ( | void | ) |
Definition at line 234 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_yaw_displacement | ( | void | ) |
Definition at line 274 of file segway_rmp200_driver.cpp.
float SegwayRmp200Driver::get_yaw_rate | ( | void | ) |
Definition at line 224 of file segway_rmp200_driver.cpp.
const std::string & SegwayRmp200Driver::getSegwayEventName | ( | const unsigned int & | ev | ) | [static] |
Definition at line 384 of file segway_rmp200_driver.cpp.
const std::list< std::string > & SegwayRmp200Driver::getSegwayEvents | ( | ) | const |
Definition at line 368 of file segway_rmp200_driver.cpp.
void SegwayRmp200Driver::move_platform | ( | float | vT, |
float | vR | ||
) |
Definition at line 352 of file segway_rmp200_driver.cpp.
bool SegwayRmp200Driver::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 14 of file segway_rmp200_driver.cpp.
void SegwayRmp200Driver::reset | ( | void | ) |
Definition at line 344 of file segway_rmp200_driver.cpp.
void SegwayRmp200Driver::setSegwayEvents | ( | void | ) |
Definition at line 373 of file segway_rmp200_driver.cpp.
bool SegwayRmp200Driver::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 86 of file segway_rmp200_driver.cpp.
void SegwayRmp200Driver::stop_platform | ( | void | ) |
Definition at line 360 of file segway_rmp200_driver.cpp.
bool SegwayRmp200Driver::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 91 of file segway_rmp200_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 84 of file segway_rmp200_driver.h.
std::list<std::string> segway_rmp200_node::SegwayRmp200Driver::events_ [private] |
Definition at line 65 of file segway_rmp200_driver.h.
CFTDIServer* segway_rmp200_node::SegwayRmp200Driver::ftdi_server_ [private] |
Definition at line 63 of file segway_rmp200_driver.h.
CSegwayRMP200* segway_rmp200_node::SegwayRmp200Driver::segway_ [private] |
Definition at line 62 of file segway_rmp200_driver.h.
std::string segway_rmp200_node::SegwayRmp200Driver::serial_number_ [private] |
Definition at line 64 of file segway_rmp200_driver.h.