10#include <SimoxUtility/caching/CacheMap.h>
11#include <SimoxUtility/shapes/OrientedBox.h>
12#include <VirtualRobot/VirtualRobot.h>
28#include <RobotAPI/interface/core/RobotState.h>
29#include <RobotAPI/interface/objectpose/ObjectPoseProvider.h>
30#include <RobotAPI/interface/objectpose/ObjectPoseStorageInterface.h>
31#include <RobotAPI/interface/objectpose/object_pose_types.h>
70 const std::string& prefix =
"calibration.");
80 const std::string& prefix =
"")
override;
86 const objpose::data::ProvidedObjectPoseSeq& providedPoses,
88 std::optional<Time> discardUpdatesUntil = std::nullopt);
90 const std::string& providerName =
"");
98 const std::string& providerName =
"");
101 objpose::ProviderInfo
getProviderInfo(
const std::string& providerName);
103 objpose::AttachObjectToRobotNodeOutput
105 objpose::DetachObjectFromRobotNodeOutput
107 objpose::DetachAllObjectsFromRobotNodesOutput
124 bool&
synchronized)
const;
131 static std::map<std::string, ObjectPoseMap>
133 static std::map<std::string, ObjectPoseMap>
136 std::map<std::string, ObjectPoseMap>& out);
147 static std::map<DateTime, ObjectPose>
160 bool& agentSynchronized)
const;
164 bool& agentSynchronized)
const;
170 void storeDetachedSnapshot(
wm::Entity& entity,
171 const arondto::ObjectInstance&
data,
173 bool commitAttachedPose,
177 std::optional<wm::EntityInstance> findClassInstance(
const ObjectID& objectID)
const;
184 std::optional<armarx::objects::Scene> loadScene(
const std::string& filename);
185 std::optional<armarx::objects::Scene> loadScene(
const std::filesystem::path& path);
186 std::optional<std::filesystem::path> resolveSceneFilepath(
const std::string& filename);
190 void commitSceneSnapshotFromFilename(
const std::string& filename,
bool lockMemory);
200 std::map<std::string, VirtualRobot::RobotPtr>
loaded;
203 const std::string& providerName =
"");
221 bool discardSnapshotsWhileAttached =
true;
223 bool separateProviderForAttachedObjects =
false;
225 bool automaticallyDetachObjectsOnHandOpening =
false;
226 float automaticallyDetachPositionThreshold = 0.2;
230 std::string sceneSnapshotsDirectory =
"scenes";
231 std::string sceneSnapshotsToLoad =
"";
233 bool autoReloadSceneSnapshotsOnFileChange =
false;
235 std::vector<std::string> getSceneSnapshotsToLoad()
const;
237 std::string attachedProviderName =
"attached";
244 simox::caching::CacheMap<ObjectID, std::optional<simox::OrientedBoxf>> oobbCache;
247 simox::caching::CacheMap<std::string, std::string> classNameToDatasetCache;
249 std::unique_ptr<CMakePackageFinder> finder;
251 static const std::string timestampPlaceholder;
275 std::unique_ptr<ArticulatedObjectVisu> visu;
Base Class for all Logging classes.
Used to find objects in the ArmarX objects repository [1] (formerly [2]).
static const std::string DefaultObjectsPackageName
A known object ID of the form "Dataset/ClassName" or "Dataset/ClassName/InstanceName".
IceUtil::Handle< RunningTask< T > > pointer_type
Shared pointer type for convenience.
The VirtualRobotReader class.
Helps connecting a Memory server to the Ice interface.
Models decay of object localizations by decreasing the confidence the longer the object was not local...
friend struct DetachVisitor
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
static std::map< std::string, ObjectPoseMap > getLatestObjectPosesByProviders(const wm::ProviderSegment &provSeg)
static ObjectPose getLatestObjectPose(const wm::Entity &entity)
std::map< ObjectID, ObjectPose > ObjectPoseMap
objpose::AttachObjectToRobotNodeOutput attachObjectToRobotNode(const objpose::AttachObjectToRobotNodeInput &input)
::armarx::armem::articulated_object::ArticulatedObjects getArticulatedObjects()
objpose::ProviderInfo getProviderInfo(const std::string &providerName)
CommitStats commitObjectPoses(const std::string &providerName, const objpose::data::ProvidedObjectPoseSeq &providedPoses, const Calibration &calibration, std::optional< Time > discardUpdatesUntil=std::nullopt)
void runUpdateObjectPoses()
objpose::ProviderInfoMap providers
objpose::DetachObjectFromRobotNodeOutput detachObjectFromRobotNode(const objpose::DetachObjectFromRobotNodeInput &input)
std::optional< simox::OrientedBoxf > getObjectOOBB(const ObjectID &id)
objpose::ObjectPoseMap getObjectPosesByProvider(const std::string &providerName, const DateTime &now)
objpose::ObjectPoseSeq ObjectPoseSeq
static ObjectPoseMap getLatestObjectPoses(const wm::CoreSegment &coreSeg)
objpose::DetachAllObjectsFromRobotNodesOutput detachAllObjectsFromRobotNodes(const objpose::DetachAllObjectsFromRobotNodesInput &input)
void connect(viz::Client arviz)
objpose::ObjectPoseMap getObjectPoses(const DateTime &now)
static arondto::ObjectInstance getLatestInstanceData(const wm::Entity &entity)
ObjectFinder objectFinder
static std::map< DateTime, ObjectPose > getObjectPosesInRange(const wm::Entity &entity, const DateTime &start, const DateTime &end)
objpose::ObjectPose ObjectPose
void updateAttachement(ObjectPose &objectPose, VirtualRobot::RobotPtr agent, bool &synchronized) const
If the object is attached to a robot node, update it according to the current robot state.
std::map< std::string, ObjectPoseMap > getLatestObjectPosesByProviders()
Segment(server::MemoryToIceAdapter &iceMemory)
wm::Entity * findObjectEntity(const ObjectID &objectID, const std::string &providerName="")
virtual ~Segment() override
A base class for core segments.
MemoryToIceAdapter & iceMemory
Represents a point in time.
std::shared_ptr< class Robot > RobotPtr
armarx::armem::robot_state::Robots ArticulatedObjects
armarx::core::time::DateTime Time
std::map< ObjectID, ObjectPose > ObjectPoseMap
std::vector< ObjectPose > ObjectPoseSeq
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="calibration.")
armarx::RemoteGui::Client::CheckBox detachAllObjectsCommitAttachedPoseCheckBox
armarx::RemoteGui::Client::CheckBox infiniteHistory
armarx::RemoteGui::Client::GroupBox group
armarx::RemoteGui::Client::Button detachAllObjectsButton
armarx::RemoteGui::Client::IntSpinBox maxHistorySize
armarx::RemoteGui::Client::LineEdit storeLoadLine
armarx::RemoteGui::Client::CheckBox discardSnapshotsWhileAttached
void update(Segment &data)
armarx::RemoteGui::Client::Button storeButton
armarx::RemoteGui::Client::Button loadButton
void setup(const Segment &data)
Loaded robot models identified by the robot name.
robot_state::VirtualRobotReader * reader
std::map< std::string, VirtualRobot::RobotPtr > loaded
VirtualRobot::RobotPtr get(const std::string &robotName, const std::string &providerName="")
An object pose as stored by the ObjectPoseStorage.