Skip to content

Commit

Permalink
Fix number of samples
Browse files Browse the repository at this point in the history
This should fix the number of samples being saved in the snippet examples. All examples, in face, claim to save 3 samples while all 'for' loops were from 0 to 10.
  • Loading branch information
DanielePucci authored Jan 5, 2024
1 parent 29646dc commit 09db288
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Here is the code snippet for dumping in a `.mat` file 3 samples of the scalar va
return 1;
}

for (int i = 0; i < 10; i++) {
for (int i = 0; i < 3; i++) {
bm.push_back(i , "one");
std::this_thread::sleep_for(std::chrono::milliseconds(200));
bm.push_back(i + 1.0, "two");
Expand Down Expand Up @@ -144,7 +144,7 @@ Here is the code snippet for dumping in a `.mat` file 3 samples of the 4x1 vecto
bufferConfig.n_samples = 3;
robometry::BufferManager bm_v(bufferConfig); //Only vectors of doubles are accepted
for (int i = 0; i < 10; i++) {
for (int i = 0; i < 3; i++) {
bm_v.push_back({ i+1.0, i+2.0, i+3.0, i+4.0 }, "one");
std::this_thread::sleep_for(std::chrono::milliseconds(200));
bm_v.push_back({ (double)i, i*2.0, i*3.0, i*4.0 }, "two");
Expand Down Expand Up @@ -226,7 +226,7 @@ Here is the code snippet for dumping in a `.mat` file 3 samples of the 2x3 matri
return 1;
}
for (int i = 0; i < 10; i++) {
for (int i = 0; i < 3; i++) {
bm_m.push_back({ i + 1, i + 2, i + 3, i + 4, i + 5, i + 6 }, "one");
std::this_thread::sleep_for(std::chrono::milliseconds(200));
bm_m.push_back({ i * 1, i * 2, i * 3, i * 4, i * 5, i * 6 }, "two");
Expand Down Expand Up @@ -260,7 +260,7 @@ Here is the code snippet for dumping in a `.mat` file 3 samples of the 4x1 vecto
bufferConfig.n_samples = 3;

robometry::BufferManager bm_v(bufferConfig);
for (int i = 0; i < 10; i++) {
for (int i = 0; i < 3; i++) {
bm_v.push_back({ i+1.0, i+2.0, i+3.0, i+4.0 }, "struct1::one");
std::this_thread::sleep_for(std::chrono::milliseconds(200));
bm_v.push_back({ (double)i, i*2.0, i*3.0, i*4.0 }, "struct1::two");
Expand Down Expand Up @@ -336,7 +336,7 @@ VISITABLE_STRUCT(testStruct, a, b);
testStruct item;
for (int i = 0; i < 10; i++) {
for (int i = 0; i < 3; i++) {
bm.push_back(i, "int_channel");
bm.push_back(i * 1.0, "double_channel");
bm.push_back("iter" + std::to_string(i), "string_channel");
Expand Down

0 comments on commit 09db288

Please sign in to comment.