Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wolf_ros_laser
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_laser
Commits
b0074e61
Commit
b0074e61
authored
2 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
publisher_map optionally specify sensor
parent
c5a59c95
No related branches found
No related tags found
1 merge request
!8
Devel
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/publisher_laser_map.h
+1
-0
1 addition, 0 deletions
include/publisher_laser_map.h
src/publisher_laser_map.cpp
+10
-1
10 additions, 1 deletion
src/publisher_laser_map.cpp
with
11 additions
and
1 deletion
include/publisher_laser_map.h
+
1
−
0
View file @
b0074e61
...
...
@@ -59,6 +59,7 @@ class PublisherLaserMap: public Publisher
protected:
double
update_dist_th_
,
update_angle_th_
;
SensorBaseConstPtr
sensor_
;
// OCCUPANCY MAP parameters and auxiliar variables
double
Lfree_
,
Lobst_
,
Lobst_th_
,
Lfree_th_
;
...
...
This diff is collapsed.
Click to expand it.
src/publisher_laser_map.cpp
+
10
−
1
View file @
b0074e61
...
...
@@ -38,6 +38,7 @@ PublisherLaserMap::PublisherLaserMap(const std::string& _unique_name,
const
ParamsServer
&
_server
,
ProblemConstPtr
_problem
)
:
Publisher
(
_unique_name
,
_server
,
_problem
),
sensor_
(
nullptr
),
n_cells_
(
Eigen
::
Vector2i
::
Constant
(
100
)),
resized_
(
false
),
logodds_array_
(
Eigen
::
ArrayXXd
::
Zero
(
n_cells_
(
0
),
n_cells_
(
1
))),
...
...
@@ -48,6 +49,12 @@ PublisherLaserMap::PublisherLaserMap(const std::string& _unique_name,
// common params
update_dist_th_
=
_server
.
getParam
<
double
>
(
prefix_
+
"/update_dist_th"
);
update_angle_th_
=
_server
.
getParam
<
double
>
(
prefix_
+
"/update_angle_th"
);
auto
sensor_name
=
getParamWithDefault
<
std
::
string
>
(
_server
,
prefix_
+
"/sensor"
,
""
);
if
(
not
sensor_name
.
empty
())
{
sensor_
=
_problem
->
findSensor
(
sensor_name
);
WOLF_WARN_COND
(
not
sensor_
,
"PublisherLaserMap: Sensor name not found: "
,
sensor_name
);
}
// occmap params
occ_msg_
.
header
.
frame_id
=
_server
.
getParam
<
std
::
string
>
(
prefix_
+
"/map_frame_id"
);
...
...
@@ -150,7 +157,9 @@ void PublisherLaserMap::updateTrajectory()
for
(
auto
cap
:
cap_list
)
{
auto
cap_laser
=
std
::
dynamic_pointer_cast
<
const
CaptureLaser2d
>
(
cap
);
if
(
cap_laser
and
not
cap_laser
->
isRemoving
())
if
(
cap_laser
and
not
cap_laser
->
isRemoving
()
and
(
not
sensor_
or
cap_laser
->
getSensor
()
==
sensor_
))
storeScan
(
frame_pair
.
second
,
cap_laser
);
}
...
...
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