3 #include <VirtualRobot/Robot.h>
4 #include <VirtualRobot/RobotConfig.h>
6 #include <SimoxUtility/algorithm/string.h>
7 #include <SimoxUtility/shapes/AxisAlignedBoundingBox.h>
8 #include <SimoxUtility/shapes/OrientedBox.h>
23 os <<
"'" <<
id.dataset <<
"/" <<
id.className;
24 if (!
id.instanceName.empty())
26 os <<
"/" <<
id.instanceName;
40 return { ice.dataset, ice.className, ice.instanceName };
45 ice.dataset =
id.dataset();
46 ice.className =
id.className();
47 ice.instanceName =
id.instanceName();
66 std::vector<ObjectID> ids;
71 void armarx::toIce(data::ObjectIDSeq& ice,
const std::vector<ObjectID>& ids)
78 armarx::data::ObjectIDSeq
armarx::toIce(
const std::vector<ObjectID>& ids)
80 data::ObjectIDSeq ice;
89 { objpose::ObjectType::AnyObject,
"AnyObject" },
90 { objpose::ObjectType::KnownObject,
"KnownObject" },
91 { objpose::ObjectType::UnknownObject,
"UnknownObject" }
97 ice.center =
new Vector3(aabb.center());
98 ice.extents =
new Vector3(aabb.extents());
109 Eigen::Vector3f corner = pos - ori * extents / 2;
112 ori.col(0) * extents(0),
113 ori.col(1) * extents(1),
114 ori.col(2) * extents(2));
116 catch (
const armarx::LocalException&)
136 simox::OrientedBoxf oobb;
143 box.position =
new Vector3(oobb.center());
144 box.orientation =
new Quaternion(oobb.rotation().eval());
145 box.extents =
new Vector3(oobb.dimensions());
168 if (
static_cast<Eigen::Index
>(ice.covariance6x6.size()) != cov.
covariance.size())
171 <<
"Float sequence representing 6x6 covariance matrix must have " << cov.
covariance.size()
172 <<
" values, but has " << ice.covariance6x6.size() <<
": \n"
173 <<
"[" << simox::alg::join(simox::alg::multi_to_string(ice.covariance6x6),
", ") <<
"]"
183 void objpose::fromIce(
const data::PoseManifoldGaussianPtr& ice, std::optional<PoseManifoldGaussian>& cov)
196 std::optional<objpose::PoseManifoldGaussian>
objpose::fromIce(
const data::PoseManifoldGaussianPtr& ice)
198 std::optional<objpose::PoseManifoldGaussian> cov;
208 ice.covariance6x6.resize(cov.
covariance.size());
214 void objpose::toIce(data::PoseManifoldGaussianPtr& ice,
const std::optional<PoseManifoldGaussian>& cov)
218 ice =
new data::PoseManifoldGaussian;
219 toIce(*ice, cov.value());
227 objpose::data::PoseManifoldGaussianPtr
objpose::toIce(
const std::optional<PoseManifoldGaussian>& cov)
229 data::PoseManifoldGaussianPtr ice;