RTCM error messages fed to the ZEDF9P rover does not have impact on GPS receiver accuracy.
The RTCM messages fed to the ZEDF9P do not seem to have any impact on the accuracy of the NMEA messages.
We are trying to interface ROS2 ntripclient RTCM error messages with our ZEDF9P GPS module configured as a Rover:
The RTCM error messages are in following format:
header:
stamp:
sec: 1716298564
nanosec: 352618551
frame_id: odom
data:
- 211
- 0
- 19
- 62
- 208
- 0
- 3
- 136
- 164
- 96
- 85
- 252
- 191
- 11
- 95
- 2
- 88
- 11
- 255
- 176
- 0
- 67
- 144
- 238
- 83
===================================
As per our understanding “data” contains the RTCM messages.
We are using below code to feed RTCM messages and read NMEA messages via the ZEDF9P USB interface(configured to handle appropriates messages) :
#include <rclcpp/rclcpp.hpp>
#include <mavros_msgs/msg/rtcm.hpp>
#include <libserial/SerialPort.h>
#include <libserial/SerialPortConstants.h>
class SerialTalkerNode : public rclcpp::Node
{
public:
SerialTalkerNode(const std::string& node_name, const std::string& port, const int baudrate)
: Node(node_name), port_(port), baudrate_(baudrate)
{
// Create subscriber
//publisher_ = this->create_publisher<std_msgs::msg::String>("topic", 10);
timer_ = this->create_wall_timer(std::chrono::milliseconds(100), std::bind(&SerialTalkerNode::publishCommand, this));
subscription_ = create_subscription<mavros_msgs::msg::RTCM>(
"/ntrip_client/rtcm", // Replace with your topic name
10,
std::bind(&SerialTalkerNode::topicCallback, this, std::placeholders::_1));
//std::string fileName = "/dev/pts/11";
std::string fileName = "/dev/ttyACM1";
serial_.Open(fileName);
// Open serial port
/*
try {
std::string fileName = "/dev/pts/7"; // Example file name
std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out; // Example open mode
serial_.Open(fileName, mode);
} catch (const serial::IOException& e) {
RCLCPP_ERROR(this->get_logger(), "Failed to open serial port: %s", e.what());
rclcpp::shutdown();
}
*/
}
private:
rclcpp::Subscription<mavros_msgs::msg::RTCM>::SharedPtr subscription_;
//rclcpp::Publisher<std_msgs::msg::String>::SharedPtr publisher_;
LibSerial::SerialPort serial_;
std::string port_;
int baudrate_;
rclcpp::TimerBase::SharedPtr timer_;
void topicCallback(const mavros_msgs::msg::RTCM::SharedPtr msg)
{
for(int i=0;i<sizeof(msg->data);i++)
{
serial_.WriteByte(msg->data[i]);
}
}
void publishCommand() {
LibSerial::DataBuffer NMEA_Buff;
serial_.Read(NMEA_Buff,2000,0);
std::cout<<NMEA_Buff.size()<<"n";
for(unsigned char dat : NMEA_Buff)
{
if(dat=='$')
{
std::cout<<"n";
}
else
std::cout<<dat;
}
}
};
int main(int argc, char** argv)
{
rclcpp::init(argc, argv);
auto node = std::make_shared<SerialTalkerNode>("serial_talker", "/dev/ttyUSB0", 115200); // Replace with your settings
rclcpp::spin(node);
rclcpp::shutdown();
return 0;
}
========================================
The error messages does not seem to have any impact on accuracy. Kindly help with insights.
New contributor
Rijo Thomas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.