-
Notifications
You must be signed in to change notification settings - Fork 259
make _on_parameter_event return result correctly #817
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
|
Just FYI, the following is the current behavior. type mismatch can be detected before _parameters_callbacks is called. |
fujitatomoya
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
|
as mentioned in #817 (comment), currently with master, it will check the parameter type via But i think this PR makes sense. |
|
@squizz617 could you address flake8 errors? |
Previously, `_on_parameter_event` always returned `successful=True` to the caller (e.g., ros2param set) regardless of whether setting `use_sim_time` parameter actually succeeded or not. * PoC: ```sh # terminal 1 $ ros2 run examples_rclpy_minimal_publisher publisher_member_function [INFO] [1629490410.452032755] [minimal_publisher]: Publishing: "Hello World: 0" [INFO] [1629490410.918999697] [minimal_publisher]: Publishing: "Hello World: 1" [INFO] [1629490411.419087028] [minimal_publisher]: Publishing: "Hello World: 2" [INFO] [1629490411.919343319] [minimal_publisher]: Publishing: "Hello World: 3" [INFO] [1629490412.419345165] [minimal_publisher]: Publishing: "Hello World: 4" [INFO] [1629490412.919260702] [minimal_publisher]: Publishing: "Hello World: 5" [ERROR] [1629490413.030775970] [minimal_publisher]: use_sim_time parameter set to something besides a bool [INFO] [1629490413.419389164] [minimal_publisher]: Publishing: "Hello World: 6" [INFO] [1629490413.919106545] [minimal_publisher]: Publishing: "Hello World: 7" ``` ```sh # terminal 2 $ ros2 param set /minimal_publisher use_sim_time Trueeeee Set parameter successful ``` As demonstrated above, when trying to set `use_sim_time` param to an invalid type, the minimal_publisher node complains it cannot. However, ros2 param prints "Set parameter successful". This commit fixes this issue. Signed-off-by: Seulbae Kim <squizz617@gmail.com>
Signed-off-by: Seulbae Kim <squizz617@gmail.com>
|
Fixed the flake8 error. Seems ready to be merged. And the param type check in the master branch does make sense. Thanks! |
|
@ivanpauno could you review on this just in case before merge. |
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, it would be nice if tests are added before this gets merged
|
CI is failing because of https://ci.ros2.org/job/ci_linux/16070/console, we need to use https://github.com/ros2/ros2/blob/4a36f319afcc208deae3c373493ef6d9feda1324/ros2.repos#L45. |
|
@fujitatomoya friendly ping, what's the state of this? |
|
CI (repos file build: |
|
PR job is test_timer, which appears to be flaky and unrelated to this PR. CI LGTM |
|
Thank you for the PR! |
Previously,
_on_parameter_eventalways returnedsuccessful=Trueto thecaller (e.g., ros2param set) regardless of whether setting
use_sim_timeparameter actually succeeded or not.
As demonstrated above, when trying to set
use_sim_timeparam to an invalidtype, the minimal_publisher node complains it cannot. However, ros2 param
prints "Set parameter successful". This commit fixes this issue.