aussierobots / ublox_dgnss

This usb based ROS2 driver is focused on UBLOX Generation 9 UBX messaging, for a DGNSS rover. High precision data is available.
Apache License 2.0
37 stars 20 forks source link

Portable RTK Base Station Setup #20

Open GPrathap opened 6 months ago

GPrathap commented 6 months ago

I am trying to configure the base and rover stations having exactly this setup: https://docs.holybro.com/gps-and-rtk-system/f9p-h-rtk-series/portable-rtk-base-station-setup

For Base RTK UBLOX U-Center app:

    PRT: UART1, 57600 baud, RCTM3 out, UBX in…press send button in lower left
    TMODE3: Survey-in, 60seconds, 2 meters…press send
    MSG: RTCM3.3 - 1005, UART1 in/out, 1sec…press send
    RTCM3.3 - 1074, UART1 in/out, 1sec…press send
    RTCM3.3 - 1084, UART1 in/out, 1sec…press send
    RTCM3.3 - 1094, UART1 in/out, 1sec…press send
    RTCM3.3 - 1124, UART1 in/out, 1sec…press send
    RTCM3.3 - 1230, UART1 in/out, 5sec…press send
    CFG: Save current configuration to FLASH…press send

For the Base:

       params_base= [
        {'DEVICE_SERIAL_STRING': "esab"},
        {'FRAME_ID': "base"},
        # config measurement interval to 200 ms (ie 5 Hz) and nav update rate to once per measurement
        {'CFG_RATE_MEAS': 0xc8},
        {'CFG_RATE_NAV': 0x1},

        # disable all messages on UART2
        {'CFG_UART2INPROT_NMEA': False},
        {'CFG_UART2INPROT_RTCM3X': False},
        {'CFG_UART2INPROT_UBX': False},
        {'CFG_UART2OUTPROT_NMEA': False},
        {'CFG_UART2OUTPROT_RTCM3X': False},
        {'CFG_UART2OUTPROT_UBX': False},

        # set UART1 baud rate to 57600
        {'CFG-UART1-BAUDRATE': 0xE100},

        # send RTCM messages only (to rover) on UART1
        {'CFG_UART1INPROT_NMEA': False},
        {'CFG_UART1INPROT_RTCM3X': False},
        {'CFG_UART1INPROT_UBX': False},
        {'CFG_UART1OUTPROT_NMEA': False},
        {'CFG_UART1OUTPROT_RTCM3X': True},
        {'CFG_UART1OUTPROT_UBX': False},

        # RTCM and UBX messages as required on USB
        {'CFG_USBINPROT_NMEA': False},
        {'CFG_USBINPROT_RTCM3X': True},
        {'CFG_USBINPROT_UBX': True},
        {'CFG_USBOUTPROT_NMEA': False},
        {'CFG_USBOUTPROT_RTCM3X': False},
        {'CFG_USBOUTPROT_UBX': True},

        # output RTCM messages required for moving base+rover mode on UART2
        {'CFG-MSGOUT-RTCM_3X_TYPE4072_0_UART1': 0x1},
        {'CFG-MSGOUT-RTCM_3X_TYPE1074_UART1': 0x1},
        {'CFG-MSGOUT-RTCM_3X_TYPE1084_UART1': 0x1},
        {'CFG-MSGOUT-RTCM_3X_TYPE1124_UART1': 0x1},
        {'CFG-MSGOUT-RTCM_3X_TYPE1230_UART1': 0x1},

        # messages required for navsatfix calcs by ROS node
        {'CFG_MSGOUT_UBX_NAV_HPPOSLLH_USB': 0x1},
        {'CFG_MSGOUT_UBX_NAV_COV_USB': 0x1},
        {'CFG_MSGOUT_UBX_NAV_STATUS_USB': 0x1},
        {'CFG_MSGOUT_UBX_NAV_PVT_USB': 0x1},            
        ]

For the Rover UBLOX U-Center app,:

    PRT: UART2, 57600Kbaud, RCTM3 in, UBX out…press send
    CFG: Save current configuration to FLASH…press send

