Git Product home page Git Product logo

ntrip_ros's Introduction

NTRIP_ROS

First time to upload my code here. This is a beta version for testing.

This program helps you get RTCM messages from NTRIP caster and get RTK solution:

  1. Recieve PVT topic from ublox_driver;
  2. Generate GPGGA string by PVT message;
  3. Send GPGGA string to NTRIP server(NTRIP caster) by httplib.HTTPConnection, and get RTCM data from response;
  4. Send recieved RTCM data to Ublox-F9P module via UART when the port is opened and single point position valid;
  5. Reconnect if network failed.

NTRIP_ROS

CSDN blog : https://blog.csdn.net/Millium/article/details/125837995?spm=1001.2014.3001.5502

Realtime test uploaded on Bilibili : https://www.bilibili.com/video/BV1CW4y117Du/

1. Prerequisites

1.1 ROS

ROS melodic (tested)

1.2 Python and 3rdparty library

Python 2.7 is required, NOT Python 3.

httplib (if not installed, run pip install to install this module).

1.3 Test information

I tested this program in Ubuntu 18.04 (with ROS melodic and Python 2.7), it seems to work well.

But in Ubuntu 20.04 (with ROS noetic, Python 3 and http.client), errors occurred.

I did a lot of research, I think the main reason may be that http.client in python 3 DOES NOT support ICY 200 OK response header sent by NTRIP caster, but the problem does not exist in httplib.HTTPConnection in Python 2.7 .

2. Build this program

Clone the code to your workspace and:

catkin_make

3. Run with you F9P module

3.1 Install u-center

The version I'm using is v21.09 , you can test NTRIP username and password in Reciever-NTRIP Client.

3.2 Configure PORT and RATE of your F9P module

Firstly you need to correctly configure UART port of your F9P module in Configure-PRT, such as Baudrate and Protocol in/out.

In my case, I use UART1 to send UBX-RXM-RAWX, UBX-RXM-SFRBX and UBX-PVT message via USB-UART module to my laptop (and parsed by ublox_driver, published as ROS topic), and send RTCM message to UART2 via USB-UART module to F9P, so UBX in Potocol out of UART1 is needed, and RTCM in Potocol in of UART2 is needed.

Message rate in Configure-RATE may also be set, for example 10Hz.

After configuration, you can see messages printed in Packet Console.

3.3 Enable PVT message

Because I'm using ublox_driver, I need to enable UBX-RXM-RAWX, UBX-RXM-SFRBX and UBX-PVT message in u-center.

Actually, only UBX-PVT message is needed for RTK. You can use other ublox driver to extract PVT message and publish as ROS topic so RAWX and SFRBX is not needed anymore. Or you could use ublox driver which supports NMEA, then you just need to enable NMEA-GxGGA and subscribe NMEA message and send it to NTRIP caster.

3.4 Run with your Ublox-F9P

  1. Plug in your F9P's UART ports to your computer via USB-UART module, and check ports' name, like /dev/ttyUSB0, then change the port name and baudrate in ntripclient.py (F9P's UART2, for sending RTCM data to module) and driver_config.yaml (F9P's UART1, for recieve PVT message from module) of ublox_driver, don't forget to obtain r/w permissions of the ports.

  2. Launch ublox_driver, and rostopic echo topic /ublox_driver/receiver_pvt, remember to source devel/setup.bash in your terminal in ublox_driver workspace.

  3. Run roscore in a terminal:

roscore
  1. In the other terminal, run this program in your workspace:
source devel/setup.bash
rosrun ntrip_ros ntripclient.py

If your network is fine, UART successfully opened and GNSS single point position is fixed, the recieved RTCM data is sent to UART2 of F9P module.

Then, wait for carr_soln of topic /ublox_driver/receiver_pvt turning to 2, which means RTK fixed solution (0 means no RTK, 1 means RTK float solution), and enjoy it.

Note that RTK solution is obtained in topic /ublox_driver/receiver_pvt.

3.5 Hardware configuration

In my case, I'm using

  1. Beitian BT-F9PK4 module;
  2. Beitian BT-345 antenna;
  3. Quectel EC20 4G module;
  4. CH340 USB to UART module made by myself;
  5. Lenovo laptop with i5-8265U.

4. Reference

4.1 Msg files

ROS message file GnssPVTSolnMsg.msg and GnssTimeMsg.msg are copied from ublox_driver. Many thanks to Dr. Cao for his work.

4.2 Code reference

Thanks to these code contributors:

ntrip_ros by tilk;

ntrip_client by LORD-MicroStrain;

RTK-NTRIP-RTCM by Archfx;

ntrip_ros by MikHut;

ntrip_ros by Road-Balance.

5. TO DO

TCP method (send RTCM data to a given port to ublox_driver, like str2str in RTKLIB) is not supported yet.

Problem in http.client in Python 3 might be solved by ntrip_ros_python3, need to check it out later.

And using socket instead of http.client may be a good idea but script written by myself does not work correctly for now, need to work it out later.

ntrip_ros's People

Contributors

mil1ium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ntrip_ros's Issues

ntrip中没有循环发送gga语句吗?

你好,我读了一下代码,有个疑问就是connect之后是不是就不会向服务器发送gga语句了?千寻需要不断的去发才能fix吧?我用这个文件结合ubloxdriver,pvt中corr那个值是0,也不知道为什么。

无法获取rtk数据

大佬,您好!我运行rosrun ntrip_ros ntripclient.py的时候,一直重复打印Reconnecting...
------ In connecting process: Connected ------
[WARN] [1708445898.383305]: Header not in sync, continue!
[WARN] [1708445898.385667]: Header not in sync, continue!
[WARN] [1708445898.388058]: Header not in sync, continue!
[WARN] [1708445898.390547]: Header not in sync, continue!
[WARN] [1708445898.392742]: Header not in sync, continue!
[WARN] [1708445898.395800]: Header not in sync, continue!
[WARN] [1708445898.398716]: Header not in sync, continue!
[WARN] [1708445898.401565]: Header not in sync, continue!
[WARN] [1708445898.404143]: Header not in sync, continue!
[WARN] [1708445898.406286]: Header not in sync, continue!
[WARN] [1708445898.408952]: Header not in sync, continue!
[WARN] [1708445898.411434]: Header not in sync, continue!
无法得到rtk数据,请问大佬这是哪里问题?我应该怎么修改参数

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.