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
421c7733
Commit
421c7733
authored
6 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
added dim_ and getDim() in problem
parent
54855703
No related branches found
No related tags found
1 merge request
!240
Added Problem::dim_ and Problem::getDim()
Pipeline
#2454
passed
6 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/problem.cpp
+8
-2
8 additions, 2 deletions
src/problem.cpp
src/problem.h
+2
-1
2 additions, 1 deletion
src/problem.h
with
10 additions
and
3 deletions
src/problem.cpp
+
8
−
2
View file @
421c7733
...
@@ -36,25 +36,26 @@ Problem::Problem(const std::string& _frame_structure) :
...
@@ -36,25 +36,26 @@ Problem::Problem(const std::string& _frame_structure) :
trajectory_ptr_
(
std
::
make_shared
<
TrajectoryBase
>
(
_frame_structure
)),
trajectory_ptr_
(
std
::
make_shared
<
TrajectoryBase
>
(
_frame_structure
)),
map_ptr_
(
std
::
make_shared
<
MapBase
>
()),
map_ptr_
(
std
::
make_shared
<
MapBase
>
()),
processor_motion_ptr_
(),
processor_motion_ptr_
(),
state_size_
(
0
),
state_cov_size_
(
0
),
prior_is_set_
(
false
)
prior_is_set_
(
false
)
{
{
if
(
_frame_structure
==
"PO 2D"
)
if
(
_frame_structure
==
"PO 2D"
)
{
{
state_size_
=
3
;
state_size_
=
3
;
state_cov_size_
=
3
;
state_cov_size_
=
3
;
dim_
=
2
;
}
}
else
if
(
_frame_structure
==
"PO 3D"
)
else
if
(
_frame_structure
==
"PO 3D"
)
{
{
state_size_
=
7
;
state_size_
=
7
;
state_cov_size_
=
6
;
state_cov_size_
=
6
;
dim_
=
3
;
}
}
else
if
(
_frame_structure
==
"POV 3D"
)
else
if
(
_frame_structure
==
"POV 3D"
)
{
{
state_size_
=
10
;
state_size_
=
10
;
state_cov_size_
=
9
;
state_cov_size_
=
9
;
dim_
=
3
;
}
}
else
std
::
runtime_error
(
else
std
::
runtime_error
(
"Problem::Problem(): Unknown frame structure. Add appropriate frame structure to the switch statement."
);
"Problem::Problem(): Unknown frame structure. Add appropriate frame structure to the switch statement."
);
...
@@ -315,6 +316,11 @@ void Problem::getFrameStructureSize(SizeEigen& _x_size, SizeEigen& _cov_size) co
...
@@ -315,6 +316,11 @@ void Problem::getFrameStructureSize(SizeEigen& _x_size, SizeEigen& _cov_size) co
_cov_size
=
state_cov_size_
;
_cov_size
=
state_cov_size_
;
}
}
SizeEigen
Problem
::
getDim
()
const
{
return
dim_
;
}
Eigen
::
VectorXs
Problem
::
zeroState
()
Eigen
::
VectorXs
Problem
::
zeroState
()
{
{
Eigen
::
VectorXs
state
=
Eigen
::
VectorXs
::
Zero
(
getFrameStructureSize
());
Eigen
::
VectorXs
state
=
Eigen
::
VectorXs
::
Zero
(
getFrameStructureSize
());
...
...
This diff is collapsed.
Click to expand it.
src/problem.h
+
2
−
1
View file @
421c7733
...
@@ -42,7 +42,7 @@ class Problem : public std::enable_shared_from_this<Problem>
...
@@ -42,7 +42,7 @@ class Problem : public std::enable_shared_from_this<Problem>
ProcessorMotionPtr
processor_motion_ptr_
;
ProcessorMotionPtr
processor_motion_ptr_
;
StateBlockList
state_block_list_
;
StateBlockList
state_block_list_
;
std
::
map
<
std
::
pair
<
StateBlockPtr
,
StateBlockPtr
>
,
Eigen
::
MatrixXs
>
covariances_
;
std
::
map
<
std
::
pair
<
StateBlockPtr
,
StateBlockPtr
>
,
Eigen
::
MatrixXs
>
covariances_
;
SizeEigen
state_size_
,
state_cov_size_
;
SizeEigen
state_size_
,
state_cov_size_
,
dim_
;
std
::
map
<
ConstraintBasePtr
,
Notification
>
constraint_notification_map_
;
std
::
map
<
ConstraintBasePtr
,
Notification
>
constraint_notification_map_
;
std
::
map
<
StateBlockPtr
,
Notification
>
state_block_notification_map_
;
std
::
map
<
StateBlockPtr
,
Notification
>
state_block_notification_map_
;
bool
prior_is_set_
;
bool
prior_is_set_
;
...
@@ -58,6 +58,7 @@ class Problem : public std::enable_shared_from_this<Problem>
...
@@ -58,6 +58,7 @@ class Problem : public std::enable_shared_from_this<Problem>
// Properties -----------------------------------------
// Properties -----------------------------------------
SizeEigen
getFrameStructureSize
()
const
;
SizeEigen
getFrameStructureSize
()
const
;
void
getFrameStructureSize
(
SizeEigen
&
_x_size
,
SizeEigen
&
_cov_size
)
const
;
void
getFrameStructureSize
(
SizeEigen
&
_x_size
,
SizeEigen
&
_cov_size
)
const
;
SizeEigen
getDim
()
const
;
// Hardware branch ------------------------------------
// Hardware branch ------------------------------------
HardwareBasePtr
getHardwarePtr
();
HardwareBasePtr
getHardwarePtr
();
...
...
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