Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes
segway_rmp200_node::SegwayRmp200Driver Class Reference

IRI ROS Specific Driver Class. More...

#include <segway_rmp200_driver.h>

Inheritance diagram for segway_rmp200_node::SegwayRmp200Driver:
Inheritance graph
[legend]

List of all members.

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_

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 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.


Member Typedef Documentation

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.


Member Enumeration Documentation

Enumerator:
NO_USB 
POWER_OFF 
NO_HEART_BEAT 
NEW_STATUS 

Definition at line 68 of file segway_rmp200_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 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.


Member Function Documentation

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.

Returns:
bool successful

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.

Parameters:
new_cfgthe new driver configuration state
levellevel in which the update is taken place

Definition at line 96 of file segway_rmp200_driver.cpp.

Definition at line 264 of file segway_rmp200_driver.cpp.

Definition at line 314 of file segway_rmp200_driver.cpp.

Definition at line 284 of file segway_rmp200_driver.cpp.

Definition at line 244 of file segway_rmp200_driver.cpp.

Definition at line 204 of file segway_rmp200_driver.cpp.

Definition at line 304 of file segway_rmp200_driver.cpp.

Definition at line 164 of file segway_rmp200_driver.cpp.

Definition at line 174 of file segway_rmp200_driver.cpp.

Definition at line 334 of file segway_rmp200_driver.cpp.

Definition at line 294 of file segway_rmp200_driver.cpp.

Definition at line 254 of file segway_rmp200_driver.cpp.

Definition at line 214 of file segway_rmp200_driver.cpp.

Definition at line 184 of file segway_rmp200_driver.cpp.

Definition at line 194 of file segway_rmp200_driver.cpp.

Definition at line 154 of file segway_rmp200_driver.cpp.

Definition at line 324 of file segway_rmp200_driver.cpp.

Definition at line 234 of file segway_rmp200_driver.cpp.

Definition at line 274 of file segway_rmp200_driver.cpp.

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.

Returns:
bool successful

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.

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.

Returns:
bool successful

Implements iri_base_driver::IriBaseDriver.

Definition at line 86 of file segway_rmp200_driver.cpp.

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.

Returns:
bool successful

Implements iri_base_driver::IriBaseDriver.

Definition at line 91 of file segway_rmp200_driver.cpp.


Member Data Documentation

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.

Definition at line 65 of file segway_rmp200_driver.h.

Definition at line 63 of file segway_rmp200_driver.h.

Definition at line 62 of file segway_rmp200_driver.h.

Definition at line 64 of file segway_rmp200_driver.h.


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


iri_segway_rmp200
Author(s): IRI Lab
autogenerated on Fri Dec 6 2013 20:40:23