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
f3d8e117
Commit
f3d8e117
authored
Mar 21, 2019
by
Olivier Stasse
Browse files
Fix warnings + include headers
parent
4a07ffbb
Pipeline
#4683
passed with stage
in 1 minute and 9 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/log.cpp
View file @
f3d8e117
...
...
@@ -9,11 +9,6 @@
#include <fstream>
#include <iomanip>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wvariadic-macros"
#pragma GCC diagnostic ignored "-Wpedantic"
#include<ros/console.h>
#pragma GCC diagnostic pop
using
namespace
std
;
using
namespace
rc_sot_system
;
...
...
@@ -90,7 +85,7 @@ void Log::record(DataToLog &aDataToLog)
StoredData_
.
accelerometer
[
lrefts_
*
3
+
axis
]
=
aDataToLog
.
accelerometer
[
axis
];
StoredData_
.
gyrometer
[
lrefts_
*
3
+
axis
]
=
aDataToLog
.
gyrometer
[
axis
];
}
unsigned
width_pad
=
6
*
profileLog_
.
nbForceSensors
;
std
::
size_t
width_pad
=
6
*
profileLog_
.
nbForceSensors
;
for
(
unsigned
int
fsID
=
0
;
fsID
<
profileLog_
.
nbForceSensors
;
fsID
++
)
{
...
...
@@ -168,11 +163,11 @@ void Log::save(std::string &fileName)
}
inline
void
writeHeaderToBinaryBuffer
(
ofstream
&
of
,
const
unsigned
in
t
&
nVector
,
const
unsigned
in
t
&
vectorSize
)
const
std
::
size_
t
&
nVector
,
const
std
::
size_
t
&
vectorSize
)
{
of
.
write
((
const
char
*
)(
&
nVector
)
,
sizeof
(
unsigned
in
t
));
of
.
write
((
const
char
*
)(
&
vectorSize
),
sizeof
(
unsigned
in
t
));
of
.
write
((
const
char
*
)(
&
nVector
)
,
sizeof
(
std
::
size_
t
));
of
.
write
((
const
char
*
)(
&
vectorSize
),
sizeof
(
std
::
size_
t
));
}
inline
void
writeToBinaryFile
(
ofstream
&
of
,
...
...
@@ -186,7 +181,7 @@ inline void writeToBinaryFile (ofstream& of,
void
Log
::
saveVector
(
std
::
string
&
fileName
,
std
::
string
&
suffix
,
const
std
::
vector
<
double
>
&
avector
,
unsigned
in
t
size
)
std
::
size_
t
size
)
{
ostringstream
oss
;
oss
<<
fileName
;
...
...
src/log.hh
View file @
f3d8e117
...
...
@@ -14,9 +14,9 @@ namespace rc_sot_system {
struct
ProfileLog
{
unsigned
in
t
nbDofs
;
unsigned
in
t
nbForceSensors
;
unsigned
in
t
length
;
std
::
size_
t
nbDofs
;
std
::
size_
t
nbForceSensors
;
std
::
size_
t
length
;
};
struct
DataToLog
...
...
@@ -51,9 +51,9 @@ namespace rc_sot_system {
DataToLog
();
void
init
(
ProfileLog
&
aProfileLog
);
unsigned
in
t
nbDofs
()
{
return
profileLog_
.
nbDofs
;}
unsigned
in
t
nbForceSensors
()
{
return
profileLog_
.
nbForceSensors
;}
unsigned
in
t
length
()
{
return
profileLog_
.
length
;}
std
::
size_
t
nbDofs
()
{
return
profileLog_
.
nbDofs
;}
std
::
size_
t
nbForceSensors
()
{
return
profileLog_
.
nbForceSensors
;}
std
::
size_
t
length
()
{
return
profileLog_
.
length
;}
};
...
...
@@ -80,7 +80,7 @@ namespace rc_sot_system {
void
saveVector
(
std
::
string
&
filename
,
std
::
string
&
suffix
,
const
std
::
vector
<
double
>
&
avector
,
unsigned
in
t
);
std
::
size_
t
);
public:
...
...
@@ -95,4 +95,10 @@ namespace rc_sot_system {
};
}
#pragma GCC diagnostic push
#pragma GCC system_header
#include<ros/console.h>
#pragma GCC diagnostic pop
#endif
/* _RC_SOT_SYSTEM_LOG_H_ */
src/roscontrol-sot-controller.cpp
View file @
f3d8e117
...
...
@@ -3,7 +3,7 @@
#include <dlfcn.h>
#include <sstream>
#include <pluginlib/class_list_macros.h>
#include "roscontrol-sot-controller.hh"
#include<ros/console.h>
...
...
@@ -127,7 +127,7 @@ namespace sot_controller
/// Initialize the size of the data to store.
/// Set temporary profileLog to one
/// because DataOneIter is just for one iteration.
unsigned
tmp_length
=
profileLog_
.
length
;
size_t
tmp_length
=
profileLog_
.
length
;
profileLog_
.
length
=
1
;
DataOneIter_
.
init
(
profileLog_
);
...
...
@@ -961,7 +961,6 @@ namespace sot_controller
double
local_command
=
ecpdcdata
.
pid_controller
.
computeCommand
(
err
,
vel_err
,
period
);
// Apply command
control_toolbox
::
Pid
::
Gains
gains
=
ecpdcdata
.
pid_controller
.
getGains
();
joints_
[
idJoint
].
setCommand
(
local_command
);
// Update previous value.
...
...
src/roscontrol-sot-controller.hh
View file @
f3d8e117
...
...
@@ -9,14 +9,13 @@
#include <map>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wvariadic-macros"
#pragma GCC diagnostic ignored "-Wpedantic"
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC system_header
#include <controller_interface/controller.h>
#include <hardware_interface/joint_command_interface.h>
#include <hardware_interface/imu_sensor_interface.h>
#include <hardware_interface/force_torque_sensor_interface.h>
#include <pal_hardware_interfaces/actuator_temperature_interface.h>
#include <pluginlib/class_list_macros.h>
#pragma GCC diagnostic pop
#include <dynamic_graph_bridge/sot_loader_basic.hh>
...
...
src/roscontrol-sot-parse-log.cc
View file @
f3d8e117
...
...
@@ -16,9 +16,9 @@ int main (int argc, char* argv[])
}
// Read headers
unsigned
in
t
nVector
=
0
,
vectorSize
=
0
;
in
.
read
((
char
*
)
&
nVector
,
sizeof
(
unsigned
in
t
));
in
.
read
((
char
*
)
&
vectorSize
,
sizeof
(
unsigned
in
t
));
std
::
size_
t
nVector
=
0
,
vectorSize
=
0
;
in
.
read
((
char
*
)
&
nVector
,
sizeof
(
std
::
size_
t
));
in
.
read
((
char
*
)
&
vectorSize
,
sizeof
(
std
::
size_
t
));
if
(
!
in
.
good
())
{
std
::
cerr
<<
"Couldn't parse file: "
<<
argv
[
1
]
<<
'\n'
;
return
3
;
...
...
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