-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Extend odometry tests for steering controllers #1606
base: master
Are you sure you want to change the base?
Extend odometry tests for steering controllers #1606
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1606 +/- ##
==========================================
+ Coverage 85.10% 85.15% +0.05%
==========================================
Files 123 123
Lines 11699 11712 +13
Branches 995 995
==========================================
+ Hits 9956 9973 +17
+ Misses 1432 1428 -4
Partials 311 311
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for giving a try! But apparently, this does not test the original issue. What I tried: Run colcon build and test with this version, and then with
git revert 2375aca
It succeeds in both cases.
steering_controllers_library/test/test_steering_controllers_library.cpp
Outdated
Show resolved
Hide resolved
Hi @christophfroehlich, |
tests are failing now |
Sorry , for the incorrect push. |
Hi @christophfroehlich , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, the tests for the last*velocity now fails without the bugfix.
I had a look now why the other test does not fail:
1.) The test is in open_loop=false mode
2.) The update_odometry
call in update_and_write_commands
is overriden in the TestableSteeringControllersLibrary
and does not update the odometry class.
We should add a new testfile with a different yaml (see add_rostest_with_parameters_gmock in the CMakeLists file) and add something like this in the TestableSteeringControllersLibrary::update_odometry
(from bicycle_steering_controller)
if (params_.open_loop)
{
odometry_.update_open_loop(last_linear_velocity_, last_angular_velocity_, period.seconds());
}
ok |
Hi @christophfroehlich, |
steering_controllers_library/test/steering_controllers_library_open_loop_timeout_params.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my other comments. With these changes, the test runs but fails with
3: /workspaces/ros2_rolling_ws/src/ros2_controllers/steering_controllers_library/test/test_steering_controllers_library.cpp:173: Failure
3: The difference between controller_->command_interfaces_[2].get_value() and 0.575875 is 0.071721078654024661, which exceeds 1e-6, where
3: controller_->command_interfaces_[2].get_value() evaluates to 0.50415392134597536,
3: 0.575875 evaluates to 0.57587500000000003, and
3: 1e-6 evaluates to 9.9999999999999995e-07.
3:
3: /workspaces/ros2_rolling_ws/src/ros2_controllers/steering_controllers_library/test/test_steering_controllers_library.cpp:174: Failure
3: The difference between controller_->command_interfaces_[3].get_value() and 0.575875 is 0.092000372941643649, which exceeds 1e-6, where
3: controller_->command_interfaces_[3].get_value() evaluates to 0.66787537294164367,
3: 0.575875 evaluates to 0.57587500000000003, and
3: 1e-6 evaluates to 9.9999999999999995e-07.
3:
3: /workspaces/ros2_rolling_ws/src/ros2_controllers/steering_controllers_library/test/test_steering_controllers_library.cpp:239: Failure
3: The difference between controller_->command_interfaces_[2].get_value() and 0.575875 is 0.071721078654024661, which exceeds 1e-6, where
3: controller_->command_interfaces_[2].get_value() evaluates to 0.50415392134597536,
3: 0.575875 evaluates to 0.57587500000000003, and
3: 1e-6 evaluates to 9.9999999999999995e-07.
3:
3: /workspaces/ros2_rolling_ws/src/ros2_controllers/steering_controllers_library/test/test_steering_controllers_library.cpp:240: Failure
3: The difference between controller_->command_interfaces_[3].get_value() and 0.575875 is 0.092000372941643649, which exceeds 1e-6, where
3: controller_->command_interfaces_[3].get_value() evaluates to 0.66787537294164367,
3: 0.575875 evaluates to 0.57587500000000003, and
3: 1e-6 evaluates to 9.9999999999999995e-07.
I'm not sure why these are different in open_loop mode, but haven't investigated further now
Hi @christophfroehlich, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are failing now with the output I posted above. Please have a look why this differs in open-loop mode
While checking the test class, I see that there are some unused/duplicate constants. Could you clean them up as well please? ros2_controllers/steering_controllers_library/test/test_steering_controllers_library.hpp Lines 57 to 61 in d1844e6
ros2_controllers/steering_controllers_library/test/test_steering_controllers_library.hpp Lines 292 to 295 in d1844e6
ros2_controllers/steering_controllers_library/test/test_steering_controllers_library.hpp Lines 300 to 309 in d1844e6
ros2_controllers/steering_controllers_library/test/test_steering_controllers_library.hpp Lines 311 to 315 in d1844e6
ros2_controllers/steering_controllers_library/test/test_steering_controllers_library.hpp Line 324 in d1844e6
|
|
||
if (params_.front_steering) | ||
// calculate new commands if not in timeout | ||
if (!timeout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the necessity of this change.
In case of timeout it SHOULD set the appropriate commands see L397, L401 or L409/413, respectively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I specifically wanted to update traction_commands and steering_commands when the timeout is false, so I thought there is a need to add this
auto [traction_commands, steering_commands] = odometry_.get_commands( reference_interfaces_[0], reference_interfaces_[1], params_.open_loop, params_.reduce_wheel_speed_until_steering_reached);
inside the flag.
ros2_controllers/steering_controllers_library/test/test_steering_controllers_library.hpp Lines 57 to 61 in d1844e6
This is getting used in the function configure_odometry ros2_controllers/steering_controllers_library/test/test_steering_controllers_library.hpp Lines 121 to 128 in d1844e6
|
only FRONT_WHEELS_RADIUS_, WHEELBASE_, REAR_WHEEL_TRACK_ |
Hi @christophfroehlich, ros2_controllers/steering_controllers_library/test/test_steering_controllers_library.hpp Line 318 in d1844e6
|
This PR addresses issue #1456 by:
1.Tracking odometry values before and after the timeout.
2.Ensuring position values remain stable.
3.Verifying that linear and angular velocities reset to zero.