For the Rover:

        params_rover = [
        {'DEVICE_SERIAL_STRING': "revor"},
        {'FRAME_ID': "rover"},

        # config measurement interval to 200 ms (ie 5 Hz) and nav update rate to once per measurement
        {'CFG_RATE_MEAS': 0xc8},
        {'CFG_RATE_NAV': 0x1},

        # disable all messages on UART1
        {'CFG_UART1INPROT_NMEA': False},
        {'CFG_UART1INPROT_RTCM3X': False},
        {'CFG_UART1INPROT_UBX': False},
        {'CFG_UART1OUTPROT_NMEA': False},
        {'CFG_UART1OUTPROT_RTCM3X': False},
        {'CFG_UART1OUTPROT_UBX': False},

        # set UART2 baud rate to 57600
        {'CFG-UART2-BAUDRATE': 0xE100},

        # receive RTCM messages only (from base) on UART2
        {'CFG_UART2INPROT_NMEA': False},
        {'CFG_UART2INPROT_RTCM3X': True},
        {'CFG_UART2INPROT_UBX': False},
        {'CFG_UART2OUTPROT_NMEA': False},
        {'CFG_UART2OUTPROT_RTCM3X': False},
        {'CFG_UART2OUTPROT_UBX': False},

        # send/receive UBX messages only on USB
        {'CFG_USBINPROT_NMEA': False},
        {'CFG_USBINPROT_RTCM3X': False},
        {'CFG_USBINPROT_UBX': True},
        {'CFG_USBOUTPROT_NMEA': False},
        {'CFG_USBOUTPROT_RTCM3X': False},
        {'CFG_USBOUTPROT_UBX': True},

        # messages required for navsatfix calcs by ROS node
        {'CFG_MSGOUT_UBX_NAV_HPPOSLLH_USB': 0x1},
        {'CFG_MSGOUT_UBX_NAV_COV_USB': 0x1},
        {'CFG_MSGOUT_UBX_NAV_STATUS_USB': 0x1},
        {'CFG_MSGOUT_UBX_NAV_PVT_USB': 0x1},

        # output relative position messages
        {'CFG_MSGOUT_UBX_NAV_RELPOSNED_USB': 0x1},
        ]

However, I can not see the base and rover communicating. Is there a way to debug?

From Base ros2 topic echo /base/ubx_nav_status:

       header:
      stamp:
        sec: 1708617982
        nanosec: 466416165
      frame_id: base
    itow: 403600400
    gps_fix:
      fix_type: 3
    gps_fix_ok: true
    diff_soln: false
    wkn_set: true
    tow_set: true
    diff_corr: false
    carr_soln_valid: true
    map_matching:
      status: 0
    psm:
      state: 0
    spoof_det:
      state: 2
    carr_soln:
      status: 0
    ttff: 12622
    msss: 4355423

From Rover ros2 topic echo /rover/ubx_nav_status:

  header:
    stamp:
      sec: 1708617868
      nanosec: 285342624
    frame_id: rover
  itow: 403486200
  gps_fix:
    fix_type: 3
  gps_fix_ok: true
  diff_soln: false
  wkn_set: true
  tow_set: true
  diff_corr: false
  carr_soln_valid: true
  map_matching:
    status: 0
  psm:
    state: 0
  spoof_det:
    state: 2
  carr_soln:
    status: 0
  ttff: 4549
  msss: 4392950
gsokoll commented 6 months ago

