3#include <SimoxUtility/math/pose.h>
21 showGhost, prefix +
"showGhost",
"Show ghosts at linearly predicted object poses.");
22 defs->optional(
ghostAlpha, prefix +
"ghostAlpha",
"Alpha of linear prediction ghosts.");
24 showFrame, prefix +
"showFrame",
"Show frames at linearly predicted object poses.");
27 "Show arrows from current object poses to the linearly predicted ones.");
29 prefix +
"timeOffset",
30 "The offset (in seconds) to the current time to make predictions for.");
32 prefix +
"timeWindow",
33 "The time window (in seconds) into the past to perform the regression on.");
44 std::function<
viz::Object(
const std::string& key)> makeObjectFn,
46 const std::map<DateTime, objpose::ObjectPose>& poseHistory,
47 bool inGlobalFrame)
const
50 const Eigen::Matrix4f pose =
55 if (predictionResult.success)
57 auto predictedObjectPose =
59 const Eigen::Matrix4f& predictedPose = inGlobalFrame
60 ? predictedObjectPose.objectPoseGlobal
61 : predictedObjectPose.objectPoseRobot;
65 layer.
add(makeObjectFn(key +
" Linear Prediction Ghost")
67 .overrideColor(simox::Color::white().with_alpha(
ghostAlpha)));
71 layer.
add(
viz::Pose(key +
" Linear Prediction Pose").pose(predictedPose));
77 .fromTo(simox::math::position(pose), simox::math::position(predictedPose))
79 .color(viz::Color::azure()));
85 << predictionResult.errorMessage;
119 Label(
" Ghost Alpha"),
121 grid.
add(showBoxes, {row, 0}, {1, 2});
124 grid.
add(
Label(
"Prediction time (sec from now):"), {row, 0})
128 grid.
add(
Label(
"Model time window (sec before now):"), {row, 0})
133 group.setLabel(
"Linear Predictions");
134 group.addChild(grid);
int Label(int n[], int size, int *curLabel, MiscLib::Vector< std::pair< int, size_t > > *labels)
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::string str() const
Return "dataset/className" or "dataset/className/instanceName".
static Duration SecondsDouble(double seconds)
Constructs a duration in seconds.
#define ARMARX_INFO
The normal logging level.
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.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
void fromIce(const std::map< IceKeyT, IceValueT > &iceMap, boost::container::flat_map< CppKeyT, CppValueT > &cppMap)
GridLayout & add(Widget const &child, Pos pos, Span span=Span{1, 1})
armarx::RemoteGui::Client::FloatSpinBox ghostAlpha
armarx::RemoteGui::Client::CheckBox showArrow
armarx::RemoteGui::Client::FloatSpinBox timeOffsetSeconds
armarx::RemoteGui::Client::CheckBox showGhost
armarx::RemoteGui::Client::GroupBox group
void setup(const LinearPredictions &data)
armarx::RemoteGui::Client::FloatSpinBox timeWindowSeconds
armarx::RemoteGui::Client::CheckBox showFrame
void update(LinearPredictions &data)
Visualization control for linear predictions for objects.
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix)
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
An object pose as stored by the ObjectPoseStorage.
armarx::ObjectID objectID
The object ID, i.e. dataset, class name and instance name.
Eigen::Matrix4f objectPoseRobot
The object pose in the robot root frame.
Eigen::Matrix4f objectPoseGlobal
The object pose in the global frame.
void add(ElementT const &element)