Skip to content
Snippets Groups Projects
Commit 5267ac22 authored by Jeremie Deray's avatar Jeremie Deray
Browse files

update StateBlock notificationList

parent 57927e1d
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !138. Comments created here will be created in the context of that merge request.
......@@ -365,6 +365,11 @@ StateBlockPtr Problem::addStateBlock(StateBlockPtr _state_ptr)
state_block_list_.push_back(_state_ptr);
// queue for solver manager
state_block_notification_list_.push_back(StateBlockNotification({ADD,_state_ptr}));
_state_ptr->notify(StateBlock::Notification::ADD);
notified_state_block_list_.push_back(_state_ptr);
notified_state_block_list_.unique();
return _state_ptr;
}
......@@ -374,6 +379,10 @@ void Problem::updateStateBlockPtr(StateBlockPtr _state_ptr)
// queue for solver manager
state_block_notification_list_.push_back(StateBlockNotification({UPDATE,_state_ptr}));
_state_ptr->notify(StateBlock::Notification::FIX_UPDATE);
notified_state_block_list_.push_back(_state_ptr);
notified_state_block_list_.unique();
}
void Problem::removeStateBlockPtr(StateBlockPtr _state_ptr)
......@@ -396,6 +405,9 @@ void Problem::removeStateBlockPtr(StateBlockPtr _state_ptr)
else
state_block_notification_list_.push_back(StateBlockNotification({REMOVE, _state_ptr}));
_state_ptr->notify(StateBlock::Notification::REMOVE);
notified_state_block_list_.push_back(_state_ptr);
notified_state_block_list_.unique();
}
ConstraintBasePtr Problem::addConstraintPtr(ConstraintBasePtr _constraint_ptr)
......
......@@ -54,6 +54,7 @@ class Problem : public std::enable_shared_from_this<Problem>
std::map<std::pair<StateBlockPtr, StateBlockPtr>, Eigen::MatrixXs> covariances_;
std::list<StateBlockNotification> state_block_notification_list_;
std::list<ConstraintNotification> constraint_notification_list_;
StateBlockList notified_state_block_list_;
bool origin_is_set_;
private: // CAUTION: THESE METHODS ARE PRIVATE, DO NOT MAKE THEM PUBLIC !!
......@@ -274,6 +275,9 @@ class Problem : public std::enable_shared_from_this<Problem>
*/
std::list<StateBlockNotification>& getStateBlockNotificationList();
/** \brief Gets a list of state blocks which state has been changed to be handled by the solver
*/
StateBlockList& getNotifiedStateBlockList();
/** \brief Gets a queue of constraint notification to be handled by the solver
*/
......@@ -322,6 +326,10 @@ inline std::list<ConstraintNotification>& Problem::getConstraintNotificationList
return constraint_notification_list_;
}
inline StateBlockList& Problem::getNotifiedStateBlockList()
{
return notified_state_block_list_;
}
} // namespace wolf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment