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
8c8b4dff
Commit
8c8b4dff
authored
5 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Add test for re-notification after solve
parent
3d5e2504
No related branches found
No related tags found
1 merge request
!341
Resolve "HasStateBlocks::addStateBlock() needs to register SB's"
Pipeline
#4973
passed
5 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/solver/solver_manager.cpp
+1
-1
1 addition, 1 deletion
src/solver/solver_manager.cpp
test/gtest_has_state_blocks.cpp
+45
-0
45 additions, 0 deletions
test/gtest_has_state_blocks.cpp
with
46 additions
and
1 deletion
src/solver/solver_manager.cpp
+
1
−
1
View file @
8c8b4dff
...
...
@@ -50,7 +50,7 @@ void SolverManager::update()
}
else
{
WOLF_DEBUG
(
"Tried to add a
n
already added !"
);
WOLF_DEBUG
(
"Tried to add a
StateBlock that was
already added !"
);
}
}
else
...
...
This diff is collapsed.
Click to expand it.
test/gtest_has_state_blocks.cpp
+
45
−
0
View file @
8c8b4dff
...
...
@@ -12,6 +12,7 @@
#include
"core/sensor/sensor_base.h"
#include
"core/landmark/landmark_base.h"
#include
"core/state_block/state_quaternion.h"
#include
"core/ceres_wrapper/ceres_manager.h"
using
namespace
wolf
;
...
...
@@ -108,6 +109,50 @@ TEST_F(HasStateBlocksTest, Notifications_addStateBlock)
}
TEST_F
(
HasStateBlocksTest
,
Add_solve_notify_solve_add
)
{
CeresManagerPtr
solver
=
std
::
make_shared
<
CeresManager
>
(
problem
);
Notification
n
;
// Add SB, make KF
ASSERT_FALSE
(
problem
->
getStateBlockNotification
(
sbp0
,
n
));
F0
->
link
(
problem
->
getTrajectory
());
F0
->
addStateBlock
(
"V"
,
sbv0
);
F0
->
setKey
();
ASSERT_TRUE
(
problem
->
getStateBlockNotification
(
sbv0
,
n
));
ASSERT_EQ
(
n
,
ADD
);
// solve. This will clear all notifications
std
::
string
report
=
solver
->
solve
(
SolverManager
::
ReportVerbosity
::
FULL
);
ASSERT_FALSE
(
problem
->
getStateBlockNotification
(
sbv0
,
n
));
// Notify again the same SB
problem
->
notifyStateBlock
(
sbv0
,
ADD
);
ASSERT_TRUE
(
problem
->
getStateBlockNotification
(
sbv0
,
n
));
ASSERT_EQ
(
n
,
ADD
);
// solve again
report
=
solver
->
solve
(
SolverManager
::
ReportVerbosity
::
FULL
);
ASSERT_FALSE
(
problem
->
getStateBlockNotification
(
sbv0
,
n
));
// Add again the same SB. This should crash
ASSERT_DEATH
(
F0
->
addStateBlock
(
"V"
,
sbv0
)
,
""
);
}
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