Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

RobotFlow::Pioneer2PacketManager Class Reference

#include <Pioneer2PacketManager.h>

Collaboration diagram for RobotFlow::Pioneer2PacketManager:

Collaboration graph
[legend]

Public Member Functions

 Pioneer2PacketManager ()
virtual ~Pioneer2PacketManager ()
void initialize (const std::string &tty)
unsigned char get_status ()
float get_Xpos ()
float get_Ypos ()
float get_Thpos ()
float get_Lvel ()
float get_Rvel ()
float get_battery ()
unsigned short get_bumpers ()
float get_control ()
unsigned short get_ptu ()
float get_compass ()
float get_sonar (int s_number)
unsigned short get_timer ()
float get_analog ()
unsigned char get_digin ()
unsigned char get_digout ()
void get_all (Pioneer2Data &data)
void send_motor_command (short command)
void send_reset_translational_acc (short command)
void send_reset_translational_vel (short command)
void send_reset_server ()
void send_reset_rotational_vel (short command)
void send_velocity_command (short command)
void send_heading_command (short command)
void send_rel_heading_command (short command)
void send_say_command (const std::string &command)
void send_config_command (short command)
void send_encoder_command (short command)
void send_rotational_vel (short command)
void send_colbert_relative_heading (short command)
void send_rotational_acc (short command)
void send_sonar_command (short command)
void send_front_sonar_command ()
void send_rear_sonar_command ()
void send_stop_command ()
void send_digout_command (short command)
void send_velocity2_command (short command)
void send_gripper_command (short command)
void send_ad_select_command (short command)
void send_gripper_val_command (short command)
void send_ptupos_command (short command)
void send_tty2_command (const std::string &data)
void send_tty2_command (const unsigned char *data, int size)
void send_getaux_command (short command)
void send_bumpstall_command (short command)
void send_tcm2_command (short command)
void send_emergency_stop ()
void send_pulse ()
void send_step ()

Static Public Member Functions

static Pioneer2PacketManagerinstance ()
static void destroyInstance ()

Static Public Attributes

static const unsigned char SYNC0 = 0
static const unsigned char SYNC1 = 1
static const unsigned char SYNC2 = 2
static const unsigned char PULSE = 0
static const unsigned char OPEN = 1
static const unsigned char CLOSE = 2
static const unsigned char POLLING = 3
static const unsigned char ENABLE = 4
static const unsigned char SETA = 5
static const unsigned char SETV = 6
static const unsigned char SET0 = 7
static const unsigned char SETRV = 10
static const unsigned char VEL = 11
static const unsigned char HEAD = 12
static const unsigned char DHEAD = 13
static const unsigned char SAY = 15
static const unsigned char CONFIG = 18
static const unsigned char ENCODER = 19
static const unsigned char RVEL = 21
static const unsigned char DCHEAD = 22
static const unsigned char SETRA = 23
static const unsigned char SONAR = 28
static const unsigned char STOP = 29
static const unsigned char DIGOUT = 30
static const unsigned char VEL2 = 32
static const unsigned char GRIPPER = 33
static const unsigned char ADSEL = 35
static const unsigned char GRIPPERVAL = 36
static const unsigned char PTUPOS = 41
static const unsigned char TTY2 = 42
static const unsigned char GETAUX = 43
static const unsigned char BUMPSTALL = 44
static const unsigned char TCM2 = 45
static const unsigned char E_STOP = 55
static const unsigned char STEP = 64
static const short GRIPOPEN = 1
static const short GRIPCLOSE = 2
static const short GRIPSTOP = 3
static const short LIFTUP = 4
static const short LIFTDOWN = 5
static const short LIFTSTOP = 6
static const short GRIPSTORE = 7
static const short GRIPDEPLOY = 8
static const short GRIPHALT = 15
static const short GRIPPRESS = 16
static const short LIFTCARRY = 17
static const int MAX_QUEUE_SIZE = 20

Protected Attributes

unsigned char m_status
unsigned short m_xpos
unsigned short m_ypos
short m_thpos
short m_lvel
short m_rvel
unsigned char m_battery
short m_bumpers
short m_control
unsigned short m_ptu
unsigned char m_compass
unsigned short m_sonars [16]
unsigned short m_timer
unsigned char m_analog
unsigned char m_digin
unsigned char m_digout
float m_AngleConvFactor
float m_DistConvFactor
float m_VelConvFactor
float m_RobotRadius
float m_RobotDiagonal
bool m_Holonomic
float m_RangeConvFactor
float m_RobotAxleLength

Private Types

enum  { NO_SYNC, AFTER_FIRST_SYNC, AFTER_SECOND_SYNC, READY }

Private Member Functions

int open_serial (const char *tty)
void lock_send_thread ()
void unlock_send_thread ()
void lock_recv_thread ()
void unlock_recv_thread ()
void send_int_command (unsigned char command, short value)
void send_signed_int_command (unsigned char command, short value)
void send_noarg_command (unsigned char command)
void send_string_command (unsigned char command, const std::string &data)
void send_unsigned_char_command (unsigned char command, const unsigned char *data, int size)
void configure_parameters (const std::string &robotType, const std::string &robotSubType)
void reinitialize ()

Private Attributes

pseudosem_t m_semaphore
pthread_t m_send_thread
pthread_t m_recv_thread
pthread_mutex_t m_send_mutex
pthread_mutex_t m_recv_mutex
volatile bool m_send_running
volatile bool m_recv_running
int m_file_descriptor
std::list< PSOSPacketm_send_list
enum RobotFlow::Pioneer2PacketManager:: { ... }  m_psos_state

Static Private Attributes

static Pioneer2PacketManagerm_instance = NULL

Friends

void * Pioneer2PacketManager_recv_thread (void *user_data)
void * Pioneer2PacketManager_send_thread (void *user_data)

Member Enumeration Documentation

anonymous enum [private]
 

Enumerator:
NO_SYNC 
AFTER_FIRST_SYNC 
AFTER_SECOND_SYNC 
READY 


Constructor & Destructor Documentation

RobotFlow::Pioneer2PacketManager::Pioneer2PacketManager  ) 
 

RobotFlow::Pioneer2PacketManager::~Pioneer2PacketManager  )  [virtual]
 


Member Function Documentation

void RobotFlow::Pioneer2PacketManager::configure_parameters const std::string &  robotType,
const std::string &  robotSubType
[private]
 

void RobotFlow::Pioneer2PacketManager::destroyInstance  )  [static]
 

void RobotFlow::Pioneer2PacketManager::get_all Pioneer2Data data  ) 
 

float RobotFlow::Pioneer2PacketManager::get_analog  ) 
 

float RobotFlow::Pioneer2PacketManager::get_battery  ) 
 

unsigned short RobotFlow::Pioneer2PacketManager::get_bumpers  ) 
 

float RobotFlow::Pioneer2PacketManager::get_compass  ) 
 

float RobotFlow::Pioneer2PacketManager::get_control  ) 
 

unsigned char RobotFlow::Pioneer2PacketManager::get_digin  ) 
 

unsigned char RobotFlow::Pioneer2PacketManager::get_digout  ) 
 

float RobotFlow::Pioneer2PacketManager::get_Lvel  ) 
 

unsigned short RobotFlow::Pioneer2PacketManager::get_ptu  ) 
 

float RobotFlow::Pioneer2PacketManager::get_Rvel  ) 
 

float RobotFlow::Pioneer2PacketManager::get_sonar int  s_number  ) 
 

unsigned char RobotFlow::Pioneer2PacketManager::get_status  ) 
 

float RobotFlow::Pioneer2PacketManager::get_Thpos  ) 
 

unsigned short RobotFlow::Pioneer2PacketManager::get_timer  ) 
 

float RobotFlow::Pioneer2PacketManager::get_Xpos  ) 
 

float RobotFlow::Pioneer2PacketManager::get_Ypos  ) 
 

void RobotFlow::Pioneer2PacketManager::initialize const std::string &  tty  ) 
 

Pioneer2PacketManager * RobotFlow::Pioneer2PacketManager::instance  )  [static]
 

