Skip to content

Conversation

@jacobperron
Copy link

Depends on #52

This is a partial implementation; trying to keep the diff smaller for review.

I'll follow-up with more PRs competing the implementation.

@jacobperron jacobperron self-assigned this Nov 13, 2020
@jacobperron jacobperron changed the base branch from galactic-devel to jacob/more_action_interfaces November 16, 2020 18:35
Copy link
Collaborator

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

Partial review, I have only some minor comments up to now

Copy link
Collaborator

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

Ok, I have finally reviewed most of this ...

I still have to check the native code more closely, and I haven't still looked at the executor code and tests.

Copy link
Collaborator

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

The code looks good to me!
I don't know if there is something else pending before merging

Implementing these interfaces in the code generation template makes it easier to pass around these types in a generic way.
Note, the 'final' modifier had to be removed from generated message types in order to extend goal, result, and feedback types in action definitions.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Also make inner classes static.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Partially revert commit dd04614.

I don't think we need to aliases for the message types, but I'll add them back if they turn out to be useful.
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron jacobperron force-pushed the jacob/more_action_interfaces branch from 4924965 to f7d7f55 Compare January 20, 2021 19:06
It should return a List, since it is hashable.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
* Add new action module with classes/interfaces related to the ActionServer
* Add methods for creating and removing ActionServers from a Node
* Implement dispose method for ActionServer.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
This changeset includes the following:
  * an implementation of the goal handle for action servers
  * action server integration with the base executor
  * action server integration with ROS nodes
  * unit tests for the action server, receiving goal and cancel requests

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>
The goal request already contains a getter for the goal ID.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
…erOfEntites()' function

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Replace with 'namespace rcljava'

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>
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>
@jacobperron
Copy link
Author

@ivanpauno In addition to addressing your feedback, I've made some patches for the change from Lists to arrays (f94150b).

Base automatically changed from jacob/more_action_interfaces to galactic-devel January 20, 2021 21:02
@jacobperron jacobperron requested a review from ivanpauno January 20, 2021 21:49
Copy link
Collaborator

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

LGTM!

If there are any details missing we can figure it out when this is completed and a tutorial is written.

@jacobperron jacobperron merged commit af0ba27 into galactic-devel Jan 21, 2021
@jacobperron jacobperron deleted the jacob/action_server branch January 21, 2021 18:08
ivanpauno pushed a commit that referenced this pull request May 17, 2021
* Add interfaces for action goal, result, and feedback

Implementing these interfaces in the code generation template makes it easier to pass around these types in a generic way.
Note, the 'final' modifier had to be removed from generated message types in order to extend goal, result, and feedback types in action definitions.

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

* Add new definitions for action goal response and request

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

* Add getter for UUID to SendGoalRequest

Also make inner classes static.

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

* Add getStamp method to GoalResponseDefinition

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

* Partially revert "Add interfaces for action goal, result, and feedback"

Partially revert commit dd04614.

I don't think we need to aliases for the message types, but I'll add them back if they turn out to be useful.

* Parameterize goal request and response interfaces on action type

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

* Fix getGoalUuid implementation

It should return a List, since it is hashable.

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

* List<Byte> -> byte[]

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

* Add ActionServer skeleton

* Add new action module with classes/interfaces related to the ActionServer
* Add methods for creating and removing ActionServers from a Node
* Implement dispose method for ActionServer.

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

* Add ActionServer creation logic and unit tests

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

* Add action server logic for accepting and canceling goals

This changeset includes the following:
  * an implementation of the goal handle for action servers
  * action server integration with the base executor
  * action server integration with ROS nodes
  * unit tests for the action server, receiving goal and cancel requests

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

* cleanup

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

* more cleanup

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

* Minor refactor: move response enums into callback interfaces

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

* Remove TODO

The goal request already contains a getter for the goal ID.

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

* Fix accident

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

* Alphabetize

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

* Refactor: replace 'getNumberOf*()' JNI functions with single 'getNumberOfEntites()' function

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

* Avoid string copy

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

* Remove extern C

Replace with 'namespace rcljava'

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

* Remove unnecessary synchronization

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

* Refactor access to goalCallback

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

* typesafe request and response definitions

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

* Be more specific about template type for GoalCallback

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

* Minor refactor

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

* Make GoalHandleImpl inner class instead of static

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

* Remove synchronized from getHandle

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

* Add TODO for Waitable interface

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

* Fix style

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

* Minor refactor

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

* Add docs for createActionServer

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

* Switch from List to array

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
jacobperron added a commit to ros2-java/ros2_java that referenced this pull request May 17, 2022
* Add interfaces for action goal, result, and feedback

Implementing these interfaces in the code generation template makes it easier to pass around these types in a generic way.
Note, the 'final' modifier had to be removed from generated message types in order to extend goal, result, and feedback types in action definitions.

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

* Add new definitions for action goal response and request

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

* Add getter for UUID to SendGoalRequest

Also make inner classes static.

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

* Add getStamp method to GoalResponseDefinition

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

* Partially revert "Add interfaces for action goal, result, and feedback"

Partially revert commit dd04614.

I don't think we need to aliases for the message types, but I'll add them back if they turn out to be useful.

* Parameterize goal request and response interfaces on action type

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

* Fix getGoalUuid implementation

It should return a List, since it is hashable.

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

* List<Byte> -> byte[]

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

* Add ActionServer skeleton

* Add new action module with classes/interfaces related to the ActionServer
* Add methods for creating and removing ActionServers from a Node
* Implement dispose method for ActionServer.

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

* Add ActionServer creation logic and unit tests

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

* Add action server logic for accepting and canceling goals

This changeset includes the following:
  * an implementation of the goal handle for action servers
  * action server integration with the base executor
  * action server integration with ROS nodes
  * unit tests for the action server, receiving goal and cancel requests

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

* cleanup

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

* more cleanup

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

* Minor refactor: move response enums into callback interfaces

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

* Remove TODO

The goal request already contains a getter for the goal ID.

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

* Fix accident

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

* Alphabetize

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

* Refactor: replace 'getNumberOf*()' JNI functions with single 'getNumberOfEntites()' function

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

* Avoid string copy

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

* Remove extern C

Replace with 'namespace rcljava'

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

* Remove unnecessary synchronization

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

* Refactor access to goalCallback

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

* typesafe request and response definitions

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

* Be more specific about template type for GoalCallback

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

* Minor refactor

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

* Make GoalHandleImpl inner class instead of static

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

* Remove synchronized from getHandle

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

* Add TODO for Waitable interface

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

* Fix style

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

* Minor refactor

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

* Add docs for createActionServer

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

* Switch from List to array

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.

3 participants