Skip to content

Comments

Use dsv file templates for environment setup#99

Closed
jacobperron wants to merge 16 commits intomasterfrom
jacob/dsv
Closed

Use dsv file templates for environment setup#99
jacobperron wants to merge 16 commits intomasterfrom
jacob/dsv

Conversation

@jacobperron
Copy link
Contributor

Take advantage of newer DSV file-based environment setup, as of ROS 2 Dashing.

Depends on ros2-java/ament_java#10

jacobperron and others added 10 commits January 21, 2020 09:15
* Update rosidl_generator_java for new IDL pipeline

Supporting ROS Dashing or later.

Signed-off-by: Jacob Perron <[email protected]>

* Fix name JNI name mangling

Accidentally broken during update.

Signed-off-by: Jacob Perron <[email protected]>

* Remove java compile flags

This remove some compile warnings.

Signed-off-by: Jacob Perron <[email protected]>

* Refactor to support services

Signed-off-by: Jacob Perron <[email protected]>

* Wide string support

Signed-off-by: Jacob Perron <[email protected]>

* Avoid duplicate includes

Signed-off-by: Jacob Perron <[email protected]>

* Use test_interface_files

Signed-off-by: Jacob Perron <[email protected]>

* Support for actions

Signed-off-by: Jacob Perron <[email protected]>

* Add suffix for long literals

Signed-off-by: Jacob Perron <[email protected]>

* 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 <[email protected]>

* Fix escape string function

Signed-off-by: Jacob Perron <[email protected]>

* Use cast to workaround integer literals

Otherwise the compiler complains about potential loss of data.

Signed-off-by: Jacob Perron <[email protected]>

* Minor refactor

Signed-off-by: Jacob Perron <[email protected]>

* Remove TODO

Signed-off-by: Jacob Perron <[email protected]>
* Update API for getting rcl error string

Signed-off-by: Jacob Perron <[email protected]>

* Add implementation for ROS Context

A context represents an init/shutdown cycle and is used in the creation of top level entities
like nodes and guard conditions.

For convenience, a default context is created when rcljava is initialized.

Signed-off-by: Jacob Perron <[email protected]>

* Add implementation for Clock

Signed-off-by: Jacob Perron <[email protected]>

* Update for Dashing support

* Update wait set API calls
* Update entity creation API calls
* Use Context objects to check 'ok()' status
* Add Clock and Context members to NodeImpl
* Fix static member reference: 'this.defaultContext' -> 'RCLJava.defaultContext'

Signed-off-by: Jacob Perron <[email protected]>

* Avoid hiding errors when cleaning up init options

Signed-off-by: Jacob Perron <[email protected]>

* Disable tests

Signed-off-by: Jacob Perron <[email protected]>

* Fix typos in JNI library files

Signed-off-by: Jacob Perron <[email protected]>

* Fix native node method signature

Signed-off-by: Jacob Perron <[email protected]>

* Populate missing QoS settings with defaults

Otherwise we run into a runtime error about Fast-RTPS not supporting liveliness.

Signed-off-by: Jacob Perron <[email protected]>

* Fix issues with Clock class

* Load with JNIUtils
* Rename native create method for consistency
* Fix bug in native implementation

Signed-off-by: Jacob Perron <[email protected]>

* Enable linter tests

Signed-off-by: Jacob Perron <[email protected]>

* Fix lint errors

Signed-off-by: Jacob Perron <[email protected]>

* Enable RCLJava test and fix bugs

* Use Context.ok() and deprecate RCLJava.isInitialized().
* Move implementation loading to static initialization code.
  Otherwise, calls to getDefaultContext() fail if called before rclJavaInit().
  It wasn't clear to me why the implementation should be loaded in a separate function call.
  We can probably refactor the code to avoid the error if we want to move the loading back
  into rclJavaInit().
* Refactor test into one init/shutdown test. Previously, not calling RCLJava.shutdown()
  was leaving a context around between tests.

Signed-off-by: Jacob Perron <[email protected]>

* Fix NodeTest

Signed-off-by: Jacob Perron <[email protected]>

* Enable most tests

Tests that involve services are broken due to issues related to interface generation.
There's a separate PR for a fix: #76.

Signed-off-by: Jacob Perron <[email protected]>
* Update rosidl_generator_java tests

Now using messages from test_interface_files.

Signed-off-by: Jacob Perron <[email protected]>

* Remove old interface files

Signed-off-by: Jacob Perron <[email protected]>
The package does not exist.

Signed-off-by: Jacob Perron <[email protected]>
This fixes some fatal runtime errors during testing.

Signed-off-by: Jacob Perron <[email protected]>
* Fix service and action interface generation

Before, we were not generating code for the messages and services that make up service and action
interfaces.

Due to issues with duplicate definitions caused by instantiating the msg.cpp.em template
multiple times, I've opted to generate separate files for each service, action, and the interfaces
that they are made of. This is similar to what we are doing with the generated Java code.

I've added a test confirming that generated service code can be used. Adding a test for actions is
difficult at the moment due to a circular dependency with action_msgs.

Signed-off-by: Jacob Perron <[email protected]>

* Add missing header include

Signed-off-by: Jacob Perron <[email protected]>

* Rename top level generated cpp file

This avoids name clashing with other generated files. Similar to what we do with generated Java files.

Signed-off-by: Jacob Perron <[email protected]>

* Fix JNI name mangling function so it works for service and action subtypes

For example, 'example_interfaces/srv/AddTwoInts_Request' should be mangled to 'example_1interfaces_srv_AddTwoInts_1Request'.

Signed-off-by: Jacob Perron <[email protected]>

* Remove vestigal references to jni_package_name

Signed-off-by: Jacob Perron <[email protected]>

* Add comment about action and service headers

Signed-off-by: Jacob Perron <[email protected]>

* Simplify include logic

Signed-off-by: Jacob Perron <[email protected]>
* Fix service and action interface generation

Before, we were not generating code for the messages and services that make up service and action
interfaces.

Due to issues with duplicate definitions caused by instantiating the msg.cpp.em template
multiple times, I've opted to generate separate files for each service, action, and the interfaces
that they are made of. This is similar to what we are doing with the generated Java code.

I've added a test confirming that generated service code can be used. Adding a test for actions is
difficult at the moment due to a circular dependency with action_msgs.

Signed-off-by: Jacob Perron <[email protected]>

* Add missing header include

Signed-off-by: Jacob Perron <[email protected]>

* Rename top level generated cpp file

This avoids name clashing with other generated files. Similar to what we do with generated Java files.

Signed-off-by: Jacob Perron <[email protected]>

* Fix JNI name mangling function so it works for service and action subtypes

For example, 'example_interfaces/srv/AddTwoInts_Request' should be mangled to 'example_1interfaces_srv_AddTwoInts_1Request'.

Signed-off-by: Jacob Perron <[email protected]>

* Remove vestigal references to jni_package_name

Signed-off-by: Jacob Perron <[email protected]>

* Add comment about action and service headers

Signed-off-by: Jacob Perron <[email protected]>

* Simplify include logic

Signed-off-by: Jacob Perron <[email protected]>

* Rename cpp headers to have .hpp suffix

Signed-off-by: Jacob Perron <[email protected]>

* Update files to reflect new header suffix

This resolves a cppcheck linter error complaining about "is invalid C code".
Changing the suffix causes cppcheck to treat the files as C++ code.

Signed-off-by: Jacob Perron <[email protected]>

Co-authored-by: Esteve Fernandez <[email protected]>
We don't need to build everything from source, only some of the ROS interface packages.

Signed-off-by: Jacob Perron <[email protected]>
@jacobperron jacobperron changed the title Jacob/dsv Use dsv file templates for environment setup Mar 25, 2020
* Add dashing workflow

Using the ros-tooling custom GitHub actions

Signed-off-by: Jacob Perron <[email protected]>

* Update repos file URL

Signed-off-by: Jacob Perron <[email protected]>
@jacobperron
Copy link
Contributor Author

We should hold this PR as it is only compatible with Eloquent or later.

@jacobperron jacobperron changed the base branch from dashing to master April 7, 2020 21:07
* Add example_interfaces to desktop repos file

This package is required by rcljava_examples.

Signed-off-by: Jacob Perron <[email protected]>

* Append .git to repository URLs for consistency

Signed-off-by: Jacob Perron <[email protected]>
@esteve esteve self-requested a review May 6, 2020 16:56
nielstiben and others added 4 commits May 7, 2020 13:37
* Fix README with correct branch in the instructions.

* Update README instructions repository links.

Changed the repository links from a private github account to ROS2 Organisation repositories links.

Co-authored-by: Niels Tiben <[email protected]>
…85)

* Re-enable tests related to services

Signed-off-by: Jacob Perron <[email protected]>

* Add Client methods for checking and waiting for service availability

These methods are very useful for allowing a client to wait for a service to be available before making requests.

Signed-off-by: Jacob Perron <[email protected]>

* Refactor ClientTest to avoid repeatedly sending requests

Signed-off-by: Jacob Perron <[email protected]>
* Android part pul command use the wrong reops

Signed-off-by: Jay Hou <[email protected]>
Drop use of old sh/bat templates

Signed-off-by: Jacob Perron <[email protected]>
@jacobperron
Copy link
Contributor Author

Superseded by #186

@jacobperron jacobperron deleted the jacob/dsv branch June 22, 2021 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants