Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
wolf_projects
wolf_lib
wolf
Commits
49cdd9b6
Commit
49cdd9b6
authored
5 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
New tests for linear advancement and pure rotation
parent
3381023b
No related branches found
No related tags found
1 merge request
!319
Resolve "Remove non-user params from IntrinsicsDiffDrive"
Pipeline
#4275
passed
5 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/gtest_processor_diff_drive.cpp
+55
-3
55 additions, 3 deletions
test/gtest_processor_diff_drive.cpp
with
55 additions
and
3 deletions
test/gtest_processor_diff_drive.cpp
+
55
−
3
View file @
49cdd9b6
...
...
@@ -224,7 +224,6 @@ TEST_F(ProcessorDiffDriveTest, computeCurrentDelta)
TEST_F
(
ProcessorDiffDriveTest
,
deltaPlusDelta
)
{
Vector2s
data
;
Matrix2s
data_cov
;
data_cov
.
setIdentity
();
Vector3s
calib
(
1
,
1
,
1
);
...
...
@@ -265,7 +264,6 @@ TEST_F(ProcessorDiffDriveTest, deltaPlusDelta)
TEST_F
(
ProcessorDiffDriveTest
,
statePlusDelta
)
{
Vector2s
data
;
Matrix2s
data_cov
;
data_cov
.
setIdentity
();
Vector3s
calib
(
1
,
1
,
1
);
...
...
@@ -306,7 +304,6 @@ TEST_F(ProcessorDiffDriveTest, statePlusDelta)
TEST_F
(
ProcessorDiffDriveTest
,
process
)
{
Vector2s
data
;
Matrix2s
data_cov
;
data_cov
.
setIdentity
();
TimeStamp
t
=
0.0
;
...
...
@@ -336,6 +333,61 @@ TEST_F(ProcessorDiffDriveTest, process)
problem
->
print
(
4
,
1
,
1
,
1
);
}
TEST_F
(
ProcessorDiffDriveTest
,
linear
)
{
Vector2s
data
;
Matrix2s
data_cov
;
data_cov
.
setIdentity
();
TimeStamp
t
=
0.0
;
Vector3s
x
(
0
,
0
,
0
);
Matrix3s
P
;
P
.
setIdentity
();
auto
F0
=
problem
->
setPrior
(
x
,
P
,
t
,
0.1
);
// Straight one turn of the wheels, in one go
data
(
0
)
=
100.0
;
// one turn of the wheels
data
(
1
)
=
100.0
;
auto
C
=
std
::
make_shared
<
CaptureDiffDrive
>
(
t
,
sensor
,
data
,
data_cov
,
F0
);
C
->
process
();
WOLF_TRACE
(
"t = "
,
t
,
"; x = "
,
processor
->
getCurrentState
().
transpose
());
// radius is 1.0m, 100 ticks per revolution, so advanced distance is
Scalar
distance
=
2
*
M_PI
*
1.0
;
ASSERT_MATRIX_APPROX
(
processor
->
getCurrentState
(),
Vector3s
(
distance
,
0
,
0
),
1e-6
)
}
TEST_F
(
ProcessorDiffDriveTest
,
angular
)
{
Vector2s
data
;
Matrix2s
data_cov
;
data_cov
.
setIdentity
();
TimeStamp
t
=
0.0
;
Vector3s
x
(
0
,
0
,
0
);
Matrix3s
P
;
P
.
setIdentity
();
auto
F0
=
problem
->
setPrior
(
x
,
P
,
t
,
0.1
);
// Straight one turn of the wheels, in one go
data
(
0
)
=
-
20.0
;
// one fifth of a turn of the left wheel, in reverse
data
(
1
)
=
20.0
;
// one fifth of a turn of the right wheel, forward --> we'll turn left --> positive angle
auto
C
=
std
::
make_shared
<
CaptureDiffDrive
>
(
t
,
sensor
,
data
,
data_cov
,
F0
);
C
->
process
();
WOLF_TRACE
(
"t = "
,
t
,
"; x = "
,
processor
->
getCurrentState
().
transpose
());
// this is a turn in place, so distance = 0;
Scalar
distance
=
0.0
;
// radius is 1.0m, 100 ticks per revolution, and wheel separation is 1m, so turn angle is
Scalar
angle
=
pi2pi
(
2
*
M_PI
*
1.0
/
0.5
/
5
);
ASSERT_MATRIX_APPROX
(
processor
->
getCurrentState
(),
Vector3s
(
distance
,
0
,
angle
),
1e-6
)
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment