Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
roscontrol_sot
Commits
3b3f239f
Commit
3b3f239f
authored
Jan 27, 2020
by
Joseph Mirabel
Browse files
Make logging duration parameterizable.
parent
85d9b00f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/roscontrol-sot-controller.cpp
View file @
3b3f239f
...
...
@@ -75,7 +75,6 @@ RCSotController::RCSotController()
type_name_
(
"RCSotController"
),
simulation_mode_
(
false
),
accumulated_time_
(
0.0
),
jitter_
(
0.0
),
verbosity_level_
(
0
)
{
RESETDEBUG4
();
profileLog_
.
length
=
300000
;
}
void
RCSotController
::
displayClaimedResources
(
...
...
@@ -105,17 +104,27 @@ void RCSotController::displayClaimedResources(
#endif
}
void
RCSotController
::
initLogs
()
{
void
RCSotController
::
initLogs
(
ros
::
NodeHandle
&
robot_nh
)
{
ROS_INFO_STREAM
(
"Initialize log data structure"
);
int
length
=
300000
;
if
(
robot_nh
.
hasParam
(
"/sot_controller/number_logged_iterations"
))
{
robot_nh
.
getParam
(
"/sot_controller/number_logged_iterations"
,
length
);
int
minutes
=
static_cast
<
int
>
(
floor
(
length
*
dt_
/
60
));
int
seconds
=
static_cast
<
int
>
(
floor
(
length
*
dt_
))
-
minutes
*
60
;
ROS_INFO_STREAM
(
"Number of iterations that will be logged "
<<
length
<<
", i.e. "
<<
minutes
<<
"m"
<<
seconds
<<
"s"
);
}
/// Initialize the size of the data to store.
/// Set temporary profileLog to one
/// because DataOneIter is just for one iteration.
size_t
tmp_length
=
profileLog_
.
length
;
profileLog_
.
length
=
1
;
DataOneIter_
.
init
(
profileLog_
);
/// Set profile Log to real good value for the stored data.
profileLog_
.
length
=
tmp_
length
;
profileLog_
.
length
=
length
;
/// Initialize the data logger for 300s.
RcSotLog_
.
init
(
profileLog_
);
}
...
...
@@ -135,7 +144,7 @@ bool RCSotController::initRequest(lhi::RobotHW *robot_hw,
return
false
;
ROS_WARN
(
"initRequest 3"
);
/// Create all the internal data structures for logging.
initLogs
();
initLogs
(
robot_nh
);
ROS_WARN
(
"initRequest 4"
);
/// Create SoT
SotLoaderBasic
::
Initialization
();
...
...
src/roscontrol-sot-controller.hh
View file @
3b3f239f
...
...
@@ -196,7 +196,7 @@ protected:
/// Initialize internal structure for the logs based on nbDofs
/// number of force sensors and size of the buffer.
void
initLogs
();
void
initLogs
(
ros
::
NodeHandle
&
robot_nh
);
///@{ \name Read the parameter server
/// \brief Entry point
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment