Skip to content

Commit

Permalink
path follower get_parameter fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
T3OTWAWKI committed Apr 6, 2024
1 parent 724ed5f commit 4aa2814
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/rktl_planner/rktl_planner/nodes/path_follower.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,23 @@ def __init__(self):
self.start_time = None
self.max_speed = None

self.frame_id = node.declare_parameter('~frame_id', 'map')
self.frame_id = node.get_parameter_or('~frame_id', rclpy.Parameter('map')).get_parameter_value().string_value

# Max speed to travel path
self.max_speed = node.declare_parameter('~max_speed', 0.1)
self.max_speed = node.get_parameter_or('~max_speed', rclpy.Parameter(0.1)).get_parameter_value().double_value

# Radius to search for intersections
self.lookahead_dist = node.declare_parameter('~lookahead_dist', 0.15)
self.lookahead_dist = node.get_parameter_or('~lookahead_dist', rclpy.Parameter(0.15)).get_parameter_value().double_value

# Coeffient to adjust lookahead distance by speed
self.lookahead_gain = node.declare_parameter('~lookahead_gain', 0.035)
self.lookahead_gain = node.get_parameter_or('~lookahead_gain', rclpy.Parameter(.055)).get_parameter_value().double_value

# Number of waypoints to search per pass (-1 is full path)
self.lookahead_pnts = node.declare_parameter('~lookahead_pnts', -1)
self.lookahead_pnts = node.get_parameter_or('~lookahead_pnts', rclpy.Parameter(-1)).get_parameter_value().integer_value

# Publishers
car_name = node.declare_parameter('~car_name')
self.bot_velocity_cmd = node.create_publisher(ControlCommand, f'/cars/{car_name}/command', 1)

car_name = node.get_parameter('~car_name').get_parameter_value().string_value

# Subscribers
node.create_subscription(Odometry, f'/cars/{car_name}/odom', self.odom_cb, qos_profile=1)
node.create_subscription(Path, 'linear_path', self.path_cb, qos_profile=1)
Expand Down

0 comments on commit 4aa2814

Please sign in to comment.