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
4b0fb236
Commit
4b0fb236
authored
4 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
publish if any subscriber instead of param
parent
e3575008
No related branches found
No related tags found
3 merge requests
!11
new release
,
!10
new release
,
!4
Gauss
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/visualizer.h
+1
-1
1 addition, 1 deletion
include/visualizer.h
src/visualizer.cpp
+6
-12
6 additions, 12 deletions
src/visualizer.cpp
with
7 additions
and
13 deletions
include/visualizer.h
+
1
−
1
View file @
4b0fb236
...
...
@@ -66,7 +66,7 @@ class Visualizer
// Options
std
::
string
map_frame_id_
;
bool
viz_factors_
,
viz_landmarks_
,
viz_trajectory_
,
viz_overlapped_factors_
;
bool
viz_overlapped_factors_
;
double
viz_scale_
,
factors_width_
,
factors_absolute_height_
,
landmark_text_z_offset_
,
landmark_width_
,
landmark_length_
,
frame_width_
,
frame_length_
;
std_msgs
::
ColorRGBA
frame_color_
,
factor_abs_color_
,
factor_motion_color_
,
factor_loop_color_
,
factor_lmk_color_
,
factor_geom_color_
;
...
...
This diff is collapsed.
Click to expand it.
src/visualizer.cpp
+
6
−
12
View file @
4b0fb236
...
...
@@ -12,10 +12,7 @@ Visualizer::Visualizer() :
void
Visualizer
::
initialize
(
ros
::
NodeHandle
&
nh
)
{
// Load options ---------------------------------------------------
nh
.
param
<
bool
>
(
"viz_factors"
,
viz_factors_
,
true
);
nh
.
param
<
bool
>
(
"viz_overlapped_factors"
,
viz_overlapped_factors_
,
false
);
nh
.
param
<
bool
>
(
"viz_landmarks"
,
viz_landmarks_
,
true
);
nh
.
param
<
bool
>
(
"viz_trajectory"
,
viz_trajectory_
,
true
);
// viz parameters
nh
.
param
<
std
::
string
>
(
"map_frame_id"
,
map_frame_id_
,
"map"
);
nh
.
param
<
double
>
(
"viz_scale"
,
viz_scale_
,
1
);
...
...
@@ -58,12 +55,9 @@ void Visualizer::initialize(ros::NodeHandle& nh)
nh
.
param
<
float
>
(
"factor_geom_color_a"
,
factor_geom_color_
.
a
,
1
);
// init publishers ---------------------------------------------------
if
(
viz_factors_
)
factors_publisher_
=
nh
.
advertise
<
visualization_msgs
::
MarkerArray
>
(
"factors"
,
1
);
if
(
viz_landmarks_
)
landmarks_publisher_
=
nh
.
advertise
<
visualization_msgs
::
MarkerArray
>
(
"landmarks"
,
1
);
if
(
viz_trajectory_
)
trajectory_publisher_
=
nh
.
advertise
<
visualization_msgs
::
MarkerArray
>
(
"trajectory"
,
1
);
factors_publisher_
=
nh
.
advertise
<
visualization_msgs
::
MarkerArray
>
(
"factors"
,
1
);
landmarks_publisher_
=
nh
.
advertise
<
visualization_msgs
::
MarkerArray
>
(
"landmarks"
,
1
);
trajectory_publisher_
=
nh
.
advertise
<
visualization_msgs
::
MarkerArray
>
(
"trajectory"
,
1
);
// init markers ---------------------------------------------------
// factor markers message
...
...
@@ -122,11 +116,11 @@ void Visualizer::initialize(ros::NodeHandle& nh)
void
Visualizer
::
visualize
(
const
ProblemPtr
problem
)
{
if
(
viz_
factors_
)
if
(
factors_
publisher_
.
getNumSubscribers
()
!=
0
)
publishFactors
(
problem
);
if
(
viz_
landmarks_
)
if
(
landmarks_
publisher_
.
getNumSubscribers
()
!=
0
)
publishLandmarks
(
problem
);
if
(
viz_
trajectory_
)
if
(
trajectory_
publisher_
.
getNumSubscribers
()
!=
0
)
publishTrajectory
(
problem
);
}
...
...
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