@@ -16,7 +16,7 @@ using namespace rc_sot_system;
16
16
17
17
DataToLog::DataToLog () {}
18
18
19
- void DataToLog::init (ProfileLog & aProfileLog) {
19
+ void DataToLog::init (ProfileLog& aProfileLog) {
20
20
profileLog_ = aProfileLog;
21
21
motor_angle.resize (aProfileLog.nbDofs * aProfileLog.length );
22
22
joint_angle.resize (aProfileLog.nbDofs * aProfileLog.length );
@@ -53,7 +53,7 @@ void DataToLog::init(ProfileLog &aProfileLog) {
53
53
54
54
Log::Log () : lref_(0 ), lrefts_(0 ) {}
55
55
56
- void Log::init (ProfileLog & aProfileLog) {
56
+ void Log::init (ProfileLog& aProfileLog) {
57
57
profileLog_ = aProfileLog;
58
58
lref_ = 0 ;
59
59
lrefts_ = 0 ;
@@ -64,7 +64,7 @@ void Log::init(ProfileLog &aProfileLog) {
64
64
timeorigin_ = (double )current.tv_sec + 0.000001 * ((double )current.tv_usec );
65
65
}
66
66
67
- void Log::record (DataToLog & aDataToLog) {
67
+ void Log::record (DataToLog& aDataToLog) {
68
68
if ((aDataToLog.motor_angle .size () != profileLog_.nbDofs ) ||
69
69
(aDataToLog.velocities .size () != profileLog_.nbDofs ))
70
70
return ;
@@ -148,7 +148,7 @@ double Log::stop_it() {
148
148
return time_stop_it_ - time_start_it_;
149
149
}
150
150
151
- void Log::save (std::string & fileName) {
151
+ void Log::save (std::string& fileName) {
152
152
assert (lref_ == lrefts_ * profileLog_.nbDofs );
153
153
154
154
std::string suffix (" -mastate.log" );
@@ -184,22 +184,22 @@ void Log::save(std::string &fileName) {
184
184
saveVector (fileName, suffix, StoredData_.duration , 1 );
185
185
}
186
186
187
- inline void writeHeaderToBinaryBuffer (ofstream & of, const std::size_t & nVector,
188
- const std::size_t & vectorSize) {
189
- of.write ((const char *)(&nVector), sizeof (std::size_t ));
190
- of.write ((const char *)(&vectorSize), sizeof (std::size_t ));
187
+ inline void writeHeaderToBinaryBuffer (ofstream& of, const std::size_t & nVector,
188
+ const std::size_t & vectorSize) {
189
+ of.write ((const char *)(&nVector), sizeof (std::size_t ));
190
+ of.write ((const char *)(&vectorSize), sizeof (std::size_t ));
191
191
}
192
192
193
- inline void writeToBinaryFile (ofstream & of, const double & t, const double & dt,
194
- const std::vector<double > & data,
195
- const std::size_t & idx, const std::size_t & size) {
196
- of.write ((const char *)&t, sizeof (double ));
197
- of.write ((const char *)&dt, sizeof (double ));
198
- of.write ((const char *)(&data[idx]), size * (sizeof (double )));
193
+ inline void writeToBinaryFile (ofstream& of, const double & t, const double & dt,
194
+ const std::vector<double >& data,
195
+ const std::size_t & idx, const std::size_t & size) {
196
+ of.write ((const char *)&t, sizeof (double ));
197
+ of.write ((const char *)&dt, sizeof (double ));
198
+ of.write ((const char *)(&data[idx]), size * (sizeof (double )));
199
199
}
200
200
201
- void Log::saveVector (std::string & fileName, std::string & suffix,
202
- const std::vector<double > & avector, std::size_t size) {
201
+ void Log::saveVector (std::string& fileName, std::string& suffix,
202
+ const std::vector<double >& avector, std::size_t size) {
203
203
ostringstream oss;
204
204
oss << fileName;
205
205
oss << suffix.c_str ();
0 commit comments