-
Notifications
You must be signed in to change notification settings - Fork 9
Add action server with logic for accepting and canceling goals #53
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
Conversation
ivanpauno
left a comment
There was a problem hiding this 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
rcljava/src/main/cpp/org_ros2_rcljava_action_ActionServerImpl.cpp
Outdated
Show resolved
Hide resolved
rcljava/src/main/cpp/org_ros2_rcljava_action_ActionServerImpl_GoalHandleImpl.cpp
Show resolved
Hide resolved
ivanpauno
left a comment
There was a problem hiding this 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.
rcljava/src/main/java/org/ros2/rcljava/action/ActionServerGoalHandle.java
Show resolved
Hide resolved
rcljava/src/main/java/org/ros2/rcljava/action/ActionServerGoalHandle.java
Show resolved
Hide resolved
rcljava/src/main/java/org/ros2/rcljava/action/ActionServerImpl.java
Outdated
Show resolved
Hide resolved
rcljava/src/main/java/org/ros2/rcljava/action/ActionServerImpl.java
Outdated
Show resolved
Hide resolved
0230bb2 to
21b194a
Compare
ivanpauno
left a comment
There was a problem hiding this 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>
4924965 to
f7d7f55
Compare
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>
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>
6fe23e6 to
f94150b
Compare
|
@ivanpauno In addition to addressing your feedback, I've made some patches for the change from Lists to arrays (f94150b). |
ivanpauno
left a comment
There was a problem hiding this 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.
* 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>
* 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>
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.