Skip to content

Drop indentations in message definitions #20

Description

@ZHOUYue67

Indentations in message definitions do not play well with some of ROS tools & libraries (such as rosbag's python implementation & ros_type_introspection). ros_msg_utils in rosnodejs already generates definitions without indentations, but a lot of users will still use gennodejs.

def write_message_definition(s, msg_context, spec):
with Indent(s):
s.write('static messageDefinition() {')
with Indent(s):
s.write('// Returns full string definition for message')
definition = genmsg.compute_full_text(msg_context, spec)
lines = definition.split('\n')
s.write('return `')
for line in lines:
s.write('{}'.format(line))
s.write('`;')
s.write('}')
s.newline()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions