LORD-MicroStrain / ntrip_client

ROS NTRIP client
https://github.com/LORD-MicroStrain/ntrip_client
Other
55 stars 54 forks source link

Invalid NMEA sentence, sentence should have a "*" character to separate the checksum, but we could not find it #47

Closed kosmonauta144 closed 5 months ago

kosmonauta144 commented 5 months ago

I am trying to use ntrip with two Ublox ZED F9P modules connected for orientation. I use ublox configuration. Sometimes on the nmea topic I got a sentence like:

sentence: "$$'�ez��\x13c�h\b��\x0F�\x16\x16$'��\x0E�@�����\v\x0F��\x14�C���=e����\v\f�\x1E�\x7F\x0EW���\x03�0\n"

I wonder if I could set in ntrip_client fixed value for this message and ignore broken sentences when they occur, because after few times (about four) node crashes with error

[ntrip_ros.py-1] [INFO] [1712221604.050729134] [ntrip_client]: Stopping RTCM publisher
[ntrip_ros.py-1] [INFO] [1712221604.051062562] [ntrip_client]: Disconnecting NTRIP client
[ntrip_ros.py-1] [INFO] [1712221604.051627419] [ntrip_client]: Shutting down node
[ntrip_ros.py-1] Traceback (most recent call last):
[ntrip_ros.py-1]   File "/home/robot/ros2_ws/install/ntrip_client/lib/ntrip_client/ntrip_ros.py", line 207, in <module>
[ntrip_ros.py-1]     raise e
[ntrip_ros.py-1]   File "/home/robot/ros2_ws/install/ntrip_client/lib/ntrip_client/ntrip_ros.py", line 203, in <module>
[ntrip_ros.py-1]     rclpy.spin(node)
[ntrip_ros.py-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/__init__.py", line 222, in spin
[ntrip_ros.py-1]     executor.spin_once()
[ntrip_ros.py-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 739, in spin_once
[ntrip_ros.py-1]     self._spin_once_impl(timeout_sec)
[ntrip_ros.py-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 736, in _spin_once_impl
[ntrip_ros.py-1]     raise handler.exception()
[ntrip_ros.py-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py", line 239, in __call__
[ntrip_ros.py-1]     self._handler.send(None)
[ntrip_ros.py-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 437, in handler
[ntrip_ros.py-1]     await call_coroutine(entity, arg)
[ntrip_ros.py-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 362, in _execute_subscription
[ntrip_ros.py-1]     await await_or_execute(sub.callback, msg)
[ntrip_ros.py-1]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 107, in await_or_execute
[ntrip_ros.py-1]     return callback(*args)
[ntrip_ros.py-1]   File "/home/robot/ros2_ws/install/ntrip_client/lib/ntrip_client/ntrip_ros.py", line 171, in subscribe_nmea
[ntrip_ros.py-1]     self._client.send_nmea(nmea.sentence)
[ntrip_ros.py-1]   File "/home/robot/ros2_ws/install/ntrip_client/lib/python3.10/site-packages/ntrip_client/ntrip_client.py", line 219, in send_nmea
[ntrip_ros.py-1]     if not self.nmea_parser.is_valid_sentence(sentence):
[ntrip_ros.py-1]   File "/home/robot/ros2_ws/install/ntrip_client/lib/python3.10/site-packages/ntrip_client/nmea_parser.py", line 45, in is_valid_sentence
[ntrip_ros.py-1]     expected_checksum = int(expected_checksum_str, 16)
[ntrip_ros.py-1] ValueError: invalid literal for int() with base 16: '\t�� ��~�B��\n\r\n'
[ERROR] [ntrip_ros.py-1]: process has died [pid 12332, exit code 1, cmd '/home/robot/ros2_ws/install/ntrip_client/lib/ntrip_client/ntrip_ros.py --ros-args -r __node:=ntrip_client -r __ns:=/ --params-file /tmp/launch_params_ojgqtynb -r nmea:=/ublox_1/nmea -r rtcm:=/ublox_1/rtcm'].
kosmonauta144 commented 5 months ago

The problem was with ublox_driver which I use. I hardcoded the proper nmea message and send it from new node and ntrip_client works perfectly. I will close it, or please remove the issue as unrelated to the repo.