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

Gencpp adds a newline after last line of message definition even if there is none in the proto #55

Open
peci1 opened this issue Nov 2, 2021 · 0 comments

Comments

@peci1
Copy link
Contributor

peci1 commented Nov 2, 2021

If the msg proto ends without a newline, genpy (IMO correctly) generates the message definition also without this ending newline. On the other hand, gencpp always adds a newline to the last line of definition. This results in different message definitions between gencpp- and genpy- generated files.

See yourself e.g. in geometry_msgs. Vector3 has no ending newline in the proto, and this is what genpy and gencpp generate:

gencpp: "float64 z\n"
genpy:  float64 z"""

I think the difference is caused by this line of code:

s.write('"%s\\n"\n' % (line))

The question is - can this be fixed in the already released ROS 1 versions? Or would that be an API-break? Regarding the definitions stored in e.g. rosbags, they already differ depending on whether the publisher was a rospy or roscpp one. So I guess removing or adding the ending newline doesn't actually break anything.

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

No branches or pull requests

1 participant