Commit f3d8e117 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Fix warnings + include headers

parent 4a07ffbb
Pipeline #4683 passed with stage
in 1 minute and 9 seconds
......@@ -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 int& nVector,
const unsigned int& vectorSize)
const std::size_t& nVector,
const std::size_t& vectorSize)
{
of.write ((const char*)(&nVector) , sizeof(unsigned int));
of.write ((const char*)(&vectorSize), sizeof(unsigned int));
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 int size)
std::size_t size)
{
ostringstream oss;
oss << fileName;
......
......@@ -14,9 +14,9 @@ namespace rc_sot_system {
struct ProfileLog
{
unsigned int nbDofs;
unsigned int nbForceSensors;
unsigned int 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 int nbDofs() { return profileLog_.nbDofs;}
unsigned int nbForceSensors() { return profileLog_.nbForceSensors;}
unsigned int 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 int);
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_ */
......@@ -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.
......
......@@ -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>
......
......@@ -16,9 +16,9 @@ int main (int argc, char* argv[])
}
// Read headers
unsigned int nVector = 0, vectorSize = 0;
in.read ((char*)&nVector , sizeof(unsigned int));
in.read ((char*)&vectorSize, sizeof(unsigned int));
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment