Skip to content
GitLab
Menu
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
8b6b64d2
Commit
8b6b64d2
authored
Jul 01, 2019
by
Joseph Mirabel
Committed by
olivier stasse
Jul 13, 2019
Browse files
Add control to logs.
parent
860c9f63
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/log.cpp
View file @
8b6b64d2
...
...
@@ -30,6 +30,7 @@ void DataToLog::init(ProfileLog &aProfileLog)
gyrometer
.
resize
(
3
*
aProfileLog
.
length
);
force_sensors
.
resize
(
aProfileLog
.
nbForceSensors
*
6
*
aProfileLog
.
length
);
temperatures
.
resize
(
aProfileLog
.
nbDofs
*
aProfileLog
.
length
);
controls
.
resize
(
aProfileLog
.
nbDofs
*
aProfileLog
.
length
);
timestamp
.
resize
(
aProfileLog
.
length
);
duration
.
resize
(
aProfileLog
.
length
);
...
...
@@ -79,6 +80,8 @@ void Log::record(DataToLog &aDataToLog)
StoredData_
.
motor_currents
[
JointID
+
lref_
]
=
aDataToLog
.
motor_currents
[
JointID
];
if
(
aDataToLog
.
temperatures
.
size
()
>
JointID
)
StoredData_
.
temperatures
[
JointID
+
lref_
]
=
aDataToLog
.
temperatures
[
JointID
];
if
(
aDataToLog
.
controls
.
size
()
>
JointID
)
StoredData_
.
controls
[
JointID
+
lref_
]
=
aDataToLog
.
controls
[
JointID
];
}
for
(
unsigned
int
axis
=
0
;
axis
<
3
;
axis
++
)
{
...
...
@@ -157,6 +160,9 @@ void Log::save(std::string &fileName)
suffix
=
"-temperatures.log"
;
saveVector
(
fileName
,
suffix
,
StoredData_
.
temperatures
,
profileLog_
.
nbDofs
);
suffix
=
"-controls.log"
;
saveVector
(
fileName
,
suffix
,
StoredData_
.
controls
,
profileLog_
.
nbDofs
);
suffix
=
"-duration.log"
;
saveVector
(
fileName
,
suffix
,
StoredData_
.
duration
,
1
);
...
...
src/log.hh
View file @
8b6b64d2
...
...
@@ -41,6 +41,8 @@ namespace rc_sot_system {
std
::
vector
<
double
>
motor_currents
;
// Measured temperatures
std
::
vector
<
double
>
temperatures
;
// Control
std
::
vector
<
double
>
controls
;
// Timestamp
std
::
vector
<
double
>
timestamp
;
...
...
src/roscontrol-sot-controller.cpp
View file @
8b6b64d2
...
...
@@ -1018,7 +1018,9 @@ namespace sot_controller
i
<
command_
.
size
();
++
i
)
{
joints_
[
joints_name_
[
i
]].
joint
.
setCommand
(
command_
[
i
]);
}
DataOneIter_
.
controls
[
i
]
=
command_
[
i
];
}
}
else
ROS_INFO_STREAM
(
"no control."
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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