3#include <SimoxUtility/math/scale_value.h>
16 "If true, object poses decay over time when not localized anymore.");
18 prefix +
"delaySeconds",
19 "Duration after latest localization before decay starts.");
21 durationSeconds, prefix +
"durationSeconds",
"How long to reach minimal confidence.");
22 defs->optional(
maxConfidence, prefix +
"maxConfidence",
"Confidence when decay starts.");
23 defs->optional(
minConfidence, prefix +
"minConfidence",
"Confidence after decay duration.");
25 prefix +
"removeObjectsBelowConfidence",
26 "Remove objects whose confidence is lower than this value.");
52 Decay::calculateConfidence(
const DateTime& localization,
const DateTime& now)
const
54 const float duration =
static_cast<float>((now - localization).toSecondsDouble());
65 return simox::math::scale_value_from_to(duration,
121 grid.
add(
Label(
"Remove Objects with Confidence < "), {row, 0})
125 group.setLabel(
"Decay");
126 group.addChild(grid);
int Label(int n[], int size, int *curLabel, MiscLib::Vector< std::pair< int, size_t > > *labels)
Models decay of object localizations by decreasing the confidence the longer the object was not local...
float durationSeconds
How long to reach minConfidence.
void updateConfidence(objpose::ObjectPose &pose, const DateTime &now) const
float delaySeconds
Duration after latest localization before decay starts.
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="decay.")
float removeObjectsBelowConfidence
void updateConfidences(objpose::ObjectPoseSeq &objectPoses, const DateTime &now) const
Represents a point in time.
std::vector< ObjectPose > ObjectPoseSeq
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
std::vector< T > max(const std::vector< T > &v1, const std::vector< T > &v2)
GridLayout & add(Widget const &child, Pos pos, Span span=Span{1, 1})
void setup(const Decay &decay)
armarx::RemoteGui::Client::GroupBox group
armarx::RemoteGui::Client::FloatSpinBox delaySeconds
armarx::RemoteGui::Client::FloatSlider minConfidence
armarx::RemoteGui::Client::FloatSlider maxConfidence
armarx::RemoteGui::Client::CheckBox enabled
armarx::RemoteGui::Client::FloatSpinBox durationSeconds
void update(Decay &decay)
armarx::RemoteGui::Client::FloatSlider removeObjectsBelowConfidence
An object pose as stored by the ObjectPoseStorage.
float confidence
Confidence in [0, 1] (1 = full, 0 = none).
std::optional< ObjectAttachmentInfo > attachment
Attachment information.
bool isStatic
Whether object is static. Static objects don't decay.
DateTime timestamp
Source timestamp.