Apollo: cyber_channel echo * TypeError: cyber_PyChannelUtils_get_debugstring_by_msgtype_rawmsgdata() argument 1 must be str, not bytes

Created on 11 May 2020  ·  4Comments  ·  Source: ApolloAuto/apollo

Describe the bug
cyber_channel echo "some topic" TypeError: cyber_PyChannelUtils_get_debugstring_by_msgtype_rawmsgdata() argument 1 must be str, not bytes

To Reproduce
Steps to reproduce the behavior:

  1. start a module successfully.
  2. cyber_channel echo topic
  3. See error

Expected behavior
print message of the topic

Screenshots

Desktop (please complete the following information):

  • OS: Ubuntu 18.04
Tools Cyber

Most helpful comment

Describe the bug
cyber_channel echo "some topic" TypeError: cyber_PyChannelUtils_get_debugstring_by_msgtype_rawmsgdata() argument 1 must be str, not bytes

To Reproduce
Steps to reproduce the behavior:

1. start a module successfully.

2. cyber_channel echo topic

3. See error

Expected behavior
print message of the topic

Screenshots

Desktop (please complete the following information):

* OS: Ubuntu 18.04

Please change file /apollo/cyber/python/cyber_py3/cyber.py, line 365 to

return _CYBER.PyChannelUtils_get_debugstring_by_msgtype_rawmsgdata(str(str(msg_type)[2:-1]), rawmsgdata)

All 4 comments

Me too

Describe the bug
cyber_channel echo "some topic" TypeError: cyber_PyChannelUtils_get_debugstring_by_msgtype_rawmsgdata() argument 1 must be str, not bytes

To Reproduce
Steps to reproduce the behavior:

1. start a module successfully.

2. cyber_channel echo topic

3. See error

Expected behavior
print message of the topic

Screenshots

Desktop (please complete the following information):

* OS: Ubuntu 18.04

Please change file /apollo/cyber/python/cyber_py3/cyber.py, line 365 to

return _CYBER.PyChannelUtils_get_debugstring_by_msgtype_rawmsgdata(str(str(msg_type)[2:-1]), rawmsgdata)

Did the suggestion above help solve your issue? We will close the issue for now. If you have any additional question, please feel free to open a new issue.

Based on @hackerliang's advice, I change file /apollo/cyber/python/cyber_py3/cyber.py, line 365 to

temp_byte = _CYBER.PyChannelUtils_get_debugstring_by_msgtype_rawmsgdata(msg_type.decode('utf-8'), rawmsgdata)
return temp_byte.decode('utf-8')

which turns the bytes string into a str type and solves this problem.

Was this page helpful?
0 / 5 - 0 ratings