Ros package error:

Hey there, I’m trying to use ros package (GitHub - rpng/reach_ros_node: ROS driver for the Reach RTK GNSS module by Emlid) to receive the data in real time, but when I run the ros code, I got this error message
[INFO] [1656898801.067970]: Connecting to Reach RTK 192.168.42.1 on port 9001
[INFO] [1656898801.073358]: Successfully connected to device, starting publishing!
Traceback (most recent call last):
File “/home/iasl/ZMJ_ws/src/reach_ros_node/scripts/nmea_tcp_driver”, line 142, in
device.start()
File “/home/iasl/ZMJ_ws/src/reach_ros_node/scripts/nmea_tcp_driver”, line 62, in start
data = self.buffered_readLine().strip()
File “/home/iasl/ZMJ_ws/src/reach_ros_node/scripts/nmea_tcp_driver”, line 125, in buffered_readLine
line += part
TypeError: can only concatenate str (not “bytes”) to str

It seems I have successfully connected to the RTK, but I can only receive the data in bytes form, can anyone helps?

Hey,

The error message tells that the operation line += part fails because it tries to concatenate bytes instead of strings.
That means part variable should be converted to string before being concatenated in the line variable. This is doable at line 113 by editing
part = self.soc.recv(1)
into
part = self.soc.recv(1).decode()

I cannot test this however, I cannot guarantee that will work.

2 Likes

Thank you for your reply!!

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.