Skip to content

Conversation

@taketook34
Copy link
Contributor

Merging reading and sending data from IMU. Tests was written to new file.
It will be good if @ChVictoria verify last commit. I have tested before pr but not with RPI.

@taketook34 taketook34 linked an issue Apr 17, 2025 that may be closed by this pull request
@taketook34 taketook34 self-assigned this Apr 17, 2025
@ChVictoria
Copy link

Hi, @taketook34 , I've tested new version of code with RPI, everything looks good to me, here are the logs:
image
Scenarios with stopping and resuming transmission work as well.

@taketook34
Copy link
Contributor Author

Good afternoon, please do not merge this pull request. I have met some mistakes and I need to fix them or verify why I met this

@taketook34
Copy link
Contributor Author

@ChVictoria good day, please review this. Thank you

@ChVictoria
Copy link

@ChVictoria good day, please review this. Thank you

Hello, I've made changes to bind UDP and TCP sockets to the same port and tested your update - everything works correct, thanks.

@AksonovSergei
Copy link
Member

Please fix the wollowing Code Style warnings:
[1]

/__w/ecu_sw_bb/ecu_sw_bb/src/kpi_rover_ecu/src/KPIRoverECU.cpp:17:26: warning: no header providing "IMUController" is directly included [misc-include-cleaner]
12 | #include "TCPTransport.h"
13 | #include "UDPClient.h"
14 | #include "protocolHandler.h"
15 |
16 | KPIRoverECU::KPIRoverECU(ProtocolHanlder *_protocolHandler, TCPTransport *_tcpTransport, UDPClient *_udpClient,
17 | IMUController *_imuController)

[2]

/__w/ecu_sw_bb/ecu_sw_bb/src/kpi_rover_ecu/src/KPIRoverECU.cpp:66:18: warning: no header providing "size_t" is directly included [misc-include-cleaner]
7 | for (size_t i = 0; i < 2; ++i) {

Copy link
Member

@AksonovSergei AksonovSergei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please double check that you use English language in comments.

IClient& operator=(IClient&&) = delete;
};

#endif No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add new line at the end

int Init() override;
void Destroy() override;

std::string GetSourceIp();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename to GetClientIp() and GetClientPort()

EXPECT_CALL(GetMockRCMPU(), read_accel(::testing::_)).WillOnce(::testing::Return(0));
EXPECT_CALL(GetMockRCMPU(), read_gyro(::testing::_)).WillOnce(::testing::Return(0));

// Получение данных
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please translate to English


int rc_mpu_power_off(void) {
GetMockRCMPU().power_off();
return 0; // Возвращаем успешный код
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Language

// Реализация rc_mpu_default_config
rc_mpu_config_t rc_mpu_default_config(void) {
rc_mpu_config_t config = {};
config.i2c_bus = 2; // Настройка I2C шины
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Language

TEST_F(IMUControllerTest, GetDataWhenEnabled) {
imu_controller.SetEnable();

// Настройка моков для чтения данных акселерометра, гироскопа, кватернионов
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Language

// Получение данных
std::vector<float> data = imu_controller.GetData();

// Проверка того, что данные возвращены
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Language

@taketook34 taketook34 requested a review from AksonovSergei May 6, 2025 19:36
@AksonovSergei
Copy link
Member

Please fix the wollowing Code Style warnings: [1]

/__w/ecu_sw_bb/ecu_sw_bb/src/kpi_rover_ecu/src/KPIRoverECU.cpp:17:26: warning: no header providing "IMUController" is directly included [misc-include-cleaner] 12 | #include "TCPTransport.h" 13 | #include "UDPClient.h" 14 | #include "protocolHandler.h" 15 | 16 | KPIRoverECU::KPIRoverECU(ProtocolHanlder *_protocolHandler, TCPTransport *_tcpTransport, UDPClient *_udpClient, 17 | IMUController *_imuController)

[2]

/__w/ecu_sw_bb/ecu_sw_bb/src/kpi_rover_ecu/src/KPIRoverECU.cpp:66:18: warning: no header providing "size_t" is directly included [misc-include-cleaner] 7 | for (size_t i = 0; i < 2; ++i) {

It should be fixed

@taketook34
Copy link
Contributor Author

I hope it is all I need to fix. @AksonovSergei, please check

@taketook34 taketook34 merged commit 81ecd83 into main May 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement reading and sending to RPI IMU data

4 participants