Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Steering Controller Tests #930

Open
christophfroehlich opened this issue Dec 14, 2023 · 0 comments
Open

Improve Steering Controller Tests #930

christophfroehlich opened this issue Dec 14, 2023 · 0 comments

Comments

@christophfroehlich
Copy link
Contributor

christophfroehlich commented Dec 14, 2023

Yes, you're right, there are a lot of things open to test -- but right now I just wanted to provide a quick fix for the Ackermann odometry, only rudimentary tested. Maybe we should open a new issue, tagged "help wanted" for proper testing of the steering lib -- starting with tests for the integrator functions, etc. But maybe first we should check for a redesign cf. #692

ok, I'll create a new issue then.

BTW, I just added this file 'test_steering_odometry.cpp', with some hard-coded tests. Is that the way to go, or do we want to have a more advanced testing style?

Should the expectations of the FW kinematics be true for all the different kinematic configurations? Then we could change this to a parameterized test as we have with JTC

// From the tutorial: https://www.sandordargo.com/blog/2019/04/24/parameterized-testing-with-gtest
class TrajectoryControllerTestParameterized
: public TrajectoryControllerTest,
public ::testing::WithParamInterface<
std::tuple<std::vector<std::string>, std::vector<std::string>>>
{
public:
virtual void SetUp()
{
TrajectoryControllerTest::SetUp();
command_interface_types_ = std::get<0>(GetParam());
state_interface_types_ = std::get<1>(GetParam());
}
static void TearDownTestCase() { TrajectoryControllerTest::TearDownTestCase(); }
};

// position controllers
INSTANTIATE_TEST_SUITE_P(
PositionTrajectoryControllers, TrajectoryControllerTestParameterized,
::testing::Values(
std::make_tuple(std::vector<std::string>({"position"}), std::vector<std::string>({"position"})),
std::make_tuple(
std::vector<std::string>({"position"}), std::vector<std::string>({"position", "velocity"})),
std::make_tuple(
std::vector<std::string>({"position"}),
std::vector<std::string>({"position", "velocity", "acceleration"}))));

Originally posted by @christophfroehlich in #921 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant