Classes | Functions | Variables
cart2_main.cpp File Reference
#include <iostream>
#include <math.h>
#include <time.h>
#include <signal.h>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <sstream>
#include <boost/algorithm/string.hpp>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/asio/serial_port.hpp>
#include <boost/asio/streambuf.hpp>
#include <boost/regex.hpp>
#include <boost/thread.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <labust/tools/TimingTools.hpp>
#include <std_msgs/Bool.h>
#include <labust/math/NumberManipulation.hpp>
#include <std_msgs/Float32MultiArray.h>
#include <labust/control/PIDController.hpp>
#include <ros/ros.h>
#include <auv_msgs/BodyForceReq.h>
#include <diagnostic_msgs/DiagnosticStatus.h>
Include dependency graph for cart2_main.cpp:

Go to the source code of this file.

Classes

struct  CalibrationData
struct  TauC
struct  TauT

Functions

void EstablishSerialComm ()
void handleTau (TauC *tauOut, const auv_msgs::BodyForceReq::ConstPtr tauIn)
bool Initialization (int ID)
int main (int argc, char *argv[])
void onCalibration (CalibrationData &data, const std_msgs::Bool::ConstPtr &calibration)
void onGyroCalibration (CalibrationData &data, const std_msgs::Bool::ConstPtr &calibration)
void onLights (const std_msgs::Bool::ConstPtr &lights)
void onResetPin (const std_msgs::Bool::ConstPtr &resetPin)
float parsData ()
serial_port port (io)
void ReadData ()
void ReadHandler (const boost::system::error_code &e, std::size_t size)
void sendDiagnostics (ros::Publisher &diag, bool CommsOkFlag)
void SetDigiOut ()
void SetReference (int ID, float REF)
void watch ()
double wrapRPM (double value)

Variables

char AxisOFFID1 [] = {0x04, 0x00, 0x10,0x00, 0x02, 0x16}
char AxisOFFID2 [] = {0x04, 0x00, 0x20,0x00, 0x02, 0x26}
char AxisONID1 [] = {0x04, 0x00, 0x10,0x01, 0x02, 0x17}
char AxisONID2 [] = {0x04, 0x00, 0x20,0x01, 0x02, 0x27}
bool CommsOkFlag = true
double currentAvg [2] = {0,0}
int DigOutNumber = 1
char DriveReply [1]
char DriveReplyLong [12]
char GetCurrent1 [] = {0x08, 0x00, 0x10, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x3C, 0x1B}
char GetCurrent2 [] = {0x08, 0x00, 0x20, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x3C, 0x2B}
char GetPosition1 [] = {0x08, 0x00, 0x10, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x28, 0x07}
char GetPosition2 [] = {0x08, 0x00, 0x20, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x28, 0x17}
char GetTemperature [] = {0x08, 0x00, 0x10, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x41, 0x20}
char GetVehicleCurrent [] = {0x08, 0x00, 0x10, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x3E, 0x1D}
char GetVoltage [] = {0x08, 0x00, 0x10, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x40, 0x1F}
streambuf inputBuffer
double integralRPM [2] = {0,0}
int intMax = 32767
io_service io
double Load_Position [2]
double Load_Position_Previous [2]
std::string Mode
std::string Mode1
double Motor_Current [2]
double Motor_Current_Previous [2]
streambuf outputBuffer
char ReadISR1 [] = {0x08, 0x00, 0x10, 0xB0, 0x04, 0x00, 0x11, 0x03, 0x06, 0xE6}
char ReadISR2 [] = {0x08, 0x00, 0x20, 0xB0, 0x04, 0x00, 0x11, 0x03, 0x06, 0xF6}
char ResetID1 [] = {0x04, 0x00, 0x10, 0x04, 0x02, 0x1A}
char ResetID2 [] = {0x04, 0x00, 0x20, 0x04, 0x02, 0x2A}
double RPM [2] = {0}
int StateDO [] = {1,0,0,0}
double Supply_Voltage
double Supply_Voltage_Previous
float TauFrwold = 0
float TauYawold = 0
double Temperature
double Vehicle_Current
double Vehicle_Current_Previous

Function Documentation

Definition at line 472 of file cart2_main.cpp.

void handleTau ( TauC tauOut,
const auv_msgs::BodyForceReq::ConstPtr  tauIn 
)

Definition at line 568 of file cart2_main.cpp.

bool Initialization ( int  ID)

Definition at line 360 of file cart2_main.cpp.

int main ( int  argc,
char *  argv[] 
)

Definition at line 704 of file cart2_main.cpp.

void onCalibration ( CalibrationData data,
const std_msgs::Bool::ConstPtr &  calibration 
)

Definition at line 653 of file cart2_main.cpp.

void onGyroCalibration ( CalibrationData data,
const std_msgs::Bool::ConstPtr &  calibration 
)

Definition at line 677 of file cart2_main.cpp.

void onLights ( const std_msgs::Bool::ConstPtr &  lights)

Definition at line 698 of file cart2_main.cpp.

void onResetPin ( const std_msgs::Bool::ConstPtr &  resetPin)

Definition at line 693 of file cart2_main.cpp.

float parsData ( )

Definition at line 145 of file cart2_main.cpp.

serial_port port ( io  )
void ReadData ( )

Definition at line 463 of file cart2_main.cpp.

void ReadHandler ( const boost::system::error_code &  e,
std::size_t  size 
)

Definition at line 231 of file cart2_main.cpp.

void sendDiagnostics ( ros::Publisher diag,
bool  CommsOkFlag 
)

Definition at line 574 of file cart2_main.cpp.

void SetDigiOut ( )

Definition at line 162 of file cart2_main.cpp.

void SetReference ( int  ID,
float  REF 
)

Definition at line 206 of file cart2_main.cpp.

void watch ( )
Todo:
Check this timeout watch. What is it supposed to be doing ?

Definition at line 558 of file cart2_main.cpp.

double wrapRPM ( double  value)

Definition at line 623 of file cart2_main.cpp.


Variable Documentation

char AxisOFFID1[] = {0x04, 0x00, 0x10,0x00, 0x02, 0x16}

Definition at line 129 of file cart2_main.cpp.

char AxisOFFID2[] = {0x04, 0x00, 0x20,0x00, 0x02, 0x26}

Definition at line 130 of file cart2_main.cpp.

char AxisONID1[] = {0x04, 0x00, 0x10,0x01, 0x02, 0x17}

Definition at line 127 of file cart2_main.cpp.

char AxisONID2[] = {0x04, 0x00, 0x20,0x01, 0x02, 0x27}

Definition at line 128 of file cart2_main.cpp.

bool CommsOkFlag = true

Definition at line 123 of file cart2_main.cpp.

double currentAvg[2] = {0,0}

Definition at line 109 of file cart2_main.cpp.

int DigOutNumber = 1

Definition at line 113 of file cart2_main.cpp.

char DriveReply[1]

Definition at line 120 of file cart2_main.cpp.

char DriveReplyLong[12]

Definition at line 120 of file cart2_main.cpp.

char GetCurrent1[] = {0x08, 0x00, 0x10, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x3C, 0x1B}

Definition at line 136 of file cart2_main.cpp.

char GetCurrent2[] = {0x08, 0x00, 0x20, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x3C, 0x2B}

Definition at line 137 of file cart2_main.cpp.

char GetPosition1[] = {0x08, 0x00, 0x10, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x28, 0x07}

Definition at line 140 of file cart2_main.cpp.

char GetPosition2[] = {0x08, 0x00, 0x20, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x28, 0x17}

Definition at line 141 of file cart2_main.cpp.

char GetTemperature[] = {0x08, 0x00, 0x10, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x41, 0x20}

Definition at line 134 of file cart2_main.cpp.

char GetVehicleCurrent[] = {0x08, 0x00, 0x10, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x3E, 0x1D}

Definition at line 135 of file cart2_main.cpp.

char GetVoltage[] = {0x08, 0x00, 0x10, 0xB0, 0x04, 0x00, 0x11, 0x02, 0x40, 0x1F}

Definition at line 133 of file cart2_main.cpp.

streambuf inputBuffer

Definition at line 117 of file cart2_main.cpp.

double integralRPM[2] = {0,0}

Definition at line 104 of file cart2_main.cpp.

int intMax = 32767

Definition at line 106 of file cart2_main.cpp.

io_service io

Definition at line 124 of file cart2_main.cpp.

double Load_Position[2]

Definition at line 107 of file cart2_main.cpp.

Definition at line 107 of file cart2_main.cpp.

std::string Mode

Definition at line 122 of file cart2_main.cpp.

std::string Mode1

Definition at line 122 of file cart2_main.cpp.

double Motor_Current[2]

Definition at line 107 of file cart2_main.cpp.

Definition at line 107 of file cart2_main.cpp.

std::ostream os & outputBuffer

Definition at line 117 of file cart2_main.cpp.

char ReadISR1[] = {0x08, 0x00, 0x10, 0xB0, 0x04, 0x00, 0x11, 0x03, 0x06, 0xE6}

Definition at line 138 of file cart2_main.cpp.

char ReadISR2[] = {0x08, 0x00, 0x20, 0xB0, 0x04, 0x00, 0x11, 0x03, 0x06, 0xF6}

Definition at line 139 of file cart2_main.cpp.

char ResetID1[] = {0x04, 0x00, 0x10, 0x04, 0x02, 0x1A}

Definition at line 131 of file cart2_main.cpp.

char ResetID2[] = {0x04, 0x00, 0x20, 0x04, 0x02, 0x2A}

Definition at line 132 of file cart2_main.cpp.

double RPM[2] = {0}

Definition at line 108 of file cart2_main.cpp.

int StateDO[] = {1,0,0,0}

Definition at line 143 of file cart2_main.cpp.

Definition at line 107 of file cart2_main.cpp.

Definition at line 107 of file cart2_main.cpp.

float TauFrwold = 0

Definition at line 102 of file cart2_main.cpp.

float TauYawold = 0

Definition at line 103 of file cart2_main.cpp.

double Temperature

Definition at line 107 of file cart2_main.cpp.

Definition at line 107 of file cart2_main.cpp.

Definition at line 107 of file cart2_main.cpp.



cart2
Author(s): Gyula Nagy
autogenerated on Fri Feb 7 2014 11:37:19