Comments (4)
- The name
on_set_parameters_callback
suggests that this is when the parameters are set, or should be set, while in fact the internal state should not be altered,
While I don't disagree, we've already renamed this callback 3 times. And since this is the oldest of the callbacks, it has the most users. So I'm not super inclined to change this one yet again.
- But in the example code, the
post_set
callback is used to update the node parameters.
No, that example code does not change the node parameters. It changes internal class state, which is a different thing. That is, there is a (private) database of node parameters that rclcpp tracks, and by the time that post_set
is called, that database has been updated. The purpose of the post_set
is to give the user the chance to make internal changes based on that, which is what the example shows. Maybe we should update the name of the member fields in the example code, and/or update the documentation?
from rclcpp.
So I'm not super inclined to change
That's why I used the wording "I propose to consider". ;-)
this one yet again.
I would rename all, or none.
Or maybe add the new names as an alias and also keep the current ones?
Anyway if it is deemed not important enough than that's fine as well.
No, that example code does not change the node parameters. It changes internal class state, which is a different thing.
Ok, I totally missed that the internal_tracked_class_parameter_X_
variables are of type double
.
I assumed that this->declare_parameter()
would return a rclcpp::Parameter
, similar to this->get_parameter()
.
So I was expecting rather:
internal_tracked_class_parameter_1_ = this->declare_parameter("param1", 0.0).as_double();
[...]
internal_tracked_class_parameter_1_ = this->get_parameter("param1").as_double();
from rclcpp.
Ok, I totally missed that the
internal_tracked_class_parameter_X_
variables are of typedouble
.
I assumed thatthis->declare_parameter()
would return arclcpp::Parameter
, similar tothis->get_parameter()
.
It has a bunch of overloads, some of which return an rclcpp::ParameterValue
and some of which return the type given based on template automagic; see
rclcpp/rclcpp/include/rclcpp/node.hpp
Lines 424 to 498 in 9ff864c
That said, I'm not sure whether we have examples showing all of those overloads (though we do seem to have tests for it).
Given what you've said so far, I think for now what we should do is to update the demos to make it clear that those are internal class variables, and possibly update the documentation to better describe what is going on here. @jrutgeer would you be willing to take a shot at doing those?
from rclcpp.
@clalancette Can you check this proposal ros2/demos#651? See also the open questions in the comment.
from rclcpp.
Related Issues (20)
- :farmer: `rclcpp.test_executors` failing in Rolling and Jazzy CycloneDDS HOT 2
- rclcpp::Time(int64_t nanoseconds, ...) should check for negative time
- Regression : Executor::spin_some_impl is active waiting HOT 5
- Parameter service behavior is inconsistent with the documentation of rcl_interfaces HOT 9
- Lifecycle destructor calls shutdown while in shuttingdown intermediate state HOT 45
- Backport PR2063 to Humble for Windows HOT 2
- Executor callbacks are no longer in a predictable order HOT 25
- '/clock' Topic cannot change each loop step time from simulation time HOT 10
- Program exits with code -11 when using async_send_request to set parameters in ROS 2 C++ client HOT 1
- Timer callbacks can be delayed when using simulation time HOT 4
- Possible regression in rcl preshutdown callbacks - context invalid? HOT 11
- Shutdown transition on base lifecycle node dtor may lead to segaults on subclass-registered shutdown callback HOT 6
- `on_shutdown` callback not called when `shutdown` transition is triggered on dtor HOT 2
- ABI/API Compliance Checker in github workflow HOT 2
- [rclcpp] C++ lib leaking `rclcpp::Node()` can cause segfaults at `dlclose()` HOT 3
- Feature Request: Dynamic Type Handling for Generic Subscriptions HOT 10
- Action: rclcpp_action::Client goal response and feedback order not in send order HOT 5
- EventsExecutor doesn't support rcl guard conditions HOT 3
- Retrieving(get_parameter()) value of parameter of type std::vector<int> won't build HOT 3
- :farmer: `test_client_common` and `test_service` failing in Rolling and Jazzy connext nightlies 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 rclcpp.