waterlinked / dvl-a50-ros-driver

Water Linked DVL A50 ROS driver
16 stars 31 forks source link

byte data is not converted to string before string concatenation to raw_data #14

Open matyastakacs opened 2 years ago

matyastakacs commented 2 years ago

A was not able to run this ros node because of the following error:

rosrun waterlinked_a50_ros_driver publisher.py
{
Traceback (most recent call last):
  File "/home/sparus/catkin_ws/src/dvl-a50-ros-driver/scripts/publisher.py", line 123, in <module>                       
    publisher()
  File "/home/sparus/catkin_ws/src/dvl-a50-ros-driver/scripts/publisher.py", line 61, in publisher                       
     raw_data = getData()
  File "/home/sparus/catkin_ws/src/dvl-a50-ros-driver/scripts/publisher.py", line 46, in getData                         
     raw_data = raw_data + rec
TypeError: can only concatenate str (not "bytes") to str

In the publisher python file, when a received byte is arrived it is not converted to string before concatenation (in line 45).

the original code line 45 in the publisher.py: raw_data = raw_data + rec

this line should be this: raw_data = raw_data + rec.decode()