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
a6df126e
Commit
a6df126e
authored
6 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
implementation new getters
parent
8272212f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!272
Problem notification lists API
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/base/problem/problem.h
+2
-33
2 additions, 33 deletions
include/base/problem/problem.h
src/problem/problem.cpp
+20
-0
20 additions, 0 deletions
src/problem/problem.cpp
with
22 additions
and
33 deletions
include/base/problem/problem.h
+
2
−
33
View file @
a6df126e
...
...
@@ -252,13 +252,9 @@ class Problem : public std::enable_shared_from_this<Problem>
*/
void
removeStateBlock
(
StateBlockPtr
_state_ptr
);
/** \brief Returns the size of the map of state block notification
*/
SizeStd
getStateBlockNotificationMapSize
()
const
;
/** \brief Returns if the state block has been notified, and the notification via parameter
/** \brief Returns the map of factor notification to be handled by the solver (the map stored in this is emptied)
*/
bool
get
StateBlockNotification
(
cons
t
StateBlock
Ptr
&
sb_ptr
,
Notification
&
notif
)
const
;
std
::
map
<
StateBlock
Ptr
,
Notification
>
cons
ume
StateBlock
NotificationMap
()
;
/** \brief Notifies a new factor to be added to the solver manager
*/
...
...
@@ -268,24 +264,10 @@ class Problem : public std::enable_shared_from_this<Problem>
*/
void
removeFactor
(
FactorBasePtr
_factor_ptr
);
/** \brief Returns the size of the map of factor notification
*/
SizeStd
getFactorNotificationMapSize
()
const
;
/** \brief Returns if the factor has been notified, and the notification via parameter
*/
bool
getFactorNotification
(
const
FactorBasePtr
&
fac_ptr
,
Notification
&
notif
)
const
;
protected:
/** \brief Returns the map of state block notification to be handled by the solver (the map stored in this is emptied)
*/
std
::
map
<
StateBlockPtr
,
Notification
>
consumeStateBlockNotificationMap
();
/** \brief Returns the map of factor notification to be handled by the solver (the map stored in this is emptied)
*/
std
::
map
<
FactorBasePtr
,
Notification
>
consumeFactorNotificationMap
();
public:
// Print and check ---------------------------------------
/**
* \brief print wolf tree
...
...
@@ -329,25 +311,12 @@ inline std::map<StateBlockPtr,Notification> Problem::consumeStateBlockNotificati
return
std
::
move
(
state_block_notification_map_
);
}
inline
SizeStd
Problem
::
getStateBlockNotificationMapSize
()
const
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mut_state_block_notifications_
);
return
state_block_notification_map_
.
size
();
}
inline
std
::
map
<
FactorBasePtr
,
Notification
>
Problem
::
consumeFactorNotificationMap
()
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mut_factor_notifications_
);
return
std
::
move
(
factor_notification_map_
);
}
inline
wolf
::
SizeStd
Problem
::
getFactorNotificationMapSize
()
const
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mut_factor_notifications_
);
return
factor_notification_map_
.
size
();
}
}
// namespace wolf
#endif // PROBLEM_H
This diff is collapsed.
Click to expand it.
src/problem/problem.cpp
+
20
−
0
View file @
a6df126e
...
...
@@ -401,6 +401,16 @@ void Problem::removeStateBlock(StateBlockPtr _state_ptr)
state_block_notification_map_
[
_state_ptr
]
=
REMOVE
;
}
bool
Problem
::
getStateBlockNotification
(
const
StateBlockPtr
&
sb_ptr
,
Notification
&
notif
)
const
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mut_state_block_notifications_
);
if
(
state_block_notification_map_
.
find
(
sb_ptr
)
==
state_block_notification_map_
.
end
())
return
false
;
notif
=
state_block_notification_map_
.
at
(
sb_ptr
);
return
true
;
}
FactorBasePtr
Problem
::
addFactor
(
FactorBasePtr
_factor_ptr
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mut_factor_notifications_
);
...
...
@@ -442,6 +452,16 @@ void Problem::removeFactor(FactorBasePtr _factor_ptr)
factor_notification_map_
[
_factor_ptr
]
=
REMOVE
;
}
bool
Problem
::
getFactorNotification
(
const
FactorBasePtr
&
fac_ptr
,
Notification
&
notif
)
const
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mut_factor_notifications_
);
if
(
factor_notification_map_
.
find
(
fac_ptr
)
==
factor_notification_map_
.
end
())
return
false
;
notif
=
factor_notification_map_
.
at
(
fac_ptr
);
return
true
;
}
void
Problem
::
clearCovariance
()
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
mut_covariances_
);
...
...
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