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

use_sim_time error message is logged from multiple nodes #746

Closed
jacobperron opened this issue May 29, 2019 · 5 comments · Fixed by #799
Closed

use_sim_time error message is logged from multiple nodes #746

jacobperron opened this issue May 29, 2019 · 5 comments · Fixed by #799
Assignees
Labels
bug Something isn't working

Comments

@jacobperron
Copy link
Member

Bug report

Required Info:

  • Operating System:
    • Ubuntu 18.04 and macOS
  • Installation type:
    • source (Linux) and fat archives (macOS)
  • Version or commit hash:
  • DDS implementation:
    • Fast-RTPS
  • Client library (if applicable):
    • rclcpp

Steps to reproduce issue

Run the talker C++ demo:

ros2 run demo_nodes_cpp talker

Run the listener C++ demo:

ros2 run demo_nodes_cpp listener

Set the use_sim_time parameter for the talker to something other than a bool:

ros2 param set talker use_sim_time foo

Expected behavior

We see an error (or warning) logged from the talker node regarding the type mismatch for the use_sim_time parameter. E.g.

[ERROR] [talker]: use_sim_time parameter set to something besides a bool

Actual behavior

We see the above error message, not only for the talker node, but also for the listener node. I.e. both the talker and the listener log the following error message:

[ERROR] [talker]: use_sim_time parameter set to something besides a bool

Additional information

We can see that the parameter is set on the talker node, but not on the listener node, which is correct. The bug is that we see the listener log an error when it is not expected.

@jacobperron jacobperron added the bug Something isn't working label May 29, 2019
@hidmic
Copy link
Contributor

hidmic commented Jul 26, 2019

So, it looks like rclcpp::TimeSource is listening to changes to use_sim_time system wide (see here). Judging by #609, this subscription serves no specific purpose and could/should be replaced by an on_set_parameters callback. Is that right @wjwwood ? If so, I'll do so.

@ivanpauno
Copy link
Member

So, it looks like rclcpp::TimeSource is listening to changes to use_sim_time system wide (see here). Judging by #609, this subscription serves no specific purpose and could/should be replaced by an on_set_parameters callback. Is that right @wjwwood ? If so, I'll do so.

on_set_parameter is for rejecting/accepting a parameter.
It shouldn't be used for updating a "global" state.
See discussion here #772 (comment).
#609 is asking for a local "on_parameter_change" callback, but we currently don't have that feature.

At the moment, using on_parameter_event is the only correct way of doing this.
The fully qualified node name is part of the Parameter Event message.
It should be used for filter nodes out.

@hidmic
Copy link
Contributor

hidmic commented Jul 26, 2019

It shouldn't be used for updating a "global" state.

Fair enough.

The fully qualified node name is part of the Parameter Event message.

Yes, I can work with that. Just checking if there's a better way to do so.

@hidmic
Copy link
Contributor

hidmic commented Jul 29, 2019

@jacobperron #799 should've addressed your issue.

@jacobperron
Copy link
Member Author

jacobperron commented Jul 29, 2019

@jacobperron #799 should've addressed your issue.

Works for me 👍

nnmm pushed a commit to ApexAI/rclcpp that referenced this issue Jul 9, 2022
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants