From 8d78ada7f836d7746b48d8fd134a14c9d3ed62c7 Mon Sep 17 00:00:00 2001 From: nasicurious Date: Tue, 9 Nov 2021 19:47:57 +0330 Subject: [PATCH] servo ui tested ba simulator the addres is wrong just for test --- Servo/include/ModbusConfig.h | 1 - Servo/src/ServoController.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Servo/include/ModbusConfig.h b/Servo/include/ModbusConfig.h index eab91b1..f7dceb1 100644 --- a/Servo/include/ModbusConfig.h +++ b/Servo/include/ModbusConfig.h @@ -11,7 +11,6 @@ struct ModbusConfig { int dataBits = QSerialPort::Data8; int stopBits = QSerialPort::OneStop; int responseTime = 1000; - int numberOfRetries = 3; }; #endif //SETTINGSERIALPARAMETERS_H diff --git a/Servo/src/ServoController.cpp b/Servo/src/ServoController.cpp index 6dce790..9a65949 100644 --- a/Servo/src/ServoController.cpp +++ b/Servo/src/ServoController.cpp @@ -121,7 +121,7 @@ double ServoController::getStopAngle() auto speedVector1 = _modbusWrapper.getHoldingRegister(SRV_STOP_ANGLE_INT_PART_REG, 1); auto speedVector2 = _modbusWrapper.getHoldingRegister(SRV_STOP_ANGLE_FRAC_PART_REG, 1); - return ((speedVector1[0] + speedVector2[0]) / SRV_ANGLE_FACTOR); + return (speedVector1[0] + speedVector2[0] / SRV_ANGLE_FACTOR); } /*************************************************************************************************/ @@ -130,7 +130,7 @@ double ServoController::getStartAngle() auto speedVector1 = _modbusWrapper.getHoldingRegister(SRV_START_ANGLE_INT_PART_REG, 1); auto speedVector2 = _modbusWrapper.getHoldingRegister(SRV_START_ANGLE_FRAC_PART_REG, 1); - return ((speedVector1[0] + speedVector2[0]) / SRV_ANGLE_FACTOR); + return (speedVector1[0] + speedVector2[0] / SRV_ANGLE_FACTOR); } /*************************************************************************************************/