Skip to content
Snippets Groups Projects
Commit c46d9d7d authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Update usage of time in grasp provider example

parent dbf39b5e
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
#include <SimoxUtility/color/cmaps.h>
#include <ArmarXCore/core/exceptions/local/ExpressionException.h>
#include <ArmarXCore/core/time/CycleUtil.h>
#include <ArmarXCore/core/time/Metronome.h>
#include <RobotAPI/libraries/core/Pose.h>
......@@ -76,7 +76,7 @@ namespace armarx
{
ARMARX_IMPORTANT << "Running example.";
CycleUtil c(1000);
Metronome m(Duration::MilliSeconds(1000));
int i = 0;
......@@ -86,13 +86,13 @@ namespace armarx
grasping::GraspCandidate candidate = makeDummyGraspCandidate();
candidate.groupNr = i; //non-necessary field, but used to commit different candidates
writer.commitGraspCandidate(candidate, armem::Time::now(), "candidateProvider");
writer.commitGraspCandidate(candidate, armem::Time::Now(), "candidateProvider");
// initialize all necessary fields of a bimanual grasp candidate and use writer to commit it to memory
grasping::BimanualGraspCandidate bimanualCandidate = makeDummyBimanualGraspCandidate();
bimanualCandidate.groupNr = i; //non-necessary field, but used to commit different candidates
writer.commitBimanualGraspCandidate(bimanualCandidate, armem::Time::now(), "bimanualProvider");
writer.commitBimanualGraspCandidate(bimanualCandidate, armem::Time::Now(), "bimanualProvider");
//test for writing Seqs, candidates from the same object appear as instances of the same snapshot
......@@ -102,7 +102,7 @@ namespace armarx
candidatesToWrite.push_back(new grasping::GraspCandidate(candidate));
writer.commitGraspCandidateSeq(candidatesToWrite, armem::Time::now(), "candidateProvider");
writer.commitGraspCandidateSeq(candidatesToWrite, armem::Time::Now(), "candidateProvider");
// test reader and debug by logging the group number of the candidate
......@@ -139,7 +139,7 @@ namespace armarx
ARMARX_INFO << "bimanual candidate with ID " << id << " has group number " << ca->groupNr ;
}
c.waitForCycleDuration();
m.waitForNextTick();
}
}
......
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