@@ -36,11 +36,11 @@ struct Duration {
3636 return nsec;
3737 }
3838
39- std::string toString () const {
40- return " Duration(" + toStringBrief () + " )" ;
39+ std::string to_string () const {
40+ return " Duration(" + to_string_brief () + " )" ;
4141 }
4242
43- std::string toStringBrief () const {
43+ std::string to_string_brief () const {
4444 return std::to_string (to_sec ());
4545 }
4646
@@ -95,11 +95,11 @@ struct Stamp {
9595 return double (sec) + double (nsec) * 1e-9 ;
9696 }
9797
98- std::string toString () const {
99- return " Stamp(" + toStringBrief () + " )" ;
98+ std::string to_string () const {
99+ return " Stamp(" + to_string_brief () + " )" ;
100100 }
101101
102- std::string toStringBrief () const {
102+ std::string to_string_brief () const {
103103 size_t n_zeros = 9 ;
104104 auto nsec_str = std::to_string (nsec);
105105 auto nsec_str_leading =
@@ -146,7 +146,7 @@ struct Point {
146146 uint8_t row = 0 ;
147147 uint16_t col = 0 ;
148148
149- std::string toString () const {
149+ std::string to_string () const {
150150 return " Point(x: " + std::to_string (x) + " , y: " + std::to_string (y)
151151 + " , z: " + std::to_string (z) + " , intensity: "
152152 + std::to_string (intensity) + " , t: " + std::to_string (t.to_sec ())
@@ -173,9 +173,9 @@ struct LidarMeasurement {
173173 LidarMeasurement (Stamp stamp, std::vector<Point> points) :
174174 stamp (stamp), points(points) {}
175175
176- std::string toString () const {
176+ std::string to_string () const {
177177 std::ostringstream oss;
178- oss << " LidarMeasurement(stamp: " << stamp.toStringBrief ()
178+ oss << " LidarMeasurement(stamp: " << stamp.to_string_brief ()
179179 << " , num_points: " << points.size () << " )" ;
180180 return oss.str ();
181181 }
@@ -227,7 +227,7 @@ struct LidarParams {
227227 std::string brand = " -" ;
228228 std::string model = " -" ;
229229
230- std::string toString () const {
230+ std::string to_string () const {
231231 return " LidarParams(rows: " + std::to_string (num_rows)
232232 + " , cols: " + std::to_string (num_columns) + " , min_range: "
233233 + std::to_string (min_range) + " , max_range: " + std::to_string (max_range)
@@ -244,9 +244,9 @@ struct ImuMeasurement {
244244 Eigen::Vector3d gyro;
245245 Eigen::Vector3d accel;
246246
247- std::string toString () const {
247+ std::string to_string () const {
248248 std::ostringstream oss;
249- oss << " ImuMeasurement(stamp: " << stamp.toStringBrief () << " , gyro: ["
249+ oss << " ImuMeasurement(stamp: " << stamp.to_string_brief () << " , gyro: ["
250250 << gyro.transpose () << " ]"
251251 << " , accel: [" << accel.transpose () << " ])" ;
252252 return oss.str ();
@@ -285,7 +285,7 @@ struct ImuParams {
285285 return imu_params;
286286 }
287287
288- std::string toString () const {
288+ std::string to_string () const {
289289 std::ostringstream oss;
290290 oss << " ImuParams(gyro: " << gyro << " , accel: " << accel
291291 << " , gyro_bias: " << gyro_bias << " , accel_bias: " << accel_bias
@@ -302,32 +302,32 @@ struct SO3 {
302302 double qz;
303303 double qw;
304304
305- Eigen::Quaterniond toEigen () const {
305+ Eigen::Quaterniond to_eigen () const {
306306 return Eigen::Quaterniond (qw, qx, qy, qz);
307307 }
308308
309- static SO3 fromEigen (const Eigen::Quaterniond& q) {
309+ static SO3 from_eigen (const Eigen::Quaterniond& q) {
310310 return SO3 {.qx = q.x (), .qy = q.y (), .qz = q.z (), .qw = q.w ()};
311311 }
312312
313313 static SO3 identity () {
314314 return SO3 {.qx = 0 , .qy = 0 , .qz = 0 , .qw = 1 };
315315 }
316316
317- static SO3 fromMat (const Eigen::Matrix3d& R) {
318- return fromEigen (Eigen::Quaterniond (R));
317+ static SO3 from_mat (const Eigen::Matrix3d& R) {
318+ return from_eigen (Eigen::Quaterniond (R));
319319 }
320320
321321 SO3 inverse () const {
322322 return SO3 {.qx = -qx, .qy = -qy, .qz = -qz, .qw = qw};
323323 }
324324
325325 SO3 operator *(const SO3& other) const {
326- return fromEigen ( toEigen () * other.toEigen ());
326+ return from_eigen ( to_eigen () * other.to_eigen ());
327327 }
328328
329329 Eigen::Vector3d rotate (const Eigen::Vector3d& v) const {
330- return toEigen () * v;
330+ return to_eigen () * v;
331331 }
332332
333333 static Eigen::Matrix3d hat (const Eigen::Vector3d& xi) {
@@ -339,25 +339,25 @@ struct SO3 {
339339 static SO3 exp (const Eigen::Vector3d& v) {
340340 Eigen::AngleAxisd axis (v.norm (), v.normalized ());
341341 Eigen::Quaterniond q (axis);
342- return fromEigen (q);
342+ return from_eigen (q);
343343 }
344344
345345 Eigen::Vector3d log () const {
346- Eigen::Quaterniond q = toEigen ();
346+ Eigen::Quaterniond q = to_eigen ();
347347 auto axis = Eigen::AngleAxisd (q);
348348 return axis.angle () * axis.axis ();
349349 }
350350
351- Eigen::Matrix3d toMat () const {
352- return toEigen ().toRotationMatrix ();
351+ Eigen::Matrix3d to_mat () const {
352+ return to_eigen ().toRotationMatrix ();
353353 }
354354
355- std::string toString () const {
355+ std::string to_string () const {
356356 return " SO3(x: " + std::to_string (qx) + " , y: " + std::to_string (qy)
357357 + " , z: " + std::to_string (qz) + " , w: " + std::to_string (qw) + " )" ;
358358 }
359359
360- std::string toStringBrief () const {
360+ std::string to_string_brief () const {
361361 return " x: " + std::to_string (qx) + " , y: " + std::to_string (qy)
362362 + " , z: " + std::to_string (qz) + " , w: " + std::to_string (qw);
363363 }
@@ -381,13 +381,13 @@ struct SE3 {
381381 return SE3 (SO3::identity (), Eigen::Vector3d::Zero ());
382382 }
383383
384- static SE3 fromMat (const Eigen::Matrix4d& T) {
385- return SE3 (SO3::fromMat (T.block <3 , 3 >(0 , 0 )), T.block <3 , 1 >(0 , 3 ));
384+ static SE3 from_mat (const Eigen::Matrix4d& T) {
385+ return SE3 (SO3::from_mat (T.block <3 , 3 >(0 , 0 )), T.block <3 , 1 >(0 , 3 ));
386386 }
387387
388- Eigen::Matrix4d toMat () const {
388+ Eigen::Matrix4d to_mat () const {
389389 Eigen::Matrix4d T = Eigen::Matrix4d::Identity ();
390- T.block <3 , 3 >(0 , 0 ) = rot.toMat ();
390+ T.block <3 , 3 >(0 , 0 ) = rot.to_mat ();
391391 T.block <3 , 1 >(0 , 3 ) = trans;
392392 return T;
393393 }
@@ -451,9 +451,9 @@ struct SE3 {
451451 return SE3 (rot * other.rot , rot.rotate (other.trans ) + trans);
452452 }
453453
454- std::string toString () const {
454+ std::string to_string () const {
455455 std::ostringstream oss;
456- oss << " SE3(rot: [" << rot.toStringBrief () << " ], "
456+ oss << " SE3(rot: [" << rot.to_string_brief () << " ], "
457457 << " t: [" << trans.transpose () << " ])" ;
458458 return oss.str ();
459459 }
0 commit comments