Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gnss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
plugins
gnss
Commits
c15591a1
Commit
c15591a1
authored
7 years ago
by
Jeremie Deray
Browse files
Options
Downloads
Patches
Plain Diff
problem fix new state_block notifications
parent
5b9f605a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/problem.cpp
+14
-14
14 additions, 14 deletions
src/problem.cpp
src/problem.h
+8
-14
8 additions, 14 deletions
src/problem.h
with
22 additions
and
28 deletions
src/problem.cpp
+
14
−
14
View file @
c15591a1
...
@@ -371,8 +371,13 @@ StateBlockPtr Problem::addStateBlock(StateBlockPtr _state_ptr)
...
@@ -371,8 +371,13 @@ StateBlockPtr Problem::addStateBlock(StateBlockPtr _state_ptr)
// add the state unit to the list
// add the state unit to the list
state_block_list_
.
push_back
(
_state_ptr
);
state_block_list_
.
push_back
(
_state_ptr
);
// queue for solver manager
// queue for solver manager
state_block_notification_list_
.
push_back
(
StateBlockNotification
({
ADD
,
_state_ptr
}));
_state_ptr
->
addNotification
(
StateBlock
::
Notification
::
ADD
);
notified_state_block_list_
.
push_back
(
_state_ptr
);
notified_state_block_list_
.
sort
();
notified_state_block_list_
.
unique
();
return
_state_ptr
;
return
_state_ptr
;
}
}
...
@@ -381,7 +386,10 @@ void Problem::updateStateBlockPtr(StateBlockPtr _state_ptr)
...
@@ -381,7 +386,10 @@ void Problem::updateStateBlockPtr(StateBlockPtr _state_ptr)
//std::cout << "Problem::updateStateBlockPtr " << _state_ptr.get() << std::endl;
//std::cout << "Problem::updateStateBlockPtr " << _state_ptr.get() << std::endl;
// queue for solver manager
// queue for solver manager
state_block_notification_list_
.
push_back
(
StateBlockNotification
({
UPDATE
,
_state_ptr
}));
_state_ptr
->
addNotification
(
StateBlock
::
Notification
::
FIX_UPDATE
);
notified_state_block_list_
.
push_back
(
_state_ptr
);
notified_state_block_list_
.
sort
();
notified_state_block_list_
.
unique
();
}
}
void
Problem
::
removeStateBlockPtr
(
StateBlockPtr
_state_ptr
)
void
Problem
::
removeStateBlockPtr
(
StateBlockPtr
_state_ptr
)
...
@@ -391,19 +399,11 @@ void Problem::removeStateBlockPtr(StateBlockPtr _state_ptr)
...
@@ -391,19 +399,11 @@ void Problem::removeStateBlockPtr(StateBlockPtr _state_ptr)
// add the state unit to the list
// add the state unit to the list
state_block_list_
.
remove
(
_state_ptr
);
state_block_list_
.
remove
(
_state_ptr
);
// Check if the state addition is still as a notification
auto
state_notif_it
=
state_block_notification_list_
.
begin
();
for
(;
state_notif_it
!=
state_block_notification_list_
.
end
();
state_notif_it
++
)
if
(
state_notif_it
->
notification_
==
ADD
&&
state_notif_it
->
state_block_ptr_
==
_state_ptr
)
break
;
// Remove addition notification
if
(
state_notif_it
!=
state_block_notification_list_
.
end
())
state_block_notification_list_
.
erase
(
state_notif_it
);
// Add remove notification
// Add remove notification
else
_state_ptr
->
addNotification
(
StateBlock
::
Notification
::
REMOVE
);
state_block_notification_list_
.
push_back
(
StateBlockNotification
({
REMOVE
,
_state_ptr
}));
notified_state_block_list_
.
push_back
(
_state_ptr
);
notified_state_block_list_
.
sort
();
notified_state_block_list_
.
unique
();
}
}
ConstraintBasePtr
Problem
::
addConstraintPtr
(
ConstraintBasePtr
_constraint_ptr
)
ConstraintBasePtr
Problem
::
addConstraintPtr
(
ConstraintBasePtr
_constraint_ptr
)
...
...
This diff is collapsed.
Click to expand it.
src/problem.h
+
8
−
14
View file @
c15591a1
...
@@ -29,11 +29,7 @@ enum Notification
...
@@ -29,11 +29,7 @@ enum Notification
REMOVE
,
REMOVE
,
UPDATE
UPDATE
};
};
struct
StateBlockNotification
{
Notification
notification_
;
StateBlockPtr
state_block_ptr_
;
};
struct
ConstraintNotification
struct
ConstraintNotification
{
{
Notification
notification_
;
Notification
notification_
;
...
@@ -53,10 +49,10 @@ class Problem : public std::enable_shared_from_this<Problem>
...
@@ -53,10 +49,10 @@ class Problem : public std::enable_shared_from_this<Problem>
ProcessorMotionPtr
processor_motion_ptr_
;
ProcessorMotionPtr
processor_motion_ptr_
;
StateBlockList
state_block_list_
;
StateBlockList
state_block_list_
;
std
::
map
<
std
::
pair
<
StateBlockPtr
,
StateBlockPtr
>
,
Eigen
::
MatrixXs
>
covariances_
;
std
::
map
<
std
::
pair
<
StateBlockPtr
,
StateBlockPtr
>
,
Eigen
::
MatrixXs
>
covariances_
;
std
::
list
<
StateBlockNotification
>
state_block_notification_list_
;
std
::
list
<
ConstraintNotification
>
constraint_notification_list_
;
std
::
list
<
ConstraintNotification
>
constraint_notification_list_
;
bool
prior_is_set_
;
bool
prior_is_set_
;
Size
state_size_
,
state_cov_size_
;
Size
state_size_
,
state_cov_size_
;
StateBlockList
notified_state_block_list_
;
private:
// CAUTION: THESE METHODS ARE PRIVATE, DO NOT MAKE THEM PUBLIC !!
private:
// CAUTION: THESE METHODS ARE PRIVATE, DO NOT MAKE THEM PUBLIC !!
Problem
(
const
std
::
string
&
_frame_structure
);
// USE create() below !!
Problem
(
const
std
::
string
&
_frame_structure
);
// USE create() below !!
...
@@ -278,10 +274,9 @@ class Problem : public std::enable_shared_from_this<Problem>
...
@@ -278,10 +274,9 @@ class Problem : public std::enable_shared_from_this<Problem>
*/
*/
void
removeStateBlockPtr
(
StateBlockPtr
_state_ptr
);
void
removeStateBlockPtr
(
StateBlockPtr
_state_ptr
);
/** \brief Gets a
queue
of state blocks
notification
to be handled by the solver
/** \brief Gets a
list
of state blocks
which state has been changed
to be handled by the solver
*/
*/
std
::
list
<
StateBlockNotification
>&
getStateBlockNotificationList
();
StateBlockList
&
getNotifiedStateBlockList
();
/** \brief Gets a queue of constraint notification to be handled by the solver
/** \brief Gets a queue of constraint notification to be handled by the solver
*/
*/
...
@@ -331,16 +326,15 @@ inline ProcessorMotionPtr& Problem::getProcessorMotionPtr()
...
@@ -331,16 +326,15 @@ inline ProcessorMotionPtr& Problem::getProcessorMotionPtr()
return
processor_motion_ptr_
;
return
processor_motion_ptr_
;
}
}
inline
std
::
list
<
StateBlockNotification
>&
Problem
::
getStateBlockNotificationList
()
{
return
state_block_notification_list_
;
}
inline
std
::
list
<
ConstraintNotification
>&
Problem
::
getConstraintNotificationList
()
inline
std
::
list
<
ConstraintNotification
>&
Problem
::
getConstraintNotificationList
()
{
{
return
constraint_notification_list_
;
return
constraint_notification_list_
;
}
}
inline
StateBlockList
&
Problem
::
getNotifiedStateBlockList
()
{
return
notified_state_block_list_
;
}
}
// namespace wolf
}
// namespace wolf
...
...
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