ros2 / design

Design documentation for ROS 2.0 effort
http://design.ros2.org/
Apache License 2.0
224 stars 192 forks source link

char now maps to int in python #221

Closed mikaelarguedas closed 5 years ago

mikaelarguedas commented 5 years ago

Submitting this documentation fix to match behavior observed using the nightly archive. It may be that the code is not yet behaving like the design doc, in which case feel free to close this PR.


Additional information:

How to reproduce the issue:

>>> from test_msgs.msg import Primitives
>>> a = Primitives()
>>> a.char_value = 'a'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/ros/crystal/lib/python3.6/site-packages/test_msgs/msg/_primitives.py", line 186, in char_value
    "The 'char_value' field must of type 'int'"
AssertionError: The 'char_value' field must of type 'int'

The same code works on ROS 2 Crystal

The generated IDL file says that the field char_values is uint8 and not char:

module test_msgs {
  module msg {
    struct Primitives {
      boolean bool_value;

      octet byte_value;

      uint8 char_value;

      float float32_value;