Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ublox_gps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ target_link_libraries(ublox_gps PUBLIC
${ublox_msgs_TARGETS}
ublox_serialization::ublox_serialization
)
if(MSVC)
target_compile_definitions(ublox_gps PRIVATE _USE_MATH_DEFINES)
endif()

install(TARGETS ublox_gps EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
Expand Down
11 changes: 11 additions & 0 deletions ublox_gps/include/ublox_gps/ublox_firmware7plus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
#include <ublox_gps/ublox_firmware.hpp>
#include <ublox_gps/utils.hpp>

#if defined(_WIN32) && defined(ERROR)
#pragma push_macro("ERROR")
#undef ERROR
#define UBLOX_GPS_RESTORE_ERROR_MACRO
#endif

namespace ublox_node {

/**
Expand Down Expand Up @@ -211,4 +217,9 @@ class UbloxFirmware7Plus : public UbloxFirmware {

} // namespace ublox_node

#ifdef UBLOX_GPS_RESTORE_ERROR_MACRO
#pragma pop_macro("ERROR")
#undef UBLOX_GPS_RESTORE_ERROR_MACRO
#endif

#endif // UBLOX_GPS_UBLOX_FIRMWARE7PLUS_HPP
2 changes: 2 additions & 0 deletions ublox_gps/src/gps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@ void Gps::initializeSerial(const std::string & port, unsigned int baudrate,

RCLCPP_INFO(logger_, "U-Blox: Opened serial port %s", port.c_str());

#ifndef _WIN32
int fd = serial->native_handle();
termios tio{};
tcgetattr(fd, &tio);
cfmakeraw(&tio);
tcsetattr(fd, TCSANOW, &tio);
#endif

// Set the I/O worker
if (worker_) {
Expand Down
11 changes: 11 additions & 0 deletions ublox_gps/src/hpg_ref_product.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
#include <ublox_gps/rtcm.hpp>
#include <ublox_gps/utils.hpp>

#if defined(_WIN32) && defined(ERROR)
#pragma push_macro("ERROR")
#undef ERROR
#define UBLOX_GPS_RESTORE_ERROR_MACRO
#endif

namespace ublox_node {

//
Expand Down Expand Up @@ -256,3 +262,8 @@ void HpgRefProduct::tmode3Diagnostics(
}

} // namespace ublox_node

#ifdef UBLOX_GPS_RESTORE_ERROR_MACRO
#pragma pop_macro("ERROR")
#undef UBLOX_GPS_RESTORE_ERROR_MACRO
#endif
11 changes: 11 additions & 0 deletions ublox_gps/src/hpg_rov_product.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
#include <ublox_gps/ublox_topic_diagnostic.hpp>
#include <ublox_gps/utils.hpp>

#if defined(_WIN32) && defined(ERROR)
#pragma push_macro("ERROR")
#undef ERROR
#define UBLOX_GPS_RESTORE_ERROR_MACRO
#endif

namespace ublox_node {

//
Expand Down Expand Up @@ -101,3 +107,8 @@ void HpgRovProduct::callbackNavRelPosNed(const ublox_msgs::msg::NavRELPOSNED &m)
}

} // namespace ublox_node

#ifdef UBLOX_GPS_RESTORE_ERROR_MACRO
#pragma pop_macro("ERROR")
#undef UBLOX_GPS_RESTORE_ERROR_MACRO
#endif
15 changes: 13 additions & 2 deletions ublox_gps/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@
#include <ublox_gps/ublox_firmware8.hpp>
#include <ublox_gps/ublox_firmware9.hpp>

#if defined(_WIN32) && defined(ERROR)
#pragma push_macro("ERROR")
#undef ERROR
#define UBLOX_GPS_RESTORE_ERROR_MACRO
#endif

namespace ublox_node {

/**
Expand Down Expand Up @@ -653,8 +659,8 @@ void UbloxNode::processMonVer() {
RCLCPP_DEBUG(this->get_logger(), "%s",
std::string(monVer.extension[i].field.begin(), monVer.extension[i].field.end()).c_str());
// Find the end of the string (null character)
unsigned char* end = std::find(monVer.extension[i].field.begin(),
monVer.extension[i].field.end(), '\0');
auto end = std::find(
monVer.extension[i].field.begin(), monVer.extension[i].field.end(), '\0');
extensions.emplace_back(std::string(monVer.extension[i].field.begin(), end));
}

Expand Down Expand Up @@ -940,4 +946,9 @@ UbloxNode::~UbloxNode() {

} // namespace ublox_node

#ifdef UBLOX_GPS_RESTORE_ERROR_MACRO
#pragma pop_macro("ERROR")
#undef UBLOX_GPS_RESTORE_ERROR_MACRO
#endif

RCLCPP_COMPONENTS_REGISTER_NODE(ublox_node::UbloxNode)
11 changes: 11 additions & 0 deletions ublox_gps/src/ublox_firmware6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
#include <ublox_gps/ublox_firmware6.hpp>
#include <ublox_gps/utils.hpp>

#if defined(_WIN32) && defined(ERROR)
#pragma push_macro("ERROR")
#undef ERROR
#define UBLOX_GPS_RESTORE_ERROR_MACRO
#endif

namespace ublox_node {

//
Expand Down Expand Up @@ -244,3 +250,8 @@ void UbloxFirmware6::callbackNavSol(const ublox_msgs::msg::NavSOL& m) {
}

} // namespace ublox_node

#ifdef UBLOX_GPS_RESTORE_ERROR_MACRO
#pragma pop_macro("ERROR")
#undef UBLOX_GPS_RESTORE_ERROR_MACRO
#endif