A few suggestions.

  1. Have you set the device serial strings for both base and rover devices using u-center first?

  2. There appears to be a typo in the device serial string specified for the rover. Is this intentional? params_rover = [ {'DEVICE_SERIAL_STRING': "revor"},

  3. The Holybro setup you refer to is for a fixed base, moving rover config. The launch files you have above are for a moving base + rover config which is very different. What setup do you actually have?

  4. In a moving base+rover config, the only communications between the two devices are RTCM messages sent from the moving base to the rover via UART or USB. You will not see these as ROS topics.

  5. When you launch the ublox_dgnss node, do you see any ROS warnings, errors or other messages which might provide guidance on the issues you're having?

GPrathap commented 6 months ago

Hi @gsokoll ,

  1. Yes, I've set them revor and esab, actually I wanted to set rover and base, but when I converted them to hex I got these. However, when I checked with serial numbers these strings are correct.

  2. Nope, that is correct.

  3. I want to have a moving base, however, communication between the base and rover should be over telemetry; UART1 for the base and UART2 for the rover. I have disabled UART2 from the base and UART1 from the rover. Also, set input and output accordingly. Can I know which part is wrong in the above configs?

  4. Nope, both start fine, and it gives the correct lat lon coordinates as well over fix topic

GPrathap commented 6 months ago

In the Rover node, I can see these warning messages:

[component_container_mt-1] [WARN] [1708680541.414113402] [gps.ublox_dgnss]: parameter supplied: CFG_UART2INPROT_NMEA is not recognised. Ignoring!
[component_container_mt-1] [INFO] [1708680541.414120559] [gps.ublox_dgnss]: parameter supplied: CFG_UART2INPROT_RTCM3X
[component_container_mt-1] [WARN] [1708680541.414128636] [gps.ublox_dgnss]: parameter supplied: CFG_UART2INPROT_RTCM3X is not recognised. Ignoring!
[component_container_mt-1] [INFO] [1708680541.414135467] [gps.ublox_dgnss]: parameter supplied: CFG_UART2INPROT_UBX
[component_container_mt-1] [WARN] [1708680541.414143351] [gps.ublox_dgnss]: parameter supplied: CFG_UART2INPROT_UBX is not recognised. Ignoring!
[component_container_mt-1] [INFO] [1708680541.414149512] [gps.ublox_dgnss]: parameter supplied: CFG_UART2OUTPROT_NMEA
[component_container_mt-1] [WARN] [1708680541.414157356] [gps.ublox_dgnss]: parameter supplied: CFG_UART2OUTPROT_NMEA is not recognised. Ignoring!
[component_container_mt-1] [INFO] [1708680541.414163287] [gps.ublox_dgnss]: parameter supplied: CFG_UART2OUTPROT_RTCM3X
[component_container_mt-1] [WARN] [1708680541.414173721] [gps.ublox_dgnss]: parameter supplied: CFG_UART2OUTPROT_RTCM3X is not recognised. Ignoring!
[component_container_mt-1] [INFO] [1708680541.414180205] [gps.ublox_dgnss]: parameter supplied: CFG_UART2OUTPROT_UBX
[component_container_mt-1] [WARN] [1708680541.414188224] [gps.ublox_dgnss]: parameter supplied: CFG_UART2OUTPROT_UBX is not recognised. Ignoring!

After looking into code https://github.com/aussierobots/ublox_dgnss/blob/main/ublox_dgnss_node/include/ublox_dgnss_node/ubx/ubx_cfg_item.hpp#L128, CFG_UART2 are not defined?

hortovanyi commented 6 months ago

@GPrathap believe @gsokoll is going to update the read me. Can you please set those parameters coming up with a warning in u-center (saved to flash). Not all the parameters listed are in the published cfg_item.hpp file as yet. There are so many parameters for the device we need to maybe refactor how we tackle this moving forward... so the work around is to set them via u-center in flash memory. Once set they dont need to change - hence can comment out in the launch file to

GPrathap commented 6 months ago

Thank youu, I will update them using U-center and update here

hortovanyi commented 6 months ago

Thank you ... part of the reason to turn some messages off or change frequency is to reduce the load on the F9P processor. It's limited the amount of work it can do.

GPrathap commented 6 months ago

Hi @hortovanyi , @gsokoll

I've commented out this from base

        # disable all messages on UART2
        # {'CFG_UART2INPROT_NMEA': False},
        # {'CFG_UART2INPROT_RTCM3X': False},
        # {'CFG_UART2INPROT_UBX': False},
        # {'CFG_UART2OUTPROT_NMEA': False},
        # {'CFG_UART2OUTPROT_RTCM3X': False},
        # {'CFG_UART2OUTPROT_UBX': False},

        # set UART1 baud rate to 57600
        # {'CFG-UART1-BAUDRATE': 0xE100},

        # send RTCM messages only (to rover) on UART1
        # {'CFG_UART1INPROT_NMEA': False},
        # {'CFG_UART1INPROT_RTCM3X': False},
        # {'CFG_UART1INPROT_UBX': False},
        # {'CFG_UART1OUTPROT_NMEA': False},
        # {'CFG_UART1OUTPROT_RTCM3X': True},
        # {'CFG_UART1OUTPROT_UBX': False},

And I've commented out this from rover

        # # disable all messages on UART1
        # {'CFG_UART1INPROT_NMEA': False},
        # {'CFG_UART1INPROT_RTCM3X': False},
        # {'CFG_UART1INPROT_UBX': False},
        # {'CFG_UART1OUTPROT_NMEA': False},
        # {'CFG_UART1OUTPROT_RTCM3X': False},
        # {'CFG_UART1OUTPROT_UBX': False},

        # set UART2 baud rate to 57600
        # {'CFG-UART2-BAUDRATE': 0xE100},

        # # receive RTCM messages only (from base) on UART2
        # {'CFG_UART2INPROT_NMEA': False},
        # {'CFG_UART2INPROT_RTCM3X': True},
        # {'CFG_UART2INPROT_UBX': False},
        # {'CFG_UART2OUTPROT_NMEA': False},
        # {'CFG_UART2OUTPROT_RTCM3X': False},
        # {'CFG_UART2OUTPROT_UBX': False},

However, this is what I've noticed. Config for rover using U-center

Screenshot 2024-02-23 111503

Then I run the rover (https://github.com/aussierobots/ublox_dgnss/blob/main/ublox_dgnss/launch/ublox_mb%2Br_rover.launch.py),

After that I plug back to

Screenshot 2024-02-23 114532

U-Center and check its values

For base it is fine, nothing has overwritten. Is this a bug or If I configure rover also using UART1 will it be fine?

Thanks, Geesara

hortovanyi commented 6 months ago

@GPrathap it will depend how you have physically wired your devices up. If the CFG items are in ubx_cfg_item.hpp such as CFG_UART1* then its ok to set them in the launch file..... I myself dont have two F9Ps so to configure it need to make sure you are following whats in the UBLOX documentation

gsokoll commented 5 months ago

@GPrathap as already mentioned by @hortovanyi, the example launch files for moving base+rover config include many configuration items which the ublox_dgnss driver currently does not support. This was an oversight and will be fixed shortly. You should configure these directly using u-center. You may need to use the "Generation 9 configuration view" to set some of these.

But there still seems to be a conflict in what you're trying to achieve. You stated above that you want to use a moving base + rover, however your base is stationary. "Moving base" means the base station is physically attached and moves with the rover. It is only used in order to provide heading data. Sections 3.1.5.5 and 3.1.5.6 of the F9P integration manual describes these, and notes the different RTCM messages that should be used for each.

GPrathap commented 5 months ago

@hortovanyi @gsokoll Thank you very much! I will try to configure with the Generation 9 configuration view

Sure, I will check the section Sections 3.1.5.5 and 3.1.5.6

However, in the first place, I want to verify whether communication happens between two modules over telemetry using URAT1 or UART2. What could be a possible way to verify that first place?

noob3-3 commented 5 months ago

How to configure device sequence strings that are entered Is the Generation 9 configuration view configured in CFG-USB?

GPrathap commented 5 months ago

@noob3-3 you need to use UBX-CFG-VALSET , CFG-USB is read only Have a look here: https://portal.u-blox.com/s/question/0D52p0000C7vMxjCQE/neom9n-change-usb-serial-number

noob3-3 commented 5 months ago

Thanks to the big boss, the configuration is ready, my revor and base are started normally. Go outside and test it tomorrow. My base station's RTCM can also be released to ros. But which topic gets accurate positioning information and heading Angle? There is also how far away the antennas of the two cars need to be, and the distance value of the antenna does not need to be set to the program?

gsokoll commented 5 months ago

You should output UBX_NAV_HPPOSLLH, UBX_NAV_COV, UBX_NAV_STATUS, UBX_NAV_PVT messages to get navsatfix ROS2 messages. Can be from either (or both) the base and/or rover. See comments about "ROS2 NAVSATFIX Messages" in the readme file.

The UBX-NAV-RELPOSNED messages from the rover provides information on calculated heading and distance between the two antenna. You can compare it against the known physical seperation as an indication of a valid solution. See section 2.4 of the ZED-F9P Moving base app note, and comments about "Moving Base and Rover" in the readme.

hortovanyi commented 5 months ago

Thanks to the big boss, the configuration is ready, my revor and base are started normally. Go outside and test it tomorrow. My base station's RTCM can also be released to ros. But which topic gets accurate positioning information and heading Angle? There is also how far away the antennas of the two cars need to be, and the distance value of the antenna does not need to be set to the program?

How did you go @noob3-3 ? interested if you got it all working?

Wenz922 commented 4 months ago

Ich have the same setup with @GPrathap. But i have this error as follow in launch ublox_mb+r_base.launch.py and launch ublox_mb+r_rover.launch.py: [component_container_mt-1] [INFO] [1712663771.887662106] [base.ublox_dgnss]: parameter set CFG_MSGOUT_UBX_NAV_TIMEUTC_USB: 0 [component_container_mt-1] [INFO] [1712663771.887741712] [base.ublox_dgnss]: parameter set CFG_MSGOUT_UBX_NAV_CLOCK_USB: 0 [component_container_mt-1] [WARN] [1712663771.905647031] [base.ublox_dgnss]: ubx class: 0x05 id: 0x00 ack nak payload - class: 0x06 id: 0x8b [component_container_mt-1] [WARN] [1712663771.915586455] [base.ublox_dgnss]: ubx class: 0x05 id: 0x00 ack nak payload - class: 0x06 id: 0x8b [component_container_mt-1] [WARN] [1712663771.925602462] [base.ublox_dgnss]: ubx class: 0x05 id: 0x00 ack nak payload - class: 0x06 id: 0x8b [component_container_mt-1] [WARN] [1712663771.935824700] [base.ublox_dgnss]: ubx class: 0x05 id: 0x00 ack nak payload - class: 0x06 id: 0x8b But if i only run ublox_dgnss_node, it works and all parameters show as normal.

My setup:

  1. DEVICE_SERIAL_STRING for "Base" and "Rover" are all corrected. (check in command with lsusb -v)
  2. base: UART1 connects telemetry (send RTCM3), UART2 with power supply, USB-C connects PC rover: UART1 connects with power supply, UART2 with telemetry (receiver RTCM3), USB-C connects PC
  3. I have set up firstly in u-center PRT and MSG for base and rover all corerctly Is there someone, who can explain this situation to me? Thanks a lot in advance!
iman01 commented 4 months ago

Maybe a SOLUTION: If there is problem with UART communication between moving base and rover, although the set up is in a way that moving base is sending RTCM to rover and I expected to have the cabling like Tx (Moving Base) -> Rx (Rover)! But supersize supersize! Connect Rx of moving base to Tx of rover, in my case this worked and not otherwise! Specifically, I am using two Ardusimple F9P 2B, you can connect Tx and Rx of zigbee headers via a wire, which is considered as UART2 of Ublox. if corrections are being send from moving base, the "GPS>XBEE" led should blink and if corrections are being received via rover, "XBEE>GPS" led should blink. Beside configuring the UART-in in u-center for sending and receiving RTCM3 , you have to enable below msgs for UART2: RTCM 4072.0 RTCM 1077 RTCM 1087 RTCM 1097 RTCM 1127 RTCM 1230 Comment out uart2 configuration parameters in launch files.

noob3-3 commented 4 months ago

感谢大佬,配置已经准备好了,我的revor和base都正常启动了。明天出去测试一下。我的基站的RTCM也可以发布到ros。但哪个主题能够获得准确的定位信息和航向角度呢?还有就是两辆车的天线需要距离多远,天线的距离值不需要给程序设置?

你是怎么去的@noob3-3?如果你一切正常的话有兴趣吗?

Having recently been delayed by other matters, I was finally able to obtain positioning and heading data using F9P, but not through this project, but using other python libraries to implement the functionality on their own. Because I am not familiar with c++, I cannot troubleshoot code problems. After the completion of the work in hand, I still want to continue to learn this project, and I feel that the implementation of this project is relatively elegant.

noob3-3 commented 4 months ago

It should be noted that there are some differences between the fixed base station sending rtm to the mobile base station and the mobile base station sending rtcm to the mobile mobile station. My use of this project failed because part of automatic configuration failed, so I think it is possible to add a flag bit to determine whether code automatic configuration or user manual configuration, and provide u-center configuration file, so that users can try manual configuration when the program configuration is wrong