Commit ad5dc87e authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

t_max_a is placed on the wrong place.

parent 898f22c4
......@@ -218,6 +218,7 @@ static void setpoint_generator_calculate(struct controller_block *spg)
{
struct controller_block_private *priv = spg->private;
double cur_x, cur_v;
double t_max_a;
bool ignore_x = false;
bool must_brake = false;
bool good_x;
......@@ -226,6 +227,8 @@ static void setpoint_generator_calculate(struct controller_block *spg)
cur_x = priv->cur_x;
cur_v = priv->cur_v;
t_max_a = priv->t_max_a;
if (*priv->reset) {
priv->cmd_x = *priv->reset_x;
cur_x = priv->cmd_x;
......@@ -332,7 +335,7 @@ static void setpoint_generator_calculate(struct controller_block *spg)
double error_x_jneg;
double error_v = priv->cmd_v - cur_v;
double x, v, a, j, t;
double req_x, req_v, t_max_a, v_delta_from_max_a;
double req_x, req_v, v_delta_from_max_a;
double error_v_after_a, error_x_at_v;
double j_from_pos;
bool state_at_max_a = false;
......@@ -365,7 +368,6 @@ static void setpoint_generator_calculate(struct controller_block *spg)
j_from_pos = 0;
}
t_max_a = priv->t_max_a;
v_delta_from_max_a = priv->v_delta_from_max_a;
j = copysign(priv->max_j, error_v);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment