Go to the documentation of this file.
3 #include <SimoxUtility/math/pose.h>
20 defs->optional(
showGhost, prefix +
"showGhost",
21 "Show ghosts at linearly predicted object poses.");
22 defs->optional(
ghostAlpha, prefix +
"ghostAlpha",
23 "Alpha of linear prediction ghosts.");
24 defs->optional(
showFrame, prefix +
"showFrame",
25 "Show frames at linearly predicted object poses.");
26 defs->optional(
showArrow, prefix +
"showArrow",
27 "Show arrows from current object poses to the linearly predicted ones.");
29 "The offset (in seconds) to the current time to make predictions for.");
31 "The time window (in seconds) into the past to perform the regression on.");
43 std::function<
viz::Object(
const std::string& key)> makeObjectFn,
45 const std::map<DateTime, objpose::ObjectPose>& poseHistory,
56 if (predictionResult.success)
58 auto predictedObjectPose =
59 armarx::fromIce<objpose::ObjectPose>(predictionResult.prediction);
61 inGlobalFrame ? predictedObjectPose.objectPoseGlobal : predictedObjectPose.objectPoseRobot;
65 layer.
add(makeObjectFn(key +
" Linear Prediction Ghost")
67 .overrideColor(simox::Color::white().with_alpha(
ghostAlpha)));
72 .pose(predictedPose));
77 .fromTo(simox::math::position(pose), simox::math::position(predictedPose))
85 << predictionResult.errorMessage;
119 grid.
add(showBoxes, {row, 0}, {1, 2});
122 grid.
add(
Label(
"Prediction time (sec from now):"), {row, 0})
126 grid.
add(
Label(
"Model time window (sec before now):"), {row, 0})
armarx::RemoteGui::Client::FloatSpinBox timeWindowSeconds
armarx::RemoteGui::Client::CheckBox showFrame
armarx::RemoteGui::Client::GroupBox group
GridLayout & add(Widget const &child, Pos pos, Span span=Span{1, 1})
armarx::RemoteGui::Client::CheckBox showGhost
void setValue(float newValue)
void draw(viz::Layer &layer, std::function< viz::Object(const std::string &key)> makeObjectFn, const objpose::ObjectPose &objectPose, const std::map< DateTime, objpose::ObjectPose > &poseHistory, bool inGlobalFrame) const
void setRange(float min, float max)
void add(ElementT const &element)
uint32_t Label
Type of an object label.
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix)
void update(LinearPredictions &data)
static Duration SecondsDouble(double seconds)
Constructs a duration in seconds.
void setLabel(std::string const &text)
void setup(const LinearPredictions &data)
armarx::ObjectID objectID
The object ID, i.e. dataset, class name and instance name.
MatrixXX< 4, 4, float > Matrix4f
armarx::RemoteGui::Client::CheckBox showArrow
Eigen::Matrix4f objectPoseGlobal
The object pose in the global frame.
void setValue(bool newValue)
Visualization control for linear predictions for objects.
armarx::RemoteGui::Client::FloatSpinBox ghostAlpha
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.
Eigen::Matrix4f objectPoseRobot
The object pose in the robot root frame.
static Color azure(int az=255, int a=255)
2 Blue + 1 Green
An object pose as stored by the ObjectPoseStorage.
objpose::ObjectPosePredictionResult predictObjectPoseLinear(const std::map< DateTime, ObjectPose > &poses, const DateTime &time, const ObjectPose &latestPose)
Predict the pose of an object given a history of poses based on a linear regression.
std::string str() const
Return "dataset/className" or "dataset/className/instanceName".
armarx::RemoteGui::Client::FloatSpinBox timeOffsetSeconds