File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -354,13 +354,14 @@ static void test_position_trajectory(void *env) {
354354 tt_want_int_op (trj .w3 , = = , 0 );
355355 }
356356
357- // Initial speed may now be bounded. Verify that the sign is the same.
357+ // Initial speed may now be bounded. Verify that the sign is the same,
358+ // or more precisely, not opposite. First we get reference to compare.
358359 pbio_trajectory_reference_t ref ;
359360 pbio_trajectory_get_reference (& trj , command .time_start , & ref );
360361 get_position_command (i , & command );
361-
362- // FIXME: This should pass even for t1 == 0 .
363- if (trj . t1 > 0 ) {
362+ int32_t speed_difference = pbio_int_math_abs ( ref . speed - command . speed_start );
363+ // We avoid doing this check for nonzero but negligible speed differences .
364+ if (! speed_difference || speed_difference > 2 * MDEG_PER_DEG ) {
364365 tt_want (pbio_int_math_sign_not_opposite (ref .speed , command .speed_start ));
365366 }
366367
You can’t perform that action at this time.
0 commit comments