Skip to content

Commit

Permalink
map char to uint8_t
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Nov 26, 2018
1 parent d6b3f7b commit b0623a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions rosidl_generator_py/resource/_msg_support.c.em
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,13 @@ lowercase_field_type = convert_camel_case_to_lower_case_underscore(field.type.ty
return false;
}
@[ else]@
if (!rosidl_generator_c__@(field.type.type)__Sequence__init(&(ros_message->@(field.name)), size)) {
PyErr_SetString(PyExc_RuntimeError, "unable to create @(field.type.type)__Sequence ros_message");
@{
type_ = field.type.type
if type_ == 'char':
type_ = 'uint8'
}@
if (!rosidl_generator_c__@(type_)__Sequence__init(&(ros_message->@(field.name)), size)) {
PyErr_SetString(PyExc_RuntimeError, "unable to create @(type_)__Sequence ros_message");
Py_DECREF(seq_field);
Py_DECREF(field);
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def _primitive_msg_type_to_c(type_):
msg_type_to_c = {
'bool': 'bool',
'byte': 'uint8_t',
'char': 'signed char',
'char': 'uint8_t',
'float32': 'float',
'float64': 'double',
'uint8': 'uint8_t',
Expand Down

0 comments on commit b0623a2

Please sign in to comment.