Skip to content

Commit

Permalink
fix error in time scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelrojasmiliani committed Aug 20, 2024
1 parent 51ec13f commit 2c4435d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions include/gsplines/GSpline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,21 @@ class GSplineInheritanceHelper
_acceleration_bound.value().data(),
static_cast<long>(_acceleration_bound.value().size()));

// d / d t {f (\alpha t)} = df/dt \alpha
// the best value of alpha is
//
// {df/dt}_max \alpha = v_bound
//
// alpha = v_bound / {df/dt}_max
//
const double max_velocity_ratio =
(gspline_diff_1_evaluated.array().abs().colwise().maxCoeff() /
velocity_bound.transpose().array())
(velocity_bound.transpose().array() /
gspline_diff_1_evaluated.array().abs().colwise().maxCoeff())
.maxCoeff();

const double max_acceleration_ratio =
Eigen::sqrt(
gspline_diff_2_evaluated.array().abs().colwise().maxCoeff() /
acceleration_bound.transpose().array())
Eigen::sqrt(acceleration_bound.transpose().array() /
gspline_diff_2_evaluated.array().abs().colwise().maxCoeff())
.maxCoeff();

const double time_scale_factor =
Expand Down

0 comments on commit 2c4435d

Please sign in to comment.