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

Update rosidl_generator_java for Dashing compatibility #66

Merged
merged 14 commits into from
Jan 10, 2020

Conversation

jacobperron
Copy link
Contributor

These changes enable compiling rosidl_generator_java (and other interfaces packages like test_msgs) for Dashing.

Changes include:

  • Switch to new IDL-based pipeline
  • Wide string support
  • Actions support
  • Fixes related to integer literals

I plan to follow-up these changes with updates to rcljava, so that it too will compile for Dashing.

@esteve This is the first of several updates I plan to make related ROS 2 Java support.
Let me know if you'd like to continue to host the primary repository or if you think it would be better to move this to the ros2 organization.
I can assist in maintenance in either case.

Supporting ROS Dashing or later.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Accidentally broken during update.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
This remove some compile warnings.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Though Java supports unsigned values, it doesn't support unsigned literals (ie. literals that are larger than the max signed value).
As a workaround, we can convert the literal to it's negative equivalent.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Otherwise the compiler complains about potential loss of data.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@esteve esteve self-requested a review September 26, 2019 11:15
Copy link
Contributor Author

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving myself some comments so I don't forget.

<test_depend>rosidl_cmake</test_depend>
<test_depend>rosidl_parser</test_depend>
<!-- Duplicated from rosidl_default_generator in order to avoid a circular dependency. -->
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most (if not all) of the rosidl dependencies below can be removed. I'll give it a try.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacobperron were you able to remove the rest of the dependencies? Does it still work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't seem to work. Needs more investigation, but leaving these dependencies here for now is okay.

rosidl_generator_java/resource/action.cpp.em Outdated Show resolved Hide resolved
rosidl_generator_java/resource/msg.cpp.em Outdated Show resolved Hide resolved
rosidl_generator_java/CMakeLists.txt Show resolved Hide resolved
@esteve
Copy link
Member

esteve commented Oct 1, 2019

@jacobperron thank you so much for your PR! I'm thinking of creating a dashing branch so that all the PRs can go in there and then merge the big one into master. What do you think? I'll review your changes shortly, give me a couple of days. Thanks!

@jacobperron
Copy link
Contributor Author

Yeah, a dashing branch makes sense if you want to review/merge my Dashing updates separately without breaking master 👍

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@esteve esteve changed the base branch from master to dashing October 3, 2019 09:22
@esteve
Copy link
Member

esteve commented Oct 3, 2019

@jacobperron I've created the dashing branch and changed the base for this pull request.

@@ -0,0 +1,18 @@
/* Copyright 2019 Open Source Robotics Foundation, Inc.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be ok with OSRF if the copyright notice is the same as the rest of the files?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this specific file it should no problem to use the same copyright notice since the actual code snippet is minimal / trivial. In other case where the contributions is significant I think the copyright notice should reflect the entity providing it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In rviz we would also have multiple copyright claims when there were large changes, e.g.:

https://github.com/ros2/rviz/blob/5595a69398df4d93aea711d408772ea34c53c230/rviz_common/include/rviz_common/factory/factory.hpp#L2-L4

@esteve
Copy link
Member

esteve commented Dec 4, 2019

@jacobperron sorry for the slow response, just a couple of comments but overall looks great. Thanks!

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron
Copy link
Contributor Author

@esteve Friendly ping. I think I've answered your comments.

Let me know if you'd like me to change the copyright line for the small file(s); but I think it makes sense to include copyright lines for authors who make significant contributions.

@jacobperron
Copy link
Contributor Author

@esteve I have more changes ready to be reviewed, bringing rcljava up-to-date with Dashing and Eloquent. I'd prefer to get this PR merged before opening others that build on top of this (including enabling CI).

I can probably recruit additional maintainers to help with reviews to lessen the burden.

@esteve
Copy link
Member

esteve commented Jan 10, 2020

@jacobperron oops, I missed the latest changes. LGTM

@esteve esteve merged commit 6247167 into ros2-java:dashing Jan 10, 2020
@jacobperron jacobperron deleted the dashing branch January 15, 2020 00:01
jacobperron added a commit that referenced this pull request Jan 21, 2020
* Update rosidl_generator_java for new IDL pipeline

Supporting ROS Dashing or later.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Fix name JNI name mangling

Accidentally broken during update.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove java compile flags

This remove some compile warnings.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Refactor to support services

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Wide string support

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Avoid duplicate includes

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Use test_interface_files

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Support for actions

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Add suffix for long literals

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Handle unsigned literals

Though Java supports unsigned values, it doesn't support unsigned literals (ie. literals that are larger than the max signed value).
As a workaround, we can convert the literal to it's negative equivalent.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Fix escape string function

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Use cast to workaround integer literals

Otherwise the compiler complains about potential loss of data.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Minor refactor

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove TODO

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
This was referenced Jan 29, 2020
@jacobperron jacobperron mentioned this pull request Oct 7, 2020
4 tasks
jacobperron added a commit that referenced this pull request May 17, 2021
* Update rosidl_generator_java for new IDL pipeline

Supporting ROS Dashing or later.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Fix name JNI name mangling

Accidentally broken during update.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove java compile flags

This remove some compile warnings.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Refactor to support services

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Wide string support

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Avoid duplicate includes

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Use test_interface_files

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Support for actions

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Add suffix for long literals

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Handle unsigned literals

Though Java supports unsigned values, it doesn't support unsigned literals (ie. literals that are larger than the max signed value).
As a workaround, we can convert the literal to it's negative equivalent.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Fix escape string function

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Use cast to workaround integer literals

Otherwise the compiler complains about potential loss of data.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Minor refactor

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove TODO

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
jacobperron added a commit that referenced this pull request May 17, 2021
* Update rosidl_generator_java for new IDL pipeline

Supporting ROS Dashing or later.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Fix name JNI name mangling

Accidentally broken during update.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove java compile flags

This remove some compile warnings.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Refactor to support services

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Wide string support

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Avoid duplicate includes

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Use test_interface_files

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Support for actions

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Add suffix for long literals

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Handle unsigned literals

Though Java supports unsigned values, it doesn't support unsigned literals (ie. literals that are larger than the max signed value).
As a workaround, we can convert the literal to it's negative equivalent.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Fix escape string function

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Use cast to workaround integer literals

Otherwise the compiler complains about potential loss of data.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Minor refactor

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove TODO

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
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

Successfully merging this pull request may close these issues.

4 participants