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
6bd43e35
Commit
6bd43e35
authored
5 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug in structure.find()
parent
b4d7cb66
No related branches found
No related tags found
2 merge requests
!358
WIP: Resolve "Complete state vector new data structure?"
,
!343
WIP: Resolve "Complete state vector new data structure?"
Pipeline
#5114
passed
5 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/core/state_block/has_state_blocks.h
+2
-2
2 additions, 2 deletions
include/core/state_block/has_state_blocks.h
with
2 additions
and
2 deletions
include/core/state_block/has_state_blocks.h
+
2
−
2
View file @
6bd43e35
...
@@ -25,7 +25,7 @@ class HasStateBlocks
...
@@ -25,7 +25,7 @@ class HasStateBlocks
const
StateStructure
&
getStructure
()
const
{
return
structure_
;
}
const
StateStructure
&
getStructure
()
const
{
return
structure_
;
}
void
appendToStructure
(
const
std
::
string
&
_frame_type
){
structure_
+=
_frame_type
;
}
void
appendToStructure
(
const
std
::
string
&
_frame_type
){
structure_
+=
_frame_type
;
}
bool
isInStructure
(
const
std
::
string
&
_sb_type
)
{
return
structure_
.
find
(
_sb_type
);
}
bool
isInStructure
(
const
std
::
string
&
_sb_type
)
{
return
structure_
.
find
(
_sb_type
)
!=
std
::
string
::
npos
;
}
const
std
::
unordered_map
<
std
::
string
,
StateBlockPtr
>&
getStateBlockMap
()
const
;
const
std
::
unordered_map
<
std
::
string
,
StateBlockPtr
>&
getStateBlockMap
()
const
;
std
::
vector
<
StateBlockPtr
>
getStateBlockVec
()
const
;
std
::
vector
<
StateBlockPtr
>
getStateBlockVec
()
const
;
...
@@ -156,7 +156,7 @@ inline StateBlockPtr HasStateBlocks::emplaceStateBlock(const std::string& _sb_ty
...
@@ -156,7 +156,7 @@ inline StateBlockPtr HasStateBlocks::emplaceStateBlock(const std::string& _sb_ty
inline
bool
HasStateBlocks
::
setStateBlock
(
const
std
::
string
_sb_type
,
const
StateBlockPtr
&
_sb
)
inline
bool
HasStateBlocks
::
setStateBlock
(
const
std
::
string
_sb_type
,
const
StateBlockPtr
&
_sb
)
{
{
assert
(
structure_
.
find
(
_sb_type
)
&&
"Cannot set a state block out of the state structure! Use addStateBlock instead."
);
assert
(
structure_
.
find
(
_sb_type
)
!=
std
::
string
::
npos
&&
"Cannot set a state block out of the state structure! Use addStateBlock instead."
);
assert
(
state_block_map_
.
count
(
_sb_type
)
>
0
&&
"Cannot set an inexistent state block! Use addStateBlock instead."
);
assert
(
state_block_map_
.
count
(
_sb_type
)
>
0
&&
"Cannot set an inexistent state block! Use addStateBlock instead."
);
state_block_map_
.
at
(
_sb_type
)
=
_sb
;
state_block_map_
.
at
(
_sb_type
)
=
_sb
;
return
true
;
// success
return
true
;
// success
...
...
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