Skip to content

Commit

Permalink
Fix deprecation warning in paramater declaration
Browse files Browse the repository at this point in the history
Updated the paramater declaration in `publisher_forward_position_controller` to resolve a deprecation warning.

Changes Made:
- Replaced `self.declare_parameter(name)` with `self.declare_parameter(name, descriptor=ParameterDescriptor(dynamic_typing=True))`

Fixes: #1239
  • Loading branch information
Sanjeev Kumar committed Sep 1, 2024
1 parent a7b2af5 commit 85c7baa
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import rclpy
from rclpy.node import Node
from rcl_interfaces.msg import ParameterDescriptor

from std_msgs.msg import Float64MultiArray

Expand All @@ -37,7 +38,7 @@ def __init__(self):
# Read all positions from parameters
self.goals = []
for name in goal_names:
self.declare_parameter(name)
self.declare_parameter(name, descriptor=ParameterDescriptor(dynamic_typing=True))
goal = self.get_parameter(name).value
if goal is None or len(goal) == 0:
raise Exception(f'Values for goal "{name}" not set!')
Expand Down

0 comments on commit 85c7baa

Please sign in to comment.