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
636e552e
Commit
636e552e
authored
3 years ago
by
Mederic Fourmy
Browse files
Options
Downloads
Patches
Plain Diff
[skip-ci] fix the ::getState() bug but gtest_has_state_blocks fails
parent
0b9f635b
No related branches found
No related tags found
1 merge request
!450
Resolve "HasStateBlocks::getState behaves in a non predictible way"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/core/state_block/has_state_blocks.h
+4
-8
4 additions, 8 deletions
include/core/state_block/has_state_blocks.h
with
4 additions
and
8 deletions
include/core/state_block/has_state_blocks.h
+
4
−
8
View file @
636e552e
...
@@ -341,11 +341,7 @@ inline void HasStateBlocks::setState(const StateStructure& _structure, const std
...
@@ -341,11 +341,7 @@ inline void HasStateBlocks::setState(const StateStructure& _structure, const std
//// _structure can be either stateblock structure of the node or a subset of this structure
//// _structure can be either stateblock structure of the node or a subset of this structure
inline
VectorXd
HasStateBlocks
::
getStateVector
(
const
StateStructure
&
_structure
)
const
inline
VectorXd
HasStateBlocks
::
getStateVector
(
const
StateStructure
&
_structure
)
const
{
{
StateStructure
structure
;
const
StateStructure
&
structure
=
(
_structure
==
""
?
structure_
:
_structure
);
if
(
_structure
==
""
)
structure
=
structure_
;
else
structure
=
_structure
;
VectorXd
state
(
getSize
(
structure
));
VectorXd
state
(
getSize
(
structure
));
...
@@ -370,11 +366,11 @@ inline VectorComposite HasStateBlocks::getState(const StateStructure& _structure
...
@@ -370,11 +366,11 @@ inline VectorComposite HasStateBlocks::getState(const StateStructure& _structure
for
(
const
auto
key
:
structure
)
for
(
const
auto
key
:
structure
)
{
{
auto
s
tate_it
=
s
tate
_b
lock
_map_
.
find
(
key
);
const
auto
&
s
b
=
getS
tate
B
lock
(
key
);
if
(
state_it
!=
s
tate
_b
lock
_map_
.
end
())
assert
(
sb
!=
nullptr
&&
"Requested S
tate
B
lock
key not in the structure"
);
state
.
emplace
(
key
,
s
tate_it
->
second
->
getState
());
state
.
emplace
(
key
,
s
b
->
getState
());
}
}
return
state
;
return
state
;
...
...
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