To prevent sending an initial waypoint of -1 on initial loop, add a condition to wait until self.pose and self.waypoint_tree have also finished initializing from their callbacks so that the get_closest_waypoint() check can return the actual waypoint index for the first published message to Waypoint Updater.
To prevent sending an initial waypoint of -1 on initial loop, add a condition to wait until self.pose and self.waypoint_tree have also finished initializing from their callbacks so that the get_closest_waypoint() check can return the actual waypoint index for the first published message to Waypoint Updater.