Roomba App  1.0
Parser Class Reference

The Parser class. More...

#include <parser.hh>

Inheritance diagram for Parser:
Collaboration diagram for Parser:

Signals

void changedLeftMotorGSpeed (const QString &speedValue)
 Signal emitted when parsed data of left motor given speed is ready. More...
 
void changedRightMotorGSpeed (const QString &speedValue)
 Signal emitted when parsed data of right motor given speed is ready. More...
 
void changedLeftMotorSpeed (const QString &speedValue)
 Signal emitted when parsed data of left motor speed is ready. More...
 
void changedRightMotorSpeed (const QString &speedValue)
 Signal emitted when parsed data of right motor speed is ready. More...
 
void changedLeftMotorAcceleration (const QString &accelerationValue)
 Signal emitted when parsed data of left motor acceleration is ready. More...
 
void changedRightMotorAcceleration (const QString &accelerationValue)
 Signal emitted when parsed data of right motor acceleration is ready. More...
 
void changedJoystick (const QPoint &coordinates)
 Signal emitted when parsed data of joystick swing is ready. More...
 
void changedBattery (int battery)
 Signal emitted when parsed data of battery voltage is ready. More...
 
void changedLidar (const std::map< float, int > lidarData)
 Signal emitted when parsed data of lidar is ready. More...
 

Public Member Functions

 Parser ()
 Construct new Parser object. More...
 
 ~Parser ()
 Destruct Parser object. More...
 
bool parseFrame (const std::string &frame)
 Parse line from serial port into managed variables. More...
 
void processData ()
 processData More...
 

Private Member Functions

float calculateSpeedRight (const int &xAxis, const int &yAxis)
 Calculate speed value on right motor from joystick swing. More...
 
float calculateSpeedLeft (const int &xAxis, const int &yAxis)
 Calculate speed value on left motor from joystick swing. More...
 
float calculateAcceleration (const int &acceleration)
 calculateAcceleration More...
 

Private Attributes

int _leftSpeed
 
int _rightSpeed
 
int _leftAcceleration
 
int _rightAcceleration
 
int _xAxis
 
int _yAxis
 
int _battery
 
std::map< float, int > _lidarData
 
int _CRC16
 

Detailed Description

Definition at line 31 of file parser.hh.

Constructor & Destructor Documentation

◆ Parser()

Parser::Parser ( )
explicit

Definition at line 21 of file parser.cpp.

◆ ~Parser()

Parser::~Parser ( )

Definition at line 23 of file parser.cpp.

Member Function Documentation

◆ calculateAcceleration()

float Parser::calculateAcceleration ( const int &  acceleration)
private
Parameters
acceleration
Returns

Definition at line 231 of file parser.cpp.

Here is the caller graph for this function:

◆ calculateSpeedLeft()

float Parser::calculateSpeedLeft ( const int &  xAxis,
const int &  yAxis 
)
private
Parameters
[in]xAxisValue of swing on x axis
[in]yAxisValue of swing on y axis
Returns
Speed value on left motor

Definition at line 168 of file parser.cpp.

Here is the caller graph for this function:

◆ calculateSpeedRight()

float Parser::calculateSpeedRight ( const int &  xAxis,
const int &  yAxis 
)
private
Parameters
[in]xAxisValue of swing on x axis
[in]yAxisValue of swing on y axis
Returns
Speed value on right motor

Definition at line 105 of file parser.cpp.

Here is the caller graph for this function:

◆ changedBattery

void Parser::changedBattery ( int  battery)
signal
Parameters
[out]batteryValue of battery volatge
Here is the caller graph for this function:

◆ changedJoystick

void Parser::changedJoystick ( const QPoint &  coordinates)
signal
Parameters
[out]coordinatesValues of swing on x and y axis
Here is the caller graph for this function:

◆ changedLeftMotorAcceleration

void Parser::changedLeftMotorAcceleration ( const QString &  accelerationValue)
signal
Parameters
[out]accelerationValueValue of left motor acceleration
Here is the caller graph for this function:

◆ changedLeftMotorGSpeed

void Parser::changedLeftMotorGSpeed ( const QString &  speedValue)
signal
Parameters
[out]speedValueValue of left motor given speed
Here is the caller graph for this function:

◆ changedLeftMotorSpeed

void Parser::changedLeftMotorSpeed ( const QString &  speedValue)
signal
Parameters
[out]speedValueValue of left motor speed
Here is the caller graph for this function:

◆ changedLidar

void Parser::changedLidar ( const std::map< float, int >  lidarData)
signal
Parameters
[out]lidarDataMap containing lidar data [key is angle and value is distance]
Here is the caller graph for this function:

◆ changedRightMotorAcceleration

void Parser::changedRightMotorAcceleration ( const QString &  accelerationValue)
signal
Parameters
[out]accelerationValueValue of right motor acceleration
Here is the caller graph for this function:

◆ changedRightMotorGSpeed

void Parser::changedRightMotorGSpeed ( const QString &  speedValue)
signal
Parameters
[out]speedValueValue of right motor given speed
Here is the caller graph for this function:

◆ changedRightMotorSpeed

void Parser::changedRightMotorSpeed ( const QString &  speedValue)
signal
Parameters
[out]speedValueValue of right motor speed
Here is the caller graph for this function:

◆ parseFrame()

bool Parser::parseFrame ( const std::string &  frame)
Parameters
[in]frameOne line from serial port
Returns
Boolean value of parsing frame

Definition at line 25 of file parser.cpp.

Here is the caller graph for this function:

◆ processData()

void Parser::processData ( )

Definition at line 76 of file parser.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _battery

int Parser::_battery
private

Definition at line 146 of file parser.hh.

◆ _CRC16

int Parser::_CRC16
private

Definition at line 150 of file parser.hh.

◆ _leftAcceleration

int Parser::_leftAcceleration
private

Definition at line 140 of file parser.hh.

◆ _leftSpeed

int Parser::_leftSpeed
private

Definition at line 137 of file parser.hh.

◆ _lidarData

std::map<float, int> Parser::_lidarData
private

Definition at line 148 of file parser.hh.

◆ _rightAcceleration

int Parser::_rightAcceleration
private

Definition at line 141 of file parser.hh.

◆ _rightSpeed

int Parser::_rightSpeed
private

Definition at line 138 of file parser.hh.

◆ _xAxis

int Parser::_xAxis
private

Definition at line 143 of file parser.hh.

◆ _yAxis

int Parser::_yAxis
private

Definition at line 144 of file parser.hh.


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