Comments (6)
Yes, it looks like a copy-n-paste error. Can you please create a PR with the proposed change.
But it seems that the current implementations never return this code anyway? @wjwwood
from rcl.
Definitely a copy-paste bug. That return code is reserved for checking if the service is valid or not. In the publisher code, an equivalent return code is returned if the argument is null, but perhaps that's not the best idea, and should instead return RCL_RET_INVALID_ARGUMENT
as the implementation of this function does. When I think of an "invalid service" I mean:
- rcl_shutdown has been called
- the associated node is invalid
Currently the node can only be invalid if rcl_shutdown has been called, which is a bit redundant. However, I wanted to build in the notion that a node could have a valid/invalid state separate from the init/shutdown state.
A more general issue is that we need to check these states in all functions, and provide rcl_X_is_valid()
functions for each type of thing.
from rcl.
@dirk-thomas Then I'm going to create a PR that corrects the documentation from RCL_RET_CLIENT_INVALID
to RCL_RET_SERVICE_INVALID
?
@wjwwood
I would expect this error in case the passed service is invalid (is this even possible to determine?). In case the node is invalid or rcl_shutdown has been called I would return the corresponding value. E.g in case the node is invalid I would expect the function to return RCL_RET_NODE_INVALID
By a rcl_X_is_valid()
function you mean for example a function that checks if a given node is valid: bool rcl_node_is_valid(rcl_node_t * node)
?
from rcl.
I would expect this error in case the passed service is invalid (is this even possible to determine?). In case the node is invalid or rcl_shutdown has been called I would return the corresponding value. E.g in case the node is invalid I would expect the function to return RCL_RET_NODE_INVALID
You're right that the node being invalid might be the first concern, but since this this function doesn't take a node as an argument (it is probably held internally by the service) then I think the RCL_RET_SERVICE_INVALID
is the right return code here. Currently, there is no additional state for the service object that needs to be checked for it to be valid, other than the node, but that might change in the future. This return code is a placeholder more than anything. You could imagine in the future a function like rcl_service_shutdown()
which "invalidates" a given service without destroying the object like rcl_service_fini()
does.
By a
rcl_X_is_valid()
function you mean for example a function that checks if a given node is valid:bool rcl_node_is_valid(rcl_node_t * node)
?
That's correct, and by extension bool rcl_service_is_valid(rcl_service_t * service)
.
from rcl.
I created a PR #80 that simply removes the documentation entry. I didn't add the RCL_RET_SERVICE_INVALID return type because I think there's currently no possible check in the function where this return value might be reasonable.
But I would recommend to keep this issue open because of the things wjwwood said in his last post.
from rcl.
@firesurfer actually can you open a new issue for whatever you think needs to be tracked. From my perspective, this can be closed once #80 replaces CLIENT
with SERVICE
in the documentation, but if you see other issues we can track/discuss those too.
from rcl.
Related Issues (20)
- Rosout publisher always gets standard allocator HOT 4
- Contradicting code docs for rcl_publish and rmw_publish HOT 2
- rcl_node_init uses wrong return code HOT 4
- Flaky test on Windows on the buildfarm: test_logging_rosout__rmw_connextdds
- master branch is behind rolling branch HOT 2
- Test `test_graph__rmw_connextdds` failing on nightly_win_rep
- Fix durability of service introspection topics HOT 9
- Remove `localhost_only` option for turtule-J
- Dynamically remap topic names HOT 8
- Feature request: Sending an Action goal can be complexed, require difficult steps HOT 2
- rcl_action: result_timeout should be started on goal completion HOT 20
- 👩🌾 ❄ Flaky `test_get_type_description_service__rmw_cyclonedds_cpp` & `rcl.TestGetTypeDescSrvFixture__rmw_cyclonedds_cpp.test_service_init_and_fini_functions` tests
- Request for API that returns how many messages are ready for a subscription HOT 1
- Segfault creating a publisher in MoveIt 2 Example, only with Fast DDS RMW HOT 7
- Flaky: failed to add guard condition to wait set: guard condition implementation is invalid HOT 5
- :farmer: `test_node__rmw` test failing for `connextdds`, `cyclonedds` and `fastrtps`
- rcl_yaml_param_parser incorrectly parsing integer values bigger than LONG_MAX = 2147483647
- Adding `ament_generate_version_header(..)` to these packages? HOT 1
- Allow non-ros parameters in params file HOT 4
- Actions: Reason for the default QoS for status_topic_qos? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcl.