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
a8664b4e
Commit
a8664b4e
authored
4 years ago
by
Idril-Tadzio Geer Cousté
Browse files
Options
Downloads
Patches
Plain Diff
optionally print problem
parent
10890434
No related branches found
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/node.h
+6
-0
6 additions, 0 deletions
include/node.h
src/node.cpp
+14
-2
14 additions, 2 deletions
src/node.cpp
with
20 additions
and
2 deletions
include/node.h
+
6
−
0
View file @
a8664b4e
...
...
@@ -56,6 +56,11 @@ class WolfRosNode
// publishers
std
::
vector
<
PublisherPtr
>
publishers_
;
//DEBUG
bool
print_problem_
;
double
print_period_
;
ros
::
Time
last_print_
;
protected:
// solver
SolverManagerPtr
solver_
;
...
...
@@ -70,6 +75,7 @@ class WolfRosNode
std
::
chrono
::
time_point
<
std
::
chrono
::
high_resolution_clock
>
start_experiment_
;
public:
WolfRosNode
();
...
...
This diff is collapsed.
Click to expand it.
src/node.cpp
+
14
−
2
View file @
a8664b4e
...
...
@@ -61,10 +61,10 @@ WolfRosNode::WolfRosNode()
}
// PROFILING
profiling_
=
server
.
getParam
<
bool
>
(
"profiling
/enabled
"
);
profiling_
=
server
.
getParam
<
bool
>
(
"
debug/
profiling"
);
if
(
profiling_
)
{
auto
prof_file
=
server
.
getParam
<
std
::
string
>
(
"profiling
/
file
_name
"
);
auto
prof_file
=
server
.
getParam
<
std
::
string
>
(
"
debug/
profiling
_
file"
);
// change ~ with HOME using environment variable
if
(
prof_file
.
at
(
0
)
==
'~'
)
prof_file
=
std
::
string
(
std
::
getenv
(
"HOME"
))
+
prof_file
.
substr
(
1
);
...
...
@@ -73,6 +73,14 @@ WolfRosNode::WolfRosNode()
if
(
not
profiling_file_
.
is_open
())
ROS_ERROR
(
"Error in opening file %s to store profiling!"
,
prof_file
.
c_str
());
}
// DEBUG
print_problem_
=
server
.
getParam
<
bool
>
(
"debug/print_problem"
);
if
(
print_problem_
)
{
print_period_
=
server
.
getParam
<
double
>
(
"debug/print_period"
);
last_print_
=
ros
::
Time
::
now
();
}
start_experiment_
=
std
::
chrono
::
high_resolution_clock
::
now
();
ROS_INFO
(
"Ready!"
);
...
...
@@ -199,6 +207,10 @@ int main(int argc, char **argv)
last_check
=
ros
::
Time
::
now
();
}
// print periodically
if
(
wolf_node
.
print_problem_
and
(
ros
::
Time
::
now
()
-
wolf_node
.
last_print_
).
toSec
()
>=
wolf_node
.
print_period_
)
wolf_node
.
problem_ptr_
->
print
(
4
,
1
,
1
,
1
);
// execute pending callbacks
ros
::
spinOnce
();
...
...
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