Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed error of a big integration step when vehicle stopped in gvf_par… #4

Open
wants to merge 2 commits into
base: devel_rover_stop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,31 @@ void gvf_parametric_bare_control_2D(float kx, float ky, float f1, float f2, floa
gvf_parametric_bare_control.delta_T = now - gvf_parametric_bare_t0;
gvf_parametric_bare_t0 = now;

if (gvf_parametric_bare_control.delta_T > 300) { // We need at least two iterations for Delta_T
gvf_parametric_bare_control.w = 0; // Reset w since we assume the algorithm starts
return;
/* If the vehicle does not need to stop at the wp */
if(!gvf_c_stopwp.stop_at_wp)
{
// We need at least two iterations for Delta_T
if ((gvf_parametric_bare_control.delta_T > 300))
{
/* Reset w since we assume the algorithm starts, because there cannot be any
* physical stop of 300 ms */
gvf_parametric_bare_control.w = 0;
return;
}
}
else
{
/* TODO: Replace magic number for conversion from ms to s and the number
* of seconds of error */
/* If the vehicle has to stop at any waypoint wp, it shall wait outside
* gvf_parametric_bare, gvf_c_stopwp.wait_time seconds, so when coming back
* into this function, delta_T could be really big. If that's the case then
* fix delta_T to a value, so the integration step is properly carried.
*/
if((gvf_parametric_bare_control.delta_T >= (gvf_c_stopwp.wait_time - 1)* 1000))
alfredoFBW marked this conversation as resolved.
Show resolved Hide resolved
{
gvf_parametric_bare_control.delta_T = 1.0 / PERIODIC_FREQUENCY;
alfredoFBW marked this conversation as resolved.
Show resolved Hide resolved
}
}

// Carrot position
Expand Down