The waypoint_updater copies 200 base_waypoints and use this as a
starting point for the final_waypoints. This copy is implemented as a
deepcopy, which consumes an surprisingly large amount of CPU time,
e.g. around 100 ms on the Udacity workspace. The deepcopy is however
no longer needed as the target velocity is calculated from the
base_waypoints during initialization, and the velocity for all
final_waypoints are explicitly modified for each update. A shallow
copy takes almost no time, so this solves the problem.
The waypoint_updater copies 200 base_waypoints and use this as a starting point for the final_waypoints. This copy is implemented as a deepcopy, which consumes an surprisingly large amount of CPU time, e.g. around 100 ms on the Udacity workspace. The deepcopy is however no longer needed as the target velocity is calculated from the base_waypoints during initialization, and the velocity for all final_waypoints are explicitly modified for each update. A shallow copy takes almost no time, so this solves the problem.