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
a250b702
Commit
a250b702
authored
4 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
printing time spend in covariance computation
parent
76b26578
No related branches found
No related tags found
3 merge requests
!11
new release
,
!10
new release
,
!4
Gauss
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/node.cpp
+9
-1
9 additions, 1 deletion
src/node.cpp
with
9 additions
and
1 deletion
src/node.cpp
+
9
−
1
View file @
a250b702
...
@@ -98,11 +98,13 @@ void WolfRosNode::solve()
...
@@ -98,11 +98,13 @@ void WolfRosNode::solve()
if
(
compute_cov_
and
(
ros
::
Time
::
now
()
-
last_cov_stamp_
).
toSec
()
>
cov_period_
)
if
(
compute_cov_
and
(
ros
::
Time
::
now
()
-
last_cov_stamp_
).
toSec
()
>
cov_period_
)
{
{
auto
start
=
std
::
chrono
::
high_resolution_clock
::
now
();
if
(
solver_
->
computeCovariances
(
cov_enum_
))
if
(
solver_
->
computeCovariances
(
cov_enum_
))
{
{
auto
duration
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
microseconds
>
(
std
::
chrono
::
high_resolution_clock
::
now
()
-
start
);
last_cov_stamp_
=
ros
::
Time
::
now
();
last_cov_stamp_
=
ros
::
Time
::
now
();
if
(
solver_
->
getVerbosity
()
!=
SolverManager
::
ReportVerbosity
::
QUIET
)
if
(
solver_
->
getVerbosity
()
!=
SolverManager
::
ReportVerbosity
::
QUIET
)
ROS_INFO
(
"Covariances computed successfully!
"
);
ROS_INFO
(
"Covariances computed successfully!
It took %li microseconds"
,
duration
.
count
()
);
}
}
else
if
(
solver_
->
getVerbosity
()
!=
SolverManager
::
ReportVerbosity
::
QUIET
)
else
if
(
solver_
->
getVerbosity
()
!=
SolverManager
::
ReportVerbosity
::
QUIET
)
ROS_WARN
(
"Failed to compute covariances"
);
ROS_WARN
(
"Failed to compute covariances"
);
...
@@ -230,6 +232,12 @@ int main(int argc, char **argv)
...
@@ -230,6 +232,12 @@ int main(int argc, char **argv)
// Solver thread
// Solver thread
std
::
thread
solver_thread
(
&
WolfRosNode
::
solveLoop
,
&
wolf_node
);
std
::
thread
solver_thread
(
&
WolfRosNode
::
solveLoop
,
&
wolf_node
);
// set priority
struct
sched_param
Priority_Param
;
//struct to set priority
int
priority
=
99
;
Priority_Param
.
sched_priority
=
priority
;
int
policy
=
SCHED_FIFO
;
pthread_setschedparam
(
solver_thread
.
native_handle
(),
SCHED_FIFO
,
&
Priority_Param
);
while
(
ros
::
ok
())
while
(
ros
::
ok
())
{
{
...
...
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