Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wolf_ros_node
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_node
Commits
55c7e7b1
Commit
55c7e7b1
authored
4 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
using SensorOdom2d::computeCovFromMotion() to compute cov
parent
b410125f
No related branches found
Branches containing commit
No related tags found
2 merge requests
!11
new release
,
!10
new release
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/subscriber_odom2d.h
+1
-1
1 addition, 1 deletion
include/subscriber_odom2d.h
src/subscriber_odom2d.cpp
+5
-5
5 additions, 5 deletions
src/subscriber_odom2d.cpp
with
6 additions
and
6 deletions
include/subscriber_odom2d.h
+
1
−
1
View file @
55c7e7b1
...
...
@@ -18,7 +18,7 @@ class SubscriberOdom2d : public Subscriber
{
protected:
ros
::
Time
last_odom_stamp_
;
double
odometry_translational_cov_fact
or_
,
odom
etry_rotational_cov_factor
_
;
SensorOdom2dPtr
sens
or_odom_
;
public:
...
...
This diff is collapsed.
Click to expand it.
src/subscriber_odom2d.cpp
+
5
−
5
View file @
55c7e7b1
...
...
@@ -28,9 +28,9 @@ SubscriberOdom2d::SubscriberOdom2d(const std::string& _unique_name,
const
SensorBasePtr
_sensor_ptr
)
:
Subscriber
(
_unique_name
,
_server
,
_sensor_ptr
)
,
last_odom_stamp_
(
ros
::
Time
(
0
))
,
odometry_translational_cov_factor_
(
std
::
static_pointer_cast
<
SensorOdom2d
>
(
_sensor_ptr
)
->
getDispVarToDispNoiseFactor
())
,
odometry_rotational_cov_factor_
(
std
::
static_pointer_cast
<
SensorOdom2d
>
(
_sensor_ptr
)
->
getRotVarToRotNoiseFactor
())
,
sensor_odom_
(
std
::
static_pointer_cast
<
SensorOdom2d
>
(
_sensor_ptr
))
{
assert
(
std
::
dynamic_pointer_cast
<
SensorOdom2d
>
(
_sensor_ptr
)
!=
nullptr
&&
"SubscriberOdom2d: sensor provided is not of type SensorOdom2d!"
);
}
void
SubscriberOdom2d
::
initialize
(
ros
::
NodeHandle
&
nh
,
const
std
::
string
&
topic
)
...
...
@@ -45,12 +45,12 @@ void SubscriberOdom2d::callback(const nav_msgs::Odometry::ConstPtr& msg)
if
(
last_odom_stamp_
!=
ros
::
Time
(
0
))
{
double
dt
=
(
msg
->
header
.
stamp
-
last_odom_stamp_
).
toSec
();
Eigen
::
Vector2d
data
(
msg
->
twist
.
twist
.
linear
.
x
*
dt
,
msg
->
twist
.
twist
.
angular
.
z
*
dt
);
CaptureOdom2dPtr
new_capture
=
std
::
make_shared
<
CaptureOdom2d
>
(
TimeStamp
(
msg
->
header
.
stamp
.
sec
,
msg
->
header
.
stamp
.
nsec
),
sensor_ptr_
,
Eigen
::
Vector2d
(
msg
->
twist
.
twist
.
linear
.
x
*
dt
,
msg
->
twist
.
twist
.
angular
.
z
*
dt
),
Eigen
::
DiagonalMatrix
<
double
,
2
>
(
msg
->
twist
.
twist
.
linear
.
x
*
dt
*
(
double
)
odometry_translational_cov_factor_
,
msg
->
twist
.
twist
.
angular
.
z
*
dt
*
(
double
)
odometry_rotational_cov_factor_
));
data
,
sensor_odom_
->
computeCovFromMotion
(
data
));
sensor_ptr_
->
process
(
new_capture
);
}
last_odom_stamp_
=
msg
->
header
.
stamp
;
...
...
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