Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wolf_ros_gnss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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_ros
wolf_ros_gnss
Commits
3899681b
Commit
3899681b
authored
4 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
covariance source
parent
cfba438e
No related branches found
No related tags found
2 merge requests
!3
After cmake and const refactor
,
!1
new release
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/subscriber_gnss_fix.h
+4
-0
4 additions, 0 deletions
include/subscriber_gnss_fix.h
src/subscriber_gnss_fix.cpp
+12
-2
12 additions, 2 deletions
src/subscriber_gnss_fix.cpp
with
16 additions
and
2 deletions
include/subscriber_gnss_fix.h
+
4
−
0
View file @
3899681b
...
...
@@ -38,6 +38,10 @@ namespace wolf
class
SubscriberGnssFix
:
public
Subscriber
{
std
::
string
cov_mode_
;
double
cov_factor_
;
Eigen
::
Matrix3d
cov_
;
public:
// Constructor
SubscriberGnssFix
(
const
std
::
string
&
_unique_name
,
...
...
This diff is collapsed.
Click to expand it.
src/subscriber_gnss_fix.cpp
+
12
−
2
View file @
3899681b
...
...
@@ -8,7 +8,16 @@ SubscriberGnssFix::SubscriberGnssFix(const std::string& _unique_name,
const
ParamsServer
&
_server
,
const
SensorBasePtr
_sensor_ptr
)
:
Subscriber
(
_unique_name
,
_server
,
_sensor_ptr
)
,
cov_factor_
(
1
)
{
cov_mode_
=
_server
.
getParam
<
std
::
string
>
(
prefix_
+
"/cov_mode"
);
//if (cov_mode_ == "msg") //nothing to be done
if
(
cov_mode_
==
"manual"
)
cov_
=
_server
.
getParam
<
Eigen
::
Matrix3d
>
(
prefix_
+
"/cov"
);
if
(
cov_mode_
==
"factor"
)
cov_factor_
=
_server
.
getParam
<
double
>
(
prefix_
+
"/cov_factor"
);
}
...
...
@@ -19,14 +28,15 @@ void SubscriberGnssFix::initialize(ros::NodeHandle& nh, const std::string& topic
void
SubscriberGnssFix
::
callback
(
const
sensor_msgs
::
NavSatFix
::
ConstPtr
&
msg
)
{
Eigen
::
Matrix3d
cov
=
Eigen
::
Map
<
const
Eigen
::
Matrix3d
>
(
msg
->
position_covariance
.
data
());
if
(
cov_mode_
==
"msg"
or
cov_mode_
==
"factor"
)
cov_
=
cov_factor_
*
Eigen
::
Map
<
const
Eigen
::
Matrix3d
>
(
msg
->
position_covariance
.
data
());
CaptureGnssFixPtr
cap_gnss_ptr
=
std
::
make_shared
<
CaptureGnssFix
>
(
TimeStamp
(
msg
->
header
.
stamp
.
sec
,
msg
->
header
.
stamp
.
nsec
),
sensor_ptr_
,
Eigen
::
Vector3d
(
msg
->
latitude
*
M_PI
/
180.0
,
msg
->
longitude
*
M_PI
/
180.0
,
msg
->
altitude
),
cov
,
cov
_
,
false
);
// false = {LatLonAlt fix and ENU cov}
cap_gnss_ptr
->
process
();
}
...
...
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