Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError: 'ascii' codec can't decode byte #884

Open
thuongnv94 opened this issue Oct 22, 2023 · 1 comment
Open

UnicodeDecodeError: 'ascii' codec can't decode byte #884

thuongnv94 opened this issue Oct 22, 2023 · 1 comment
Labels

Comments

@thuongnv94
Copy link

thuongnv94 commented Oct 22, 2023

I got this error when I tried to send a sensor_msgs::Image message via ros_bridge ros1 version. Has anyone met this issue?
File "/home/ubuntu/rosbridge_ws/src/rosbridge_library/src/rosbridge_library/internal/subscription_modifiers.py", line 164, in run
MessageHandler.handle_message(self, msg)
File "/home/ubuntu/rosbridge_ws/src/rosbridge_library/src/rosbridge_library/internal/subscription_modifiers.py", line 73, in handle_message
self.publish(msg)
File "/home/ubuntu/rosbridge_ws/src/rosbridge_library/src/rosbridge_library/capabilities/subscribe.py", line 148, in _publish
self.publish(message, self.fragment_size, self.compression)
File "/home/ubuntu/rosbridge_ws/src/rosbridge_library/src/rosbridge_library/capabilities/subscribe.py", line 298, in publish
outgoing_msg["msg"] = message.get_json_values()
File "/home/ubuntu/rosbridge_ws/src/rosbridge_library/src/rosbridge_library/internal/outgoing_message.py", line 25, in get_json_values
self._json_values = extract_json_values(self._message)
File "/home/ubuntu/rosbridge_ws/src/rosbridge_library/src/rosbridge_library/internal/message_conversion.py", line 124, in extract_values
return _from_inst(inst, rostype)
File "/home/ubuntu/rosbridge_ws/src/rosbridge_library/src/rosbridge_library/internal/message_conversion.py", line 159, in _from_inst
return _from_object_inst(inst, rostype)
File "/home/ubuntu/rosbridge_ws/src/rosbridge_library/src/rosbridge_library/internal/message_conversion.py", line 183, in _from_object_inst
msg[field_name] = _from_inst(field_inst, field_rostype)
File "/home/ubuntu/rosbridge_ws/src/rosbridge_library/src/rosbridge_library/internal/message_conversion.py", line 139, in _from_inst
return encoded if python2 else encoded.decode('ascii')
UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 4347: ordinal not in range(128)

@thuongnv94 thuongnv94 added the bug label Oct 22, 2023
@brean
Copy link

brean commented Jan 4, 2024

You need to provide more code, it looks like your image gets decoded as an image, so you are probably accessing it wrong.
This is probably not a bug in ROSBridge-suite but your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants