articulated_objects.h
Go to the documentation of this file.
1/**
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @author Niklas Arlt ( niklas dot arlt at kit dot edu )
17 * @date 2026
18 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19 * GNU General Public License
20 */
21
22#pragma once
23
24#include <string>
25#include <vector>
26
27#include <VirtualRobot/VirtualRobot.h>
28#include <VirtualRobot/XML/RobotIO.h>
29
33
35{
36
38 {
39 std::vector<VirtualRobot::RobotPtr> objects;
40
41 /// Objects whose description or state was not (yet) available in the object memory.
42 std::vector<armarx::ObjectID> missing;
43
44 bool
45 complete() const
46 {
47 return missing.empty();
48 }
49
50 /// The missing object IDs, for logging.
51 std::string missingToString() const;
52 };
53
54 /**
55 * @brief Loads the articulated objects for the given (already filtered) articulated object
56 * poses.
57 *
58 * Objects that cannot be loaded or synchronized are reported in `missing` instead of throwing.
59 * This happens regularly during startup: the object pose provider and the object memory
60 * segments are filled by different producers, so a pose can be known before the corresponding
61 * memory entry exists. The caller decides whether to retry or to continue without the object.
62 */
63 ArticulatedObjectsResult loadArticulatedObjects(
65 const objpose::ObjectPoseSeq& articulatedObjectPoses,
66 VirtualRobot::RobotIO::RobotDescription loadMode = VirtualRobot::RobotIO::eStructure);
67
68} // namespace armarx::navigation::util
This file is part of ArmarX.
ArticulatedObjectsResult loadArticulatedObjects(armem::articulated_object::ArticulatedObjectReader &reader, const objpose::ObjectPoseSeq &articulatedObjectPoses, VirtualRobot::RobotIO::RobotDescription loadMode)
Loads the articulated objects for the given (already filtered) articulated object poses.
std::vector< ObjectPose > ObjectPoseSeq
std::vector< armarx::ObjectID > missing
Objects whose description or state was not (yet) available in the object memory.
std::string missingToString() const
The missing object IDs, for logging.
std::vector< VirtualRobot::RobotPtr > objects