Skip to content
Snippets Groups Projects
Commit d635e4e2 authored by Fabian Reister's avatar Fabian Reister
Browse files

Merge branch 'armem/dev' into feature/armem-robot-state-memory-update

parents 63279b6a 69207540
No related branches found
No related tags found
2 merge requests!157armem/dev => master,!144robot state memory update
This commit is part of merge request !157. Comments created here will be created in the context of that merge request.
...@@ -144,4 +144,24 @@ namespace armarx::armem::client::query_fns ...@@ -144,4 +144,24 @@ namespace armarx::armem::client::query_fns
}; };
} }
} inline
std::function<void(query::SnapshotSelector&)>
beforeOrAtTime(Time time)
{
return [ = ](query::SnapshotSelector & selector)
{
selector.beforeOrAtTime(time);
};
}
inline
std::function<void(query::SnapshotSelector&)>
beforeTime(Time time, long nElements)
{
return [ = ](query::SnapshotSelector & selector)
{
selector.beforeTime(time, nElements);
};
}
} // namespace armarx::armem::client::query_fns
#include "selectors.h" #include "selectors.h"
#include "RobotAPI/libraries/armem/core/ice_conversions.h"
#include <RobotAPI/libraries/armem/core/workingmemory/ice_conversions.h> #include <RobotAPI/libraries/armem/core/workingmemory/ice_conversions.h>
...@@ -60,10 +61,19 @@ namespace armarx::armem::client::query ...@@ -60,10 +61,19 @@ namespace armarx::armem::client::query
} }
SnapshotSelector& SnapshotSelector::beforeTimestamp(Time timestamp) SnapshotSelector& SnapshotSelector::beforeOrAtTime(Time timestamp)
{
auto& q = _addQuery<dq::entity::BeforeOrAtTime>();
toIce(q.timestamp, timestamp);
return *this;
}
SnapshotSelector& SnapshotSelector::beforeTime(Time timestamp, long maxEntries)
{ {
auto& q = _addQuery<dq::entity::BeforeTime>(); auto& q = _addQuery<dq::entity::BeforeTime>();
toIce(q.timestamp, timestamp); toIce(q.timestamp, timestamp);
toIce(q.maxEntries, maxEntries);
return *this; return *this;
} }
......
...@@ -27,8 +27,9 @@ namespace armarx::armem::client::query ...@@ -27,8 +27,9 @@ namespace armarx::armem::client::query
SnapshotSelector& latest(); SnapshotSelector& latest();
SnapshotSelector& atTime(Time timestamp); SnapshotSelector& atTime(Time timestamp);
SnapshotSelector& atTimeApprox(Time timestamp, Duration eps); SnapshotSelector& atTimeApprox(Time timestamp, Duration eps);
SnapshotSelector& beforeTimestamp(Time timestamp);
SnapshotSelector& beforeTime(Time timestamp, long maxEntries);
SnapshotSelector& beforeOrAtTime(Time timestamp);
SnapshotSelector& timeRange(Time min, Time max); SnapshotSelector& timeRange(Time min, Time max);
SnapshotSelector& indexRange(long first, long last); SnapshotSelector& indexRange(long first, long last);
......
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