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
88e4c32b
Commit
88e4c32b
authored
3 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
starting wip
parent
c32fcb72
No related branches found
No related tags found
1 merge request
!448
Draft: Resolve "Implementation of new nodes creation"
Pipeline
#10319
canceled
3 years ago
Stage: deploy_plugins
Stage: deploy_ros
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/core/sensor/sensor_base.h
+13
-0
13 additions, 0 deletions
include/core/sensor/sensor_base.h
include/core/state_block/prior.h
+117
-0
117 additions, 0 deletions
include/core/state_block/prior.h
with
130 additions
and
0 deletions
include/core/sensor/sensor_base.h
+
13
−
0
View file @
88e4c32b
...
@@ -126,6 +126,19 @@ class SensorBase : public NodeBase, public HasStateBlocks, public std::enable_sh
...
@@ -126,6 +126,19 @@ class SensorBase : public NodeBase, public HasStateBlocks, public std::enable_sh
void
setProblem
(
ProblemPtr
_problem
)
override
final
;
void
setProblem
(
ProblemPtr
_problem
)
override
final
;
public:
public:
/** \brief Constructor with Prior and Params
*
* Constructor with parameter vector
* \param _tp Type of the sensor (types defined at wolf.h)
* \param _priors list of the priors of the sensor states
* \param _params params struct
*
**/
SensorBase
(
const
std
::
string
&
_type
,
std
::
list
<
Prior
>
_priors
,
ParamsSensorBasePtr
_params
);
/** \brief Constructor with noise size
/** \brief Constructor with noise size
*
*
* Constructor with parameter vector
* Constructor with parameter vector
...
...
This diff is collapsed.
Click to expand it.
include/core/state_block/prior.h
0 → 100644
+
117
−
0
View file @
88e4c32b
//--------LICENSE_START--------
//
// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
// Authors: Joan Solà Ortega (jsola@iri.upc.edu)
// All rights reserved.
//
// This file is part of WOLF
// WOLF is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//--------LICENSE_END--------
#ifndef PRIOR_H_
#define PRIOR_H_
#include
"core/utils/params_server.h"
namespace
wolf
{
class
Prior
{
private:
char
key
;
// State key
std
::
string
mode
;
// Prior mode. Can be 'nothing', 'initial_guess', 'fix' and 'factor'
Eigen
::
VectorXd
state
;
// state values (only filled from server if mode != 'nothing')
Eigen
::
VectorXd
sigma
;
// factor sigmas (only filled from server if mode == 'factor')
bool
dynamic
;
// State dynamic
Eigen
::
VectorXd
sigma_drift
;
// drift of the state (only filled from server if dynamic)
public:
Prior
()
=
default
;
Prior
(
const
std
::
string
&
_prefix
,
char
_key
,
const
ParamsServer
&
_server
)
{
mode
=
_server
.
getParam
<
double
>
(
prefix
+
_key
+
"/mode"
);
if
(
mode
!=
"nothing"
and
mode
!=
"initial_guess"
and
mode
!=
"fix"
and
mode
==
"factor"
)
throw
std
::
runtime_error
(
"wrong mode value, it should be: 'nothing', 'initial_guess', 'fix' or 'factor'"
);
if
(
mode
==
"nothing"
and
(
key
==
'P'
or
key
==
'O'
))
throw
std
::
runtime_error
(
"For P and O keys, mode 'nothing' is not valid"
);
if
(
mode
!=
"nothing"
)
state
=
_server
.
getParam
<
Eigen
::
VectorXd
>
(
prefix
+
_key
+
"/state"
);
else
state
=
Eigen
::
VectorXd
(
0
);
if
(
mode
==
"factor"
)
sigma
=
_server
.
getParam
<
Eigen
::
VectorXd
>
(
prefix
+
_key
+
"/sigma"
);
else
sigma
=
Eigen
::
VectorXd
(
0
);
if
(
key
==
'P'
or
key
==
'O'
)
dynamic
=
false
;
else
dynamic
=
_server
.
getParam
<
bool
>
(
prefix
+
_key
+
"/dynamic"
);
if
(
dynamic
)
sigma_drift
=
_server
.
getParam
<
Eigen
::
VectorXd
>
(
prefix
+
_key
+
"/sigma_drift"
);
else
sigma_drift
=
Eigen
::
VectorXd
(
0
);
}
virtual
~
Prior
()
=
default
;
char
getKey
()
const
{
return
key
;
}
const
std
::
string
&
getMode
()
const
{
return
mode
;
}
const
Eigen
::
VectorXd
&
getState
()
const
{
return
state
;
}
const
Eigen
::
VectorXd
&
getSigma
()
const
{
return
sigma
;
}
bool
isDynamic
()
const
{
return
dynamic
;
}
const
Eigen
::
VectorXd
&
getSigma
()
const
{
return
sigma_drift
;
}
virtual
std
::
string
print
()
const
final
{
return
"Prior "
+
_key
+
"
\n
"
+
"mode: "
+
std
::
to_string
(
mode
)
+
"
\n
"
+
"state: "
+
std
::
to_string
(
state
)
+
"
\n
"
+
(
mode
==
"factor"
?
"sigma: "
+
std
::
to_string
(
sigma
)
+
"
\n
"
:
""
)
+
"dynamic: "
+
std
::
to_string
(
dynamic
)
+
"
\n
"
+
(
dynamic
?
"sigma_drift: "
+
std
::
to_string
(
sigma_drift
)
+
"
\n
"
:
""
);
}
};
}
#endif
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