-
Notifications
You must be signed in to change notification settings - Fork 283
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
Using math::SpeedLimiter on the diff_drive controller. #833
Using math::SpeedLimiter on the diff_drive controller. #833
Conversation
Signed-off-by: LolaSegura <lsegura@ekumenlabs.com>
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.
LGTM! I just left a couple of nits.
I will add @scpeters as a reviewer as well
Codecov Report
@@ Coverage Diff @@
## ign-gazebo3 #833 +/- ##
===============================================
- Coverage 77.97% 77.94% -0.03%
===============================================
Files 216 215 -1
Lines 12130 12077 -53
===============================================
- Hits 9458 9414 -44
+ Misses 2672 2663 -9
Continue to review full report at Codecov.
|
this is looking good! it's helpful to cross-reference issues from pull requests, so I would add that this is "Part of #810" in the pull request description |
Signed-off-by: LolaSegura <lsegura@ekumenlabs.com>
I noticed that codecov is complaining about test coverage. We are not strict about requiring code coverage, but I think we can easily increase this for this test. I believe the The test uses several different world files (search for Since these are easy changes to improve code coverage, do you mind giving them a try? Thanks! edited to fix typo noted below |
@scpeters here when you mentioned the |
thanks for catching that; I meant to write |
…elocity limits. Added those limits to the .sdf file. Signed-off-by: LolaSegura <lsegura@ekumenlabs.com>
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.
ptal at the comments. Also, run codecheck
to match style.
/// \param[in] forward true for testing the forward movement or | ||
/// false for testing the backward movement. |
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.
Change it to be:
// If `forward` is true, the `max_acceleration` and `max_velocity` properties are tested as the movement is forward,
// otherwise `min_acceleraton` and `min_velocity` properties are tested.
|
||
msgs::Twist msg; | ||
|
||
// Avoid wheel slip by limiting acceleration |
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.
Almost repeated line
// See <max_velocity> and <max_aceleration> parameters | ||
// in "/test/worlds/diff_drive.sdf". | ||
// <min_velocity>, <min_aceleration>, <min_jerk> and | ||
// <max_jerk> parameters were also included. |
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.
Use
// See <max_velocity>, <min_velocity>, <max_acceleration> and <min_acceleration> parameters
// in "/test/worlds/diff_drive.sdf".
instead of
// See <max_velocity> and <max_aceleration> parameters
// in "/test/worlds/diff_drive.sdf".
// <min_velocity>, <min_aceleration>, <min_jerk> and
// <max_jerk> parameters were also included.
// <min_velocity>, <min_aceleration>, <min_jerk> and | ||
// <max_jerk> parameters were also included. | ||
test::Relay velocityRamp; | ||
int kMovementDirection = (forward ? 1 : -1); |
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.
- it can be
const
- use
movementDirection
instead.
double a = (v - v0) / t; | ||
|
||
// Max velocities/accelerations expectations. | ||
// Moving time. |
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.
// Moving time
It shouldn't be here.
This was related to double t = 3.0
statement.
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.
Also:
Remove these comments before the if
and the else
and add one comment before the declaration of the previous variables (t,d,v0,v,a) stating something like:
// Verify velocity and acceleration boundaries.
@@ -608,4 +634,4 @@ TEST_P(DiffDriveTest, Pose_VCustomTfTopic) | |||
|
|||
// Run multiple times | |||
INSTANTIATE_TEST_SUITE_P(ServerRepeat, DiffDriveTest, | |||
::testing::Range(1, 2)); | |||
::testing::Range(1, 2)); |
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.
Missing a new line at the end of the file?
Signed-off-by: LolaSegura <lsegura@ekumenlabs.com>
@LolaSegura . I've tried it locally.
Re-check the desire angle you are publishing. |
…y and acceleration limits to the diff_drive_custom_topics.sdf Signed-off-by: LolaSegura <lsegura@ekumenlabs.com>
I added the
I try adding this limits as well, but I encounter a problem because when being parsed the limits where interpreted as zero, causing the test to fail. An option would be setting the |
It is ready for review @scpeters |
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.
To get even more coverage and without changing the dynamics of the system we could add a min_jerk value of -Inf and a max_jerk value of Inf (I think that will work).
I try adding this limits as well, but I encounter a problem because when being parsed the limits where interpreted as zero, causing the test to fail. An option would be setting the
<max_jerk>
with a big value and the<min_jerk>
with a small one to get more test coverage.
I'll look into this briefly
Signed-off-by: LolaSegura <lsegura@ekumenlabs.com>
thanks for testing this; I just looked into it a bit deeper and found that it is a parsing issue with |
Signed-off-by: LolaSegura lsegura@ekumenlabs.com
Summary
This replace the diff_drive controller speed limiter class for the one implemented in ignition math. Part of #810.
Checklist
codecheck
passed (See contributing)🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