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

Reset the error when rcl_take_response failed #397

Closed
minggangw opened this issue Nov 13, 2017 · 3 comments
Closed

Reset the error when rcl_take_response failed #397

minggangw opened this issue Nov 13, 2017 · 3 comments

Comments

@minggangw
Copy link

In the latest implementation of rcl of rcl_take_response, the function will set the error message when returning RCL_RET_CLIENT_TAKE_FAILED and we have to reset the error so long as the return value doesn't equal to RCL_RET_OK. PR #396 has been submitted.

@dhood
Copy link
Member

dhood commented Nov 13, 2017

Thanks for the patch @minggangw

Regarding RCL_RET_CLIENT_TAKE_FAILED, this is not seen as an error state. The equivalent situation for services (rmw_take_request returning false) has been discussed in ros2/rcl@534a49c#commitcomment-19763950: this resulted in ros2/rcl#88

Look like the parallel of PR ros2/rcl#88 is just missing for clients, and then there will be no error message to be cleared.
If you are interested in making the change yourself (and confirming that it also addresses the original issue in your particular use case) we can consider a PR that makes that change in place of #396

@minggangw
Copy link
Author

Hi @dhood, we are implementing a rcl Node.js client named rclnodejs, which is under the Web Robot Tools umbrella. I found this problem when running the unit test by npm test and we created an issue to track. It seems that although the RCL_RET_CLIENT_TAKE_FAILED is not considered as an error state, there is still an error message to be written, please see our log recorded in our issue:

>>> [rcutils|error_handling.c:148] rcutils_set_error_state()
This error state is being overwritten:

  'error not set, at /home/qiuzhong/Workspace/Work/ros2/src/ros2/rcl/rcl/src/rcl/client.c:279, at /home/qiuzhong/Workspace/Work/ros2/src/ros2/rcl/rcl/src/rcl/client.c:279, at /home/qiuzhong/Workspace/Work/ros2/src/ros2/rcl/rcl/src/rcl/client.c:279, at /home/qiuzhong/Workspace/Work/ros2/src/ros2/rcl/rcl/src/rcl/client.c:279, at /home/qiuzhong/Workspace/Work/ros2/src/ros2/rcl/rcl/src/rcl/client.c:279, at /home/qiuzhong/Workspace/Work/ros2/src/ros2/rcl/rcl/src/rcl/client.c:279, at /home/qiuzhong/Workspace/Work/ros2/src/ros2/rcl/rcl/src/rcl/client.c:279, at /home/qiuzhong/Workspace/Work/ros2/src/ros2/rcl/rcl/src/rcl/client.c:279, at /home/qiuzhong/Workspace/Work/ros2/src/ros2/rcl/rcl/src/rcl/client.c:279'

with this new error message:

  'rcl_init() has not been called, at /home/qiuzhong/Workspace/Work/ros2/src/ros2/rcl/rcl/src/rcl/node.c:121'

rcutils_reset_error() should be called after error handling to avoid this.
<<<
    ✓ rclnodejs create node without init

So I think we should do the same as ros2/rcl#88 does for clients.

P.S. I want to have a brief introduction about us. We are from Open Source Technology, Intel and our mission is to promote web technology in every possible field. From middle of this year, we collaborated with RWT guys to develop the Node.js client of ROS2.0, @jihoonl gives us great support. The first alpha release of rclnodejs were published on npmjs two weeks ago. We have a thorough team who focus on robotics/IoT, including developers and QAs, and want to introduce the Node.js ecosystem to ROS. I know the first non-beta release of ROS 2.0 will happen next month, we are planning to release our first stable client around that timing to be synchronized. I hope we can keep a strong tie to make programming for ROS much easier!

@dhood
Copy link
Member

dhood commented Nov 15, 2017

Yes, I agree that the parallel of PR ros2/rcl#88 is just missing for clients, and then there will be no error message to be cleared. This is proposed in ros2/rcl#182 so I'll close this ticket as it should address your initial issue.

Great to hear the context around the contributions.. I was wondering what client library you were using, but you are developing your own 😄 It's nice to see the work being done on rclnodejs; we certainly appreciate you taking the time to propose improvements to the other client libraries as you come across things while developing rclnodejs. Please let us know if anything else comes up!

@dhood dhood closed this as completed Nov 15, 2017
nnmm pushed a commit to ApexAI/rclcpp that referenced this issue Jul 9, 2022
* Update rcl_action Doxyfile

Add reference to rcl tagfile and fix generated tagfile name.

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

* Fix minor doc errors

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this issue Aug 5, 2022
* Don't fail build if lsan isn't available

Since lsan isn't a required dependency for these packages, they
shouldn't fail to build when it isn't present.

Note that part of using a sanitizer involves additional libraries, so
using check_cxx_compiler_flag might not fail because it doesn't perform
linking like check_cxx_source_compiles does.

Signed-off-by: Scott K Logan <logans@cottsay.net>

* Remove 32-bit sanitizer logic

Signed-off-by: Scott K Logan <logans@cottsay.net>

* Update rosbag2_cpp/CMakeLists.txt

Signed-off-by: Scott K Logan <logans@cottsay.net>

Co-authored-by: Karsten Knese <Karsten1987@users.noreply.github.com>

* Drop sanitizers from rosbag2_compression

Signed-off-by: Scott K Logan <logans@cottsay.net>

* Only check for sanitizer if using GCC

Signed-off-by: Scott K Logan <logans@cottsay.net>

Co-authored-by: Karsten Knese <Karsten1987@users.noreply.github.com>
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

No branches or pull requests

2 participants