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

[rclcpp_action] Action client implementation #594

Merged
merged 56 commits into from
Dec 5, 2018

Conversation

hidmic
Copy link
Contributor

@hidmic hidmic commented Nov 28, 2018

This pull requests adds the first rclcpp implementation of an action client.

@hidmic hidmic added the in progress Actively being worked on (Kanban column) label Nov 28, 2018
@sloretz sloretz added this to the crystal milestone Dec 1, 2018
@sloretz sloretz force-pushed the sservulo_hidmic/rclcpp_action_client branch from 45830b8 to 78be46f Compare December 1, 2018 16:58
@hidmic hidmic changed the title Action client implementation [rclcpp_action] Action client implementation Dec 3, 2018
@hidmic hidmic self-assigned this Dec 3, 2018
Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

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

LGTM with green CI.

I think it could use a little more documentation around the client goal handle, but that can be improved in a second pass.

@sloretz
Copy link
Contributor

sloretz commented Dec 5, 2018

CI

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Copy link
Member

@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.

LGTM 👍 🎉

return info_.stamp;
}


Copy link
Member

Choose a reason for hiding this comment

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

excess space

Copy link
Contributor

Choose a reason for hiding this comment

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

return;
}
std::lock_guard<std::mutex> guard(handle_mutex_);
if (feedback_callback_ == nullptr) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (feedback_callback_ == nullptr) {
if (nullptr == feedback_callback_) {

Copy link
Contributor

Choose a reason for hiding this comment

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


ASSERT_EQ(2ul, cancel_response->goals_canceling.size());
EXPECT_EQ(goal_handle0->get_goal_id(), cancel_response->goals_canceling[0].goal_id.uuid);
EXPECT_EQ(goal_handle1->get_goal_id(), cancel_response->goals_canceling[1].goal_id.uuid);
Copy link
Member

Choose a reason for hiding this comment

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

Also:

  EXPECT_EQ(rclcpp_action::GoalStatus::STATUS_CANCELED, goal_handle0->get_status());
  EXPECT_EQ(rclcpp_action::GoalStatus::STATUS_CANCELED, goal_handle1->get_status());

Copy link
Contributor

Choose a reason for hiding this comment

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

auto goal_handle1 = future_goal_handle1.get();

if (goal_handle1->get_goal_id() < goal_handle0->get_goal_id()) {
goal_handle0.swap(goal_handle1);
Copy link
Member

Choose a reason for hiding this comment

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

To clarify, is this just so we can know the order when checking UUIDs below (L395) ?

@sloretz
Copy link
Contributor

sloretz commented Dec 5, 2018

Windows attempt #2 Build Status

@sloretz
Copy link
Contributor

sloretz commented Dec 5, 2018

Windows attempt 3
Build Status

@sloretz
Copy link
Contributor

sloretz commented Dec 5, 2018

Windows attempt 4Build Status

@sloretz
Copy link
Contributor

sloretz commented Dec 5, 2018

Windows CI passed, running CI again on the other three.

  • Linux Build Status
  • aarch64 Build Status
  • macOS Build Status

@sloretz sloretz merged commit 9116739 into master Dec 5, 2018
@sloretz sloretz deleted the sservulo_hidmic/rclcpp_action_client branch December 5, 2018 22:51
@sloretz sloretz removed the in progress Actively being worked on (Kanban column) label Dec 5, 2018
cho3 pushed a commit to cho3/rclcpp that referenced this pull request Jun 3, 2019
* WIP

* Removed async_cancel from action ClintGoalHandle API

* Added status handler to action client goal handler

* Added result handler to action client goal handler

* Identation fix

* Added get/set for action client goal handler

* Changed action client goal handler attrs from rcl to cpp versions

* Added check methods to action client goal handler

* Removed rcl_client pointer from action client goal handler

* Added basic waitable interface to action client

* Updated waitable execute from action client

* Added throw for rcl calls in action client

* Removed duplicated ready flags from action client

* Minor fix

* Added header to action ClientBaseImpl execute

* Mich's update to action client interface

* Added trailing suffix to client pimpl attrs

* Towards a consistent action client

* Misc fixes for the action client

* Yet more misc fixes for the action client

* Few more fixes and shortcuts to deal with missing type support.

* Fixed lint errors in action headers and client

* Fixes to action client internal workflow.

* Misc fixes to get client example to build

* More misck client fixes

* Remove debug print

* replace logging with throw_from_rcl_error

* Wrap result object given by client to user

* Fix a couple bugs trying to cancel goals

* Use unique_indentifier_msgs

* create_client accepts group and removes waitable

* Uncrustify fixes

* [rclcpp_action] Adds tests for action client.

* [WIP] Failing action client tests.

* [rclcpp_action] Action client tests passing.

* Spin both executors to make tests pass on my machine

* Feedback callback uses shared pointer

* comment about why make_result_aware is called

* Client documentation

* Execute one thing at a time

* Return nullptr instead of throwing RejectedGoalError

* ClientGoalHandle worries about feedback awareness

* cpplint + uncrustify

* Use node logging interface

* ACTION -> ActionT

* Make ClientBase constructor protected

* Return types on different line

* Avoid passing const reference to temporary

* Child logger rclcpp_action

* Child logger rclcpp_action

* possible windows fixes

* remove excess space

* swap argument order

* Misc test additions

* Windows independent_bits_engine can't do uint8_t

* Windows link issues
this->handle_cancel_response(response_header, cancel_response);
}
} else {
throw std::runtime_error("Executing action client but nothing is ready");
Copy link
Contributor

@jdlangs jdlangs Nov 21, 2019

Choose a reason for hiding this comment

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

@hidmic, can I ask what was the purpose of throwing this exception? It's throwing in my code and as far as I can tell there's nothing I can do to control it. And since this function is invoked through the executor, I can't easily catch it and proceed. When I remove it, my program functions normally. Is it just to signal that there's a bug?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it just to signal that there's a bug?

I think so. Got an example that reproduces it? It would mean the executor thinks the action client is ready, but nothing actually seems to be ready to execute.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll see if I can get a simple standalone example reproducing it since my current program is pretty complex. I'll just go ahead an open an issue in that case.

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 would mean the executor thinks the action client is ready, but nothing actually seems to be ready to execute.

Precisely that @jdlangs.

DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this pull request Aug 5, 2022
* Refactoring of rosbag2 performance package:
- renamed since now it no longer benchmarks writer only
- generalized byte_producer so that it uses a callback instead of queue, so it can be reused in publisher scheme

Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>

* Benchmark publishers based on yaml configuration
- can specify multiple groups of publishers (see attached example yaml)
- reuses byte producer

Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>

* Applying configured QoS settings for publishers.
Also included in yaml example.

Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>

* linters

Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>

* Towards common configuration
- separating out common structures
- utility class for common parameter parsing

Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>

* Barebone launchfile for benchmarks.

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* writer benchmark adapted to yaml file and publisher groups

Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>

* refactored result writing and bag parameters

Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>

* linters

Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>

* Launchfile for benchmarks

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* Change storage config file from non optimized to resilient

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* Max bag size for benchmark launchfile. Launchfile refactor.

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* Copy yaml configs after benchmark is finished.

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* Benchmark results csv file extended

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* added disclaimer about random data and compression

Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>

* Report gen tool for benchmarks

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* Benchmarks out dir name changed

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* results writer node

Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>

* documentation

Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>

* Transport and transportless in launchfile

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* Benchmark launchfile refactor

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* Wait for rosbag listening in benchmark launchfile

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* Uncrustify and some comments for benchmarking tools

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* Added new producers config for benchmarks

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* Missing parameters in transport benchmark

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

added comment in storage_optimized.yaml

* Missing rosbag record parameters in transport benchmark

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* Wait for subscriptions parameter in producers config

Signed-off-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>

* moved utils code from header to source

Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>

* changed compiler shortcut uint to unsigned int (should fix Windows build)

Signed-off-by: Adam Dabrowski <adam.dabrowski@robotec.ai>

Co-authored-by: Piotr Jaroszek <piotr.jaroszek@robotec.ai>
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.

None yet

6 participants