Skip to content

Commit f939680

Browse files
committed
fix ADR/UDR product detection
1 parent 577ef65 commit f939680

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

ublox_gps/include/ublox_gps/adr_udr_product.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace ublox_node {
2828
*/
2929
class AdrUdrProduct final : public virtual ComponentInterface {
3030
public:
31-
explicit AdrUdrProduct(uint16_t nav_rate, uint16_t meas_rate, const std::string & frame_id, std::shared_ptr<diagnostic_updater::Updater> updater, rclcpp::Node* node);
31+
explicit AdrUdrProduct(float protocol_version, uint16_t nav_rate, uint16_t meas_rate, const std::string & frame_id, std::shared_ptr<diagnostic_updater::Updater> updater, rclcpp::Node* node);
3232

3333
/**
3434
* @brief Get the ADR/UDR parameters.
@@ -64,6 +64,7 @@ class AdrUdrProduct final : public virtual ComponentInterface {
6464
private:
6565
//! Whether or not to enable dead reckoning
6666
bool use_adr_;
67+
float protocol_version_;
6768

6869
sensor_msgs::msg::Imu imu_;
6970
sensor_msgs::msg::TimeReference t_ref_;
@@ -89,4 +90,4 @@ class AdrUdrProduct final : public virtual ComponentInterface {
8990

9091
} // namespace ublox_node
9192

92-
#endif // UBLOX_GPS_ADR_UDR_PRODUCT_HPP
93+
#endif // UBLOX_GPS_ADR_UDR_PRODUCT_HPP

ublox_gps/src/adr_udr_product.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ namespace ublox_node {
2525
//
2626
// u-blox ADR devices, partially implemented
2727
//
28-
AdrUdrProduct::AdrUdrProduct(uint16_t nav_rate, uint16_t meas_rate, const std::string & frame_id, std::shared_ptr<diagnostic_updater::Updater> updater, rclcpp::Node* node)
29-
: use_adr_(false), nav_rate_(nav_rate), meas_rate_(meas_rate), frame_id_(frame_id), updater_(updater), node_(node)
28+
AdrUdrProduct::AdrUdrProduct(float protocol_version, uint16_t nav_rate, uint16_t meas_rate, const std::string & frame_id, std::shared_ptr<diagnostic_updater::Updater> updater, rclcpp::Node* node)
29+
: protocol_version_(protocol_version) ,use_adr_(false), nav_rate_(nav_rate), meas_rate_(meas_rate), frame_id_(frame_id), updater_(updater), node_(node)
3030
{
3131
if (getRosBoolean(node_, "publish.esf.meas")) {
3232
imu_pub_ =
@@ -63,7 +63,7 @@ void AdrUdrProduct::getRosParams() {
6363
}
6464

6565
bool AdrUdrProduct::configureUblox(std::shared_ptr<ublox_gps::Gps> gps) {
66-
if (!gps->setUseAdr(use_adr_)) {
66+
if (!gps->setUseAdr(use_adr_, protocol_version_)) {
6767
throw std::runtime_error(std::string("Failed to ")
6868
+ (use_adr_ ? "enable" : "disable") + "use_adr");
6969
}

0 commit comments

Comments
 (0)