17 #define L_JOY_LIMIT_X 1830
18 #define H_JOY_LIMIT_X 2050
19 #define L_JOY_LIMIT_Y 1940
20 #define H_JOY_LIMIT_Y 2160
22 #define CRC_INIT 0xffff
23 #define CRC_POLYNOMIAL 0x1021
Parsing class for a processing data from the serial port frame.
int _xAxis
The joystick swing on the x axis.
float calculateSpeedLeft(const int &xAxis, const int &yAxis)
Calculate speed value on the left motor from the joystick swing.
float calculateSpeedRight(const int &xAxis, const int &yAxis)
Calculate speed value on the right motor from the joystick swing.
void changedRightMotorAcceleration(const QString &accelerationValue)
A signal emitted when parsed data of the right motor acceleration is ready.
void setObstacleCloseStatus()
Set the Obstacle Close Status.
void changedLidar(const std::map< float, int > lidarData)
A signal emitted when parsed data of the lidar is ready.
void leftMotorDirection(const int &direction)
A signal emitted to pass wheel rotating direction to the openGL widget.
int _leftAcceleration
The left motor acceleration.
Parser()=default
Construct a new Parser object.
void changedLeftMotorGSpeed(const QString &speedValue)
A signal emitted when parsed data of the left motor given speed is ready.
void changedBattery(int battery)
A signal emitted when parsed data of the battery voltage is ready.
void processData()
Process data from a one frame.
bool parseFrame(const std::string &frame)
Parse line from the serial port into managed variables.
void changedRightMotorSpeed(const QString &speedValue)
A signal emitted when parsed data of the right motor speed is ready.
int _CRC16
Sent CRC from the device.
void changedLeftMotorSpeed(const QString &speedValue)
A signal emitted when parsed data of the left motor speed is ready.
int _battery
The battery voltage.
void changedJoystick(const QPoint &coordinates)
A signal emitted when parsed data of a joystick swing is ready.
int _leftSpeed
The left motor speed.
int _rightSpeed
The right motor speed.
void changedRightMotorGSpeed(const QString &speedValue)
A signal emitted when parsed data of the right motor given speed is ready.
~Parser()=default
Destroy the Parser object.
void resetObstacleCloseStatus()
Reset the Obstacle Close Status.
int _rightAcceleration
The right motor acceleration.
void rightMotorDirection(const int &direction)
A signal emitted to pass wheel rotating direction to the openGL widget.
void changedLeftMotorAcceleration(const QString &accelerationValue)
A signal emitted when parsed data of the left motor acceleration is ready.
int _yAxis
The joystick swing on the y axis.
std::map< float, int > _lidarData
Data from a laser sensor.