Skip to content

Commit 1d2a763

Browse files
author
shakuevda
committed
добавил настройку осей ориентации
1 parent cf8b5e0 commit 1d2a763

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/vectornav/vectornav/src/vectornav.cc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,30 @@ bool Vectornav::configure_sensor()
622622

623623
vs_->writeCommunicationProtocolControl(configComm);
624624

625+
// === ТЕСТ ===
626+
// Настройка поворота системы координат
627+
vn::math::mat3f rotation_matrix;
628+
rotation_matrix(0,0) = 0; // C00
629+
rotation_matrix(0,1) = -1; // C01
630+
rotation_matrix(0,2) = 0; // C02
631+
rotation_matrix(1,0) = 1; // C10
632+
rotation_matrix(1,1) = 0; // C11
633+
rotation_matrix(1,2) = 0; // C12
634+
rotation_matrix(2,0) = 0; // C20
635+
rotation_matrix(2,1) = 0; // C21
636+
rotation_matrix(2,2) = 1; // C22
637+
638+
try {
639+
vs_->writeReferenceFrameRotation(rotation_matrix);
640+
// Сохраняем в энергонезависимую память датчика
641+
vs_->writeSettings();
642+
RCLCPP_INFO(get_logger(), "Reference frame rotation applied");
643+
} catch (const std::exception& e) {
644+
RCLCPP_WARN(get_logger(), "Failed to set reference frame rotation: %s", e.what());
645+
}
646+
// === ТЕСТ END ===
647+
648+
625649
auto boRegs = std::vector<std::string>{"BO1", "BO2", "BO3"};
626650
auto boConfigs = std::vector<vn::sensors::BinaryOutputRegister>();
627651

0 commit comments

Comments
 (0)