Error msg parse and checksum
adamkrawczyk opened this issue · 3 comments
adamkrawczyk commented
Hi, I run into a problem with nmea_socket_driver with the remote device sending data over UDP.
ROS Noetic
Ubuntu 20.04
First:
Exception happened during processing of request from ('10.15.20.1', 44265)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 720, in __init__
self.handle()
File "/opt/ros/noetic/lib/python3/dist-packages/libnmea_navsat_driver/nodes/nmea_socket_driver.py", line 58, in handle
self.server.driver.add_sentence(line, self.server.frame_id)
File "/opt/ros/noetic/lib/python3/dist-packages/libnmea_navsat_driver/driver.py", line 163, in add_sentence
if not check_nmea_checksum(nmea_string):
File "/opt/ros/noetic/lib/python3/dist-packages/libnmea_navsat_driver/checksum_utils.py", line 44, in check_nmea_checksum
split_sentence = nmea_sentence.split('*')
TypeError: a bytes-like object is required, not 'str'
Second:
Exception happened during processing of request from ('10.15.20.1', 50240)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 720, in __init__
self.handle()
File "/opt/ros/noetic/lib/python3/dist-packages/libnmea_navsat_driver/nodes/nmea_socket_driver.py", line 58, in handle
self.server.driver.add_sentence(line, self.server.frame_id)
File "/opt/ros/noetic/lib/python3/dist-packages/libnmea_navsat_driver/driver.py", line 168, in add_sentence
parsed_sentence = libnmea_navsat_driver.parser.parse_nmea_sentence(
File "/opt/ros/noetic/lib/python3/dist-packages/libnmea_navsat_driver/parser.py", line 284, in parse_nmea_sentence
if not re.match(
File "/usr/lib/python3.8/re.py", line 191, in match
return _compile(pattern, flags).match(string)
TypeError: cannot use a string pattern on a bytes-like object
I made a solution but not sure whether it's appropriate and work with any case could you check this?
Best,
Adam
adamkrawczyk commented
PR made at #121
evenator commented
adamkrawczyk commented
This solves the issues. Thank you 🥇