Go to the documentation of this file.
8 #include <SimoxUtility/math/pose/pose.h>
9 #include <SimoxUtility/math/regression/linear.h>
22 #include <RobotAPI/libraries/armem_robot_state/aron/Robot.aron.generated.h>
50 defs->optional(properties.predictionTimeWindow,
51 "prediction.TimeWindow",
52 "Duration of time window into the past to use for predictions"
53 " when requested via the PredictingMemoryInterface (in seconds).");
61 [
this](
const PredictionRequest& request){
return this->predictLinear(request); });
73 return this->
doLocked([
this, ×tamp]()
83 using ::armarx::armem::robot_state::localization::TransformHelper;
84 using ::armarx::armem::robot_state::localization::TransformQuery;
95 .timestamp = timestamp
99 const auto result = TransformHelper::lookupTransformChain(*
segmentPtr, query);
106 frames.emplace(robotName, result.transforms);
110 <<
"Number of known robot pose chains: " << frames.size();
119 return this->
doLocked([
this, ×tamp]()
129 using ::armarx::armem::robot_state::localization::TransformHelper;
130 using ::armarx::armem::robot_state::localization::TransformQuery;
142 .timestamp = timestamp
146 if (
const auto result = TransformHelper::lookupTransform(*
segmentPtr, query))
148 robotGlobalPoses.emplace(robotName, result.transform.transform);
157 <<
"Number of known robot poses: " << robotGlobalPoses.size();
159 return robotGlobalPoses;
192 arondto::Transform aronTransform;
194 update.instancesData = {aronTransform.toAron()};
209 " is not supported in Proprioception.";
213 static const int tangentDims = 6;
224 info = getSnapshotsInRange<server::wm::CoreSegment, Vector6d, arondto::Transform>(
227 timeOrigin - timeWindow,
231 Eigen::Matrix4d mat =
232 arondto::Transform::FromAron(data).transform.cast<double>();
233 manif::SE3d se3(simox::math::position(mat),
234 Eigen::Quaterniond(simox::math::orientation(mat)));
235 return se3.log().coeffs();
238 { return arondto::Transform::FromAron(data); });
250 using simox::math::LinearRegression;
251 const bool inputOffset =
false;
252 const LinearRegression<tangentDims> model = LinearRegression<tangentDims>::Fit(
255 Vector6d linearPred =
256 model.predict((predictionTime - timeOrigin).toSecondsDouble());
257 prediction = manif::SE3Tangentd(linearPred).exp().transform().cast<
float>();
armem::MemoryID snapshotID
std::vector< double > timestampsSec
const MemoryID localizationSegmentID
A bundle of updates to be sent to the memory.
virtual ~Segment() override
Helps connecting a Memory server to the Ice interface.
const std::string GlobalFrame
void toAron(arondto::MemoryID &dto, const MemoryID &bo)
PredictionSettings predictionSettings
Segment(server::MemoryToIceAdapter &iceMemory)
const std::string robotRootNodeName
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
std::vector< std::string > getProviderSegmentNames() const
server::wm::CoreSegment * segmentPtr
MemoryID withProviderSegmentName(const std::string &name) const
aron::data::DictPtr prediction
virtual void init() override
auto doLocked(FunctionT &&function) const
RobotPoseMap getRobotGlobalPosesLocking(const armem::Time ×tamp) const
RobotPoseMap getRobotGlobalPoses(const armem::Time ×tamp) const
An update of an entity for a specific point in time.
static Duration SecondsDouble(double seconds)
Constructs a duration in seconds.
bool commitTransformLocking(const armem::robot_state::localization::Transform &transform)
std::vector< DataType > values
void addPredictor(const PredictionEngine &engine, Predictor &&predictor)
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
bool commitTransform(const armem::robot_state::localization::Transform &transform)
Represents a point in time.
std::shared_ptr< Dict > DictPtr
MatrixXX< 4, 4, float > Matrix4f
MemoryID withEntityName(const std::string &name) const
std::unordered_map< std::string, Eigen::Isometry3f > RobotPoseMap
MemoryToIceAdapter & iceMemory
RobotFramePoseMap getRobotFramePosesLocking(const armem::Time ×tamp) const
auto transform(const Container< InputT, Alloc > &in, OutputT(*func)(InputT const &)) -> Container< OutputT, typename std::allocator_traits< Alloc >::template rebind_alloc< OutputT > >
Convenience function (with less typing) to transform a container of type InputT into the same contain...
Holds info on snapshot data extracted from a time range.
SpamFilterDataPtr deactivateSpam(float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
disables the logging for the current line for the given amount of seconds.
std::unordered_map< std::string, std::vector< Eigen::Isometry3f > > RobotFramePoseMap
armem::MemoryID snapshotID
virtual void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
data::CommitResult commitLocking(const data::Commit &commitIce, Time timeArrived)
data::CommitResult commit(const data::Commit &commitIce, Time timeArrived)
RobotFramePoseMap getRobotFramePoses(const armem::Time ×tamp) const
std::string predictionEngineID