cannot use QoS override parameters via `NodeParameter` callbacks
Open
@fujitatomoya is already working on this.
Since Dec 1, 2023.
- Dominant language
- C++
- Stars
- 805
- Forks
- 564
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 27
Description
Bug report
Required Info:
- Operating System:
- Ubuntu 22.04
- Installation type:
- source build
- Version or commit hash:
- DDS implementation:
- Any
- Client library (if applicable):
- rclcpp
Steps to reproduce issue
- register callback that creates the subscription with
QosOverridingOptionsviaadd_post_set_parameters_callback. - update parameter successfully, the gets
ParameterModifiedInCallbackExceptionexception.
cd colcon_ws/src
git clone https://github.com/fujitatomoya/ros2_test_prover
cd colcon_ws
colcon build --symlink-install --packages-select prover_interfaces prover_rclcpp
ros2 run prover_rclcpp rclcpp_237
and, with another terminal
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param get /test_params switch
Boolean value is: False
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param set /test_params switch true
Set parameter successful
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param set /test_params switch false
Set parameter successful
this will generate the exception below,
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 run prover_rclcpp rclcpp_2379
[INFO] [1701396695.327098876] [test_params]: Parameter switch changed: 1
[INFO] [1701396695.327206255] [test_params]: Creating Subscription
[ERROR] [1701396695.327343914] [test_params]: Caught Exception with cannot set or declare a parameter, or change the callback from within set callback
[INFO] [1701396699.343136018] [test_params]: Parameter switch changed: 0
[INFO] [1701396699.343206436] [test_params]: Destroying Subscription
^C[INFO] [1701396701.596623929] [rclcpp]: signal_handler(signum=2)
Expected behavior
No exception received.
Actual behavior
ParameterModifiedInCallbackException
Additional information
This behavior blocks https://github.com/ros2/rclcpp/pull/2378
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.