void RobotFlow::Pioneer2PacketManager::lock_recv_thread  )  [private]
 

void RobotFlow::Pioneer2PacketManager::lock_send_thread  )  [private]
 

int RobotFlow::Pioneer2PacketManager::open_serial const char *  tty  )  [private]
 

void RobotFlow::Pioneer2PacketManager::reinitialize  )  [private]
 

void RobotFlow::Pioneer2PacketManager::send_ad_select_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_bumpstall_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_colbert_relative_heading short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_config_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_digout_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_emergency_stop  ) 
 

void RobotFlow::Pioneer2PacketManager::send_encoder_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_front_sonar_command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_getaux_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_gripper_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_gripper_val_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_heading_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_int_command unsigned char  command,
short  value
[private]
 

void RobotFlow::Pioneer2PacketManager::send_motor_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_noarg_command unsigned char  command  )  [private]
 

void RobotFlow::Pioneer2PacketManager::send_ptupos_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_pulse  ) 
 

void RobotFlow::Pioneer2PacketManager::send_rear_sonar_command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_rel_heading_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_reset_rotational_vel short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_reset_server  ) 
 

void RobotFlow::Pioneer2PacketManager::send_reset_translational_acc short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_reset_translational_vel short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_rotational_acc short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_rotational_vel short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_say_command const std::string &  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_signed_int_command unsigned char  command,
short  value
[private]
 

void RobotFlow::Pioneer2PacketManager::send_sonar_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_step  ) 
 

void RobotFlow::Pioneer2PacketManager::send_stop_command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_string_command unsigned char  command,
const std::string &  data
[private]
 

void RobotFlow::Pioneer2PacketManager::send_tcm2_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_tty2_command const unsigned char *  data,
int  size
 

void RobotFlow::Pioneer2PacketManager::send_tty2_command const std::string &  data  ) 
 

void RobotFlow::Pioneer2PacketManager::send_unsigned_char_command unsigned char  command,
const unsigned char *  data,
int  size
[private]
 

void RobotFlow::Pioneer2PacketManager::send_velocity2_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::send_velocity_command short  command  ) 
 

void RobotFlow::Pioneer2PacketManager::unlock_recv_thread  )  [private]
 

void RobotFlow::Pioneer2PacketManager::unlock_send_thread  )  [private]
 


Friends And Related Function Documentation

void* Pioneer2PacketManager_recv_thread void *  user_data  )  [friend]
 

void* Pioneer2PacketManager_send_thread void *  user_data  )  [friend]
 


Field Documentation

const unsigned char RobotFlow::Pioneer2PacketManager::ADSEL = 35 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::BUMPSTALL = 44 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::CLOSE = 2 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::CONFIG = 18 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::DCHEAD = 22 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::DHEAD = 13 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::DIGOUT = 30 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::E_STOP = 55 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::ENABLE = 4 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::ENCODER = 19 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::GETAUX = 43 [static]
 

const short RobotFlow::Pioneer2PacketManager::GRIPCLOSE = 2 [static]
 

const short RobotFlow::Pioneer2PacketManager::GRIPDEPLOY = 8 [static]
 

const short RobotFlow::Pioneer2PacketManager::GRIPHALT = 15 [static]
 

const short RobotFlow::Pioneer2PacketManager::GRIPOPEN = 1 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::GRIPPER = 33 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::GRIPPERVAL = 36 [static]
 

const short RobotFlow::Pioneer2PacketManager::GRIPPRESS = 16 [static]
 

const short RobotFlow::Pioneer2PacketManager::GRIPSTOP = 3 [static]
 

const short RobotFlow::Pioneer2PacketManager::GRIPSTORE = 7 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::HEAD = 12 [static]
 

const short RobotFlow::Pioneer2PacketManager::LIFTCARRY = 17 [static]
 

const short RobotFlow::Pioneer2PacketManager::LIFTDOWN = 5 [static]
 

const short RobotFlow::Pioneer2PacketManager::LIFTSTOP = 6 [static]
 

const short RobotFlow::Pioneer2PacketManager::LIFTUP = 4 [static]
 

unsigned char RobotFlow::Pioneer2PacketManager::m_analog [protected]
 

float RobotFlow::Pioneer2PacketManager::m_AngleConvFactor [protected]
 

unsigned char RobotFlow::Pioneer2PacketManager::m_battery [protected]
 

short RobotFlow::Pioneer2PacketManager::m_bumpers [protected]
 

unsigned char RobotFlow::Pioneer2PacketManager::m_compass [protected]
 

short RobotFlow::Pioneer2PacketManager::m_control [protected]
 

unsigned char RobotFlow::Pioneer2PacketManager::m_digin [protected]
 

unsigned char RobotFlow::Pioneer2PacketManager::m_digout [protected]
 

float RobotFlow::Pioneer2PacketManager::m_DistConvFactor [protected]
 

int RobotFlow::Pioneer2PacketManager::m_file_descriptor [private]
 

bool RobotFlow::Pioneer2PacketManager::m_Holonomic [protected]
 

Pioneer2PacketManager * RobotFlow::Pioneer2PacketManager::m_instance = NULL [static, private]
 

short RobotFlow::Pioneer2PacketManager::m_lvel [protected]
 

enum { ... } RobotFlow::Pioneer2PacketManager::m_psos_state [private]
 

unsigned short RobotFlow::Pioneer2PacketManager::m_ptu [protected]
 

float RobotFlow::Pioneer2PacketManager::m_RangeConvFactor [protected]
 

pthread_mutex_t RobotFlow::Pioneer2PacketManager::m_recv_mutex [private]
 

volatile bool RobotFlow::Pioneer2PacketManager::m_recv_running [private]
 

pthread_t RobotFlow::Pioneer2PacketManager::m_recv_thread [private]
 

float RobotFlow::Pioneer2PacketManager::m_RobotAxleLength [protected]
 

float RobotFlow::Pioneer2PacketManager::m_RobotDiagonal [protected]
 

float RobotFlow::Pioneer2PacketManager::m_RobotRadius [protected]
 

short RobotFlow::Pioneer2PacketManager::m_rvel [protected]
 

pseudosem_t RobotFlow::Pioneer2PacketManager::m_semaphore [private]
 

std::list<PSOSPacket> RobotFlow::Pioneer2PacketManager::m_send_list [private]
 

pthread_mutex_t RobotFlow::Pioneer2PacketManager::m_send_mutex [private]
 

volatile bool RobotFlow::Pioneer2PacketManager::m_send_running [private]
 

pthread_t RobotFlow::Pioneer2PacketManager::m_send_thread [private]
 

unsigned short RobotFlow::Pioneer2PacketManager::m_sonars[16] [protected]
 

unsigned char RobotFlow::Pioneer2PacketManager::m_status [protected]
 

short RobotFlow::Pioneer2PacketManager::m_thpos [protected]
 

unsigned short RobotFlow::Pioneer2PacketManager::m_timer [protected]
 

float RobotFlow::Pioneer2PacketManager::m_VelConvFactor [protected]
 

unsigned short RobotFlow::Pioneer2PacketManager::m_xpos [protected]
 

unsigned short RobotFlow::Pioneer2PacketManager::m_ypos [protected]
 

const int RobotFlow::Pioneer2PacketManager::MAX_QUEUE_SIZE = 20 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::OPEN = 1 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::POLLING = 3 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::PTUPOS = 41 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::PULSE = 0 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::RVEL = 21 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::SAY = 15 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::SET0 = 7 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::SETA = 5 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::SETRA = 23 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::SETRV = 10 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::SETV = 6 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::SONAR = 28 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::STEP = 64 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::STOP = 29 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::SYNC0 = 0 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::SYNC1 = 1 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::SYNC2 = 2 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::TCM2 = 45 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::TTY2 = 42 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::VEL = 11 [static]
 

const unsigned char RobotFlow::Pioneer2PacketManager::VEL2 = 32 [static]
 


The documentation for this class was generated from the following files:
Generated on Wed Oct 5 14:36:30 2005 for RobotFlow by  doxygen 1.4.4