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
5f1b7aa3
Commit
5f1b7aa3
authored
5 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
new typedef StateBlockMap
parent
38b69508
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?"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/core/state_block/has_state_blocks.h
+8
-6
8 additions, 6 deletions
include/core/state_block/has_state_blocks.h
with
8 additions
and
6 deletions
include/core/state_block/has_state_blocks.h
+
8
−
6
View file @
5f1b7aa3
...
...
@@ -16,6 +16,8 @@
namespace
wolf
{
typedef
std
::
unordered_map
<
std
::
string
,
StateBlockPtr
>
StateBlockMap
;
class
HasStateBlocks
{
...
...
@@ -28,7 +30,7 @@ class HasStateBlocks
void
appendToStructure
(
const
std
::
string
&
_frame_type
){
structure_
+=
_frame_type
;
}
bool
isInStructure
(
const
std
::
string
&
_sb_type
)
{
return
structure_
.
find
(
_sb_type
)
!=
std
::
string
::
npos
;
}
const
std
::
unordered_map
<
std
::
string
,
StateBlock
Ptr
>
&
getStateBlockMap
()
const
;
const
StateBlock
Map
&
getStateBlockMap
()
const
;
std
::
vector
<
StateBlockPtr
>
getStateBlockVec
()
const
;
// Some typical shortcuts -- not all should be coded here, see notes below.
...
...
@@ -52,7 +54,7 @@ class HasStateBlocks
bool
setStateBlock
(
const
std
::
string
_sb_type
,
const
StateBlockPtr
&
_sb
);
bool
setStateBlock
(
const
char
_sb_type
,
const
StateBlockPtr
&
_sb
)
{
return
setStateBlock
(
std
::
string
(
1
,
_sb_type
),
_sb
);
}
bool
stateBlockKey
(
const
StateBlockPtr
&
_sb
,
std
::
string
&
_key
)
const
;
std
::
unordered_map
<
std
::
string
,
StateBlock
Ptr
>
::
const_iterator
find
(
const
StateBlockPtr
&
_sb
)
const
;
StateBlock
Map
::
const_iterator
find
(
const
StateBlockPtr
&
_sb
)
const
;
// Emplace derived state blocks (angle, quaternion, etc).
template
<
typename
SB
,
typename
...
Args
>
...
...
@@ -85,8 +87,8 @@ class HasStateBlocks
private
:
StateStructure
structure_
;
// TBR
std
::
unordered_map
<
std
::
string
,
StateBlock
Ptr
>
state_block_map_
;
StateStructure
structure_
;
// TBR
StateBlock
Map
state_block_map_
;
};
...
...
@@ -111,7 +113,7 @@ inline HasStateBlocks::~HasStateBlocks()
//
}
inline
const
std
::
unordered_map
<
std
::
string
,
StateBlock
Ptr
>
&
HasStateBlocks
::
getStateBlockMap
()
const
inline
const
StateBlock
Map
&
HasStateBlocks
::
getStateBlockMap
()
const
{
return
state_block_map_
;
}
...
...
@@ -266,7 +268,7 @@ inline Eigen::VectorXd HasStateBlocks::getState(const StateStructure& _sub_struc
return
state
;
}
inline
std
::
unordered_map
<
std
::
string
,
StateBlock
Ptr
>
::
const_iterator
HasStateBlocks
::
find
(
const
StateBlockPtr
&
_sb
)
const
inline
StateBlock
Map
::
const_iterator
HasStateBlocks
::
find
(
const
StateBlockPtr
&
_sb
)
const
{
const
auto
&
it
=
std
::
find_if
(
state_block_map_
.
begin
(),
state_block_map_
.
end
(),
...
...
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