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
3cd5d50a
Commit
3cd5d50a
authored
7 years ago
by
Jeremie Deray
Browse files
Options
Downloads
Patches
Plain Diff
fix StateBlock notification mechanism
parent
fb00557a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/state_block.h
+89
-1
89 additions, 1 deletion
src/state_block.h
with
89 additions
and
1 deletion
src/state_block.h
+
89
−
1
View file @
3cd5d50a
...
...
@@ -113,6 +113,8 @@ public:
void
removeLocalParametrization
();
/// @todo Solely the solver should be able to
/// pass Notification::ENABLED !
void
notify
(
const
StateBlock
::
Notification
n
);
StateBlock
::
Notification
notify
()
const
noexcept
;
...
...
@@ -126,6 +128,7 @@ public:
namespace
wolf
{
inline
StateBlock
::
StateBlock
(
const
Eigen
::
VectorXs
_state
,
bool
_fixed
,
LocalParametrizationBasePtr
_local_param_ptr
)
:
notification_
(
Notification
::
ADD
),
node_ptr_
(),
// nullptr
fixed_
(
_fixed
),
state_
(
_state
),
...
...
@@ -135,6 +138,7 @@ inline StateBlock::StateBlock(const Eigen::VectorXs _state, bool _fixed, LocalPa
}
inline
StateBlock
::
StateBlock
(
const
unsigned
int
_size
,
bool
_fixed
,
LocalParametrizationBasePtr
_local_param_ptr
)
:
notification_
(
Notification
::
ADD
),
node_ptr_
(),
// nullptr
fixed_
(
_fixed
),
state_
(
Eigen
::
VectorXs
::
Zero
(
_size
)),
...
...
@@ -216,7 +220,91 @@ inline void StateBlock::setLocalParametrizationPtr(LocalParametrizationBasePtr _
inline
void
StateBlock
::
notify
(
const
StateBlock
::
Notification
n
)
{
notification_
=
n
;
/// @todo replace diz mess by a simple
/// extendable state-machine
switch
(
notification_
)
{
case
Notification
::
ADD
:
{
switch
(
n
)
{
case
Notification
::
ADD
:
case
Notification
::
FIX_UPDATE
:
case
Notification
::
UPDATE
:
break
;
// if any of those 3, do nothing
case
Notification
::
ENABLED
:
case
Notification
::
REMOVE
:
// if any of those 2, change notif
{
notification_
=
n
;
break
;
}
}
break
;
}
case
Notification
::
ENABLED
:
{
switch
(
n
)
{
case
Notification
::
ADD
:
//throw std::runtime_error("Tried to ADD again an existing StateBlock !"); break;
case
Notification
::
ENABLED
:
break
;
case
Notification
::
REMOVE
:
case
Notification
::
FIX_UPDATE
:
case
Notification
::
UPDATE
:
{
notification_
=
n
;
break
;
}
}
break
;
}
case
Notification
::
FIX_UPDATE
:
{
switch
(
n
)
{
case
Notification
::
ADD
:
//throw std::runtime_error("Tried to ADD again an existing StateBlock !"); break;
case
Notification
::
FIX_UPDATE
:
break
;
case
Notification
::
UPDATE
:
// We should have UPDATE & FIX_UPDATE !
case
Notification
::
REMOVE
:
case
Notification
::
ENABLED
:
{
notification_
=
n
;
break
;
}
}
break
;
}
case
Notification
::
REMOVE
:
{
switch
(
n
)
{
case
Notification
::
ADD
:
/// @note moving from remove to add goes to add again ?
{
notification_
=
Notification
::
ENABLED
;
break
;
}
case
Notification
::
ENABLED
:
throw
std
::
runtime_error
(
"Tried to ENABLED a StateBlock marked for REMOVE!"
);
break
;
case
Notification
::
FIX_UPDATE
:
// We should have UPDATE & FIX_UPDATE !
case
Notification
::
UPDATE
:
case
Notification
::
REMOVE
:
break
;
}
break
;
}
case
Notification
::
UPDATE
:
{
switch
(
n
)
{
case
Notification
::
ADD
:
//throw std::runtime_error("Tried to ADD again an existing StateBlock !"); break;
case
Notification
::
UPDATE
:
break
;
case
Notification
::
FIX_UPDATE
:
case
Notification
::
REMOVE
:
case
Notification
::
ENABLED
:
{
notification_
=
n
;
break
;
}
}
break
;
}
}
}
inline
StateBlock
::
Notification
StateBlock
::
notify
()
const
noexcept
...
...
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