-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add the LFController unit tests #46
base: humble-devel
Are you sure you want to change the base?
Add the LFController unit tests #46
Conversation
1766749
to
afb73ba
Compare
NOTE: Rebased onto humble-devel (43151c1) |
@Kotochleb / @MaximilienNaveau I added some template, with TOTO tags for it. |
@Kotochleb / @MaximilienNaveau |
wrong_control.feedback_gain.bottomRows<1>() = | ||
::Eigen::VectorXd::Random(wrong_control.feedback_gain.cols()); | ||
|
||
wrong_control.feedback_gain.rightCols<1>() = | ||
::Eigen::VectorXd::Random(wrong_control.feedback_gain.rows()); |
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.
wrong_control.feedback_gain.bottomRows<1>() = | |
::Eigen::VectorXd::Random(wrong_control.feedback_gain.cols()); | |
wrong_control.feedback_gain.rightCols<1>() = | |
::Eigen::VectorXd::Random(wrong_control.feedback_gain.rows()); | |
wrong_control.feedback_gain.bottomRows<1>() = | |
::Eigen::VectorXd::Random(wrong_control.feedback_gain.cols() + 1); | |
wrong_control.feedback_gain.rightCols<1>() = | |
::Eigen::VectorXd::Random(wrong_control.feedback_gain.rows()); |
Shouldn't at least one of those have +1
? It seems that you are leaving value in bottom right corner unset. Even though it is very minor issue I think it would be nice to fix it
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.
No, because of the Grow()
above, the sizes match.
It's the opposite in fact, we are updating the bottom right element twice, but I'd say that it's not very important.
Also I guess Eigen would have report a size mismatch if it was the case (not sure ?).
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.
At this point, I am also not 100% sure, but I wouldn't assume it's all fine. When you compile in RelWithDebInfo
or Release
I think Eigen is stopping dynamic size checking. Maybe a good idea would to enforce that tests are build in Debug
so that all possible asserts will be triggered. From my experience if Debug
works all the rest will as well
for more information, see https://pre-commit.ci
Templated stuff may be too confusing
0c3dc11
to
2049ffe
Compare
Rebased into humble-devel (DISABLED pd_controller tests) |
Base: 43151c1
It adds the unit-tests for the LFController class.
Tests (Test suite = LFControllerTest):
LFController()
void initialize(const RobotModelBuilder::SharedPtr&)
:const VectorXd& compute_control(const Sensor& sensor_msg, const Control& control_msg)
.initialize()
beforehandsinitialize()
IMPORTANT: All tests that are testing against non-nominal inputs have been DISABLED