If a vehicle's global_path is a loop, then once the first loop is finished, frenet_to_sim_position() will raise an error
This error results because s is greater than the length of ref_path
If this issue is solved, then loops will not need padding (the extra 50 meters being added to global_path)
Solution 1
Add a cycle parameter which describes the current cycle that the vehicle is on
For example, cycle == 0 means that the vehicle has not done one full loop yet, cycle == 1 means that the vehicle has done one full loop and is on its second, etc.
When cycle == n, frenet_to_sim_position() could traverse the path between 0 and n + 1 times -- depending on where s lies
This is probably not the most optimal solution
Also, this would require a way of knowing when one cycle has been completed
global_path
is a loop, then once the first loop is finished,frenet_to_sim_position()
will raise an errors
is greater than the length ofref_path
global_path
)Solution 1
cycle
parameter which describes the current cycle that the vehicle is oncycle == 0
means that the vehicle has not done one full loop yet,cycle == 1
means that the vehicle has done one full loop and is on its second, etc.cycle == n
,frenet_to_sim_position()
could traverse the path between0
andn + 1
times -- depending on wheres
lies