Skip to content
Snippets Groups Projects
Commit 9fefe6b6 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Improve motion buffer print()

parent 4097a1d7
No related branches found
No related tags found
1 merge request!466devel->main
Pipeline #12715 passed
...@@ -100,7 +100,7 @@ class MotionBuffer : public std::list<Motion> ...@@ -100,7 +100,7 @@ class MotionBuffer : public std::list<Motion>
const Motion& getMotion(const TimeStamp& _ts) const; const Motion& getMotion(const TimeStamp& _ts) const;
void getMotion(const TimeStamp& _ts, Motion& _motion) const; void getMotion(const TimeStamp& _ts, Motion& _motion) const;
void split(const TimeStamp& _ts, MotionBuffer& _oldest_buffer); void split(const TimeStamp& _ts, MotionBuffer& _oldest_buffer);
void print(bool show_data = 0, bool show_delta = 0, bool show_delta_int = 0, bool show_jacs = 0); void print(bool show_data = 0, bool show_delta = 0, bool show_delta_int = 0, bool show_jacs = 0, bool show_covs = 0);
}; };
} // namespace wolf } // namespace wolf
......
...@@ -144,14 +144,14 @@ void MotionBuffer::split(const TimeStamp& _ts, MotionBuffer& _buffer_part_before ...@@ -144,14 +144,14 @@ void MotionBuffer::split(const TimeStamp& _ts, MotionBuffer& _buffer_part_before
} }
void MotionBuffer::print(bool show_data, bool show_delta, bool show_delta_int, bool show_jacs) void MotionBuffer::print(bool show_data, bool show_delta, bool show_delta_int, bool show_jacs, bool show_covs)
{ {
using std::cout; using std::cout;
using std::endl; using std::endl;
if (!show_data && !show_delta && !show_delta_int && !show_jacs) if (!show_data && !show_delta && !show_delta_int && !show_jacs && !show_covs)
{ {
cout << "Buffer state [" << this->size() << "] : <"; cout << "Buffer size: " << this->size() << " ; time stamps: <";
for (Motion mot : *this) for (Motion mot : *this)
cout << " " << mot.ts_; cout << " " << mot.ts_;
cout << " >" << endl; cout << " >" << endl;
...@@ -165,17 +165,20 @@ void MotionBuffer::print(bool show_data, bool show_delta, bool show_delta_int, b ...@@ -165,17 +165,20 @@ void MotionBuffer::print(bool show_data, bool show_delta, bool show_delta_int, b
if (show_data) if (show_data)
{ {
cout << " data: " << mot.data_.transpose() << endl; cout << " data: " << mot.data_.transpose() << endl;
cout << " data cov: \n" << mot.data_cov_ << endl; if (show_covs)
cout << " data cov: \n" << mot.data_cov_ << endl;
} }
if (show_delta) if (show_delta)
{ {
cout << " delta: " << mot.delta_.transpose() << endl; cout << " delta: " << mot.delta_.transpose() << endl;
cout << " delta cov: \n" << mot.delta_cov_ << endl; if (show_covs)
cout << " delta cov: \n" << mot.delta_cov_ << endl;
} }
if (show_delta_int) if (show_delta_int)
{ {
cout << " delta integrated: " << mot.delta_integr_.transpose() << endl; cout << " delta integrated: " << mot.delta_integr_.transpose() << endl;
cout << " delta integrated cov: \n" << mot.delta_integr_cov_ << endl; if (show_covs)
cout << " delta integrated cov: \n" << mot.delta_integr_cov_ << endl;
} }
if (show_jacs) if (show_jacs)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment