-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Description
When implemented a unittest for struckig, I noticed that disabling synchronization is not working when using duration discretization.
How to reproduce:
TEST_CASE("discretization-nosync") {
RuckigThrow<3> otg {0.01};
InputParameter<3> input;
OutputParameter<3> output;
input.current_position = {0.0, 0.0, 0.0};
input.target_position = {1.0, -3.0, 2.0};
input.target_velocity = {0.2, 0.2, 0.2};
input.max_velocity = {1.0, 1.0, 1.0};
input.max_acceleration = {2.0, 2.0, 2.0};
input.max_jerk = {1.8, 2.4, 2.0};
input.duration_discretization = DurationDiscretization::Discrete;
input.synchronization = Synchronization::None; // <-----
Trajectory<3> traj;
std::array<double, 3> new_position, new_velocity, new_acceleration;
auto result = otg.calculate(input, traj);
CHECK( result == Result::Working );
CHECK( traj.get_duration() == doctest::Approx(4.5) );
CHECK( traj.get_duration().get_profiles[0][0].t_sum.back() == doctest.Approx(2.38) ); // <-- This should not fail
result = otg.update(input, output);
output.trajectory.at_time(4.5, new_position, new_velocity, new_acceleration);
CHECK( array_eq(new_position, {1.0, -3.0, 2.0}) );
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels