diff --git a/commConfig.h b/commConfig.h index b0e19f1..776bfa8 100644 --- a/commConfig.h +++ b/commConfig.h @@ -276,18 +276,22 @@ typedef union packetVSSTelemetry { typedef struct { uint8_t typeMsg : 4; uint8_t id : 4; - int16_t x : 16; // -32.767 - 32.767 m - int16_t y : 16; // -32.767 - 32.767 m - int16_t w : 16; // 0 - 6.5535 rad - int16_t dribbler : 15; // -1638.3 - 1638.3 rad/s - uint8_t kickLoad : 8; // 0 - 2.55 + int16_t x : 16; // -32.767 - 32.767 m + int16_t y : 16; // -32.767 - 32.767 m + int16_t w : 16; // 0 - 6.5535 rad + int16_t dribbler : 15; // -1638.3 - 1638.3 rad/s + uint8_t kickLoad : 8; // 0 - 2.55 bool ball : 1; - uint8_t battery : 8; // 0 - 25.5 V - int16_t m1 : 16; // -327.67 - 327.67 m/s - int16_t m2 : 16; // -327.67 - 327.67 m/s - int16_t m3 : 16; // -327.67 - 327.67 m/s - int16_t m4 : 16; // -327.67 - 327.67 m/s - uint8_t pcktCount : 8; + uint8_t battery : 8; // 0 - 25.5 V + int16_t m1 : 16; // -327.67 - 327.67 m/s + int16_t m2 : 16; // -327.67 - 327.67 m/s + int16_t m3 : 16; // -327.67 - 327.67 m/s + int16_t m4 : 16; // -327.67 - 327.67 m/s + uint8_t pcktCount : 8; // 0 - 2.55 + uint8_t current_m1 : 8; // 0 - 2.55 + uint8_t current_m2 : 8; // 0 - 2.55 + uint8_t current_m3 : 8; // 0 - 2.55 + uint8_t current_m4 : 8; // 0 - 2.55 } packetTypeOdometry; diff --git a/nRF24Communication.cpp b/nRF24Communication.cpp index 5956190..0ca5945 100644 --- a/nRF24Communication.cpp +++ b/nRF24Communication.cpp @@ -290,6 +290,10 @@ bool nRF24Communication::sendOdometryPacket(RobotInfo odometry) { this->_mOdometry.decoded.m3 = static_cast(odometry.m.m3 * 100); this->_mOdometry.decoded.m4 = static_cast(odometry.m.m4 * 100); this->_mOdometry.decoded.pcktCount = static_cast(odometry.count); + this->_mOdometry.decoded.current_m1 = static_cast(odometry.current.m1 * 100); + this->_mOdometry.decoded.current_m2 = static_cast(odometry.current.m2 * 100); + this->_mOdometry.decoded.current_m3 = static_cast(odometry.current.m3 * 100); + this->_mOdometry.decoded.current_m4 = static_cast(odometry.current.m4 * 100); this->enable(); bool answer = this->_radio.write(this->_mOdometry.encoded, ODOMETRY_LENGTH); this->disable(); @@ -401,4 +405,4 @@ bool nRF24Communication::robotMoveIsLocked() { bool nRF24Communication::robotMoveCriticalTurbo() { return _criticalMoveTurbo; -} \ No newline at end of file +}