25 #include <VirtualRobot/ManipulationObject.h>
26 #include <VirtualRobot/SceneObjectSet.h>
27 #include <VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.h>
28 #include <VirtualRobot/Visualization/TriMeshModel.h>
38 VirtualRobot::ManipulationObjectPtr
43 const VirtualRobot::SceneObjectSetPtr sceneObjects(
new VirtualRobot::SceneObjectSet);
54 VirtualRobot::SceneObjectSetPtr
59 VirtualRobot::SceneObjectSetPtr sceneObjects(
new VirtualRobot::SceneObjectSet);
60 for (
const auto& objectPose : objectPoses)
64 obstacle->setGlobalPose(objectPose.objectPoseGlobal);
65 obstacle->setName(objectPose.objectID.instanceName());
66 sceneObjects->addSceneObject(obstacle);
73 VirtualRobot::SceneObjectSetPtr
78 const auto obstacles = ocHelper.
obstacles();
80 const float boxSize = occupancyGrid.
resolution;
81 const float resolution = occupancyGrid.
resolution;
83 VirtualRobot::SceneObjectSetPtr sceneObjects(
new VirtualRobot::SceneObjectSet);
86 <<
"Only occupancy grid in global frame supported.";
88 VirtualRobot::CoinVisualizationFactory factory;
90 const auto& world_T_map = occupancyGrid.
pose;
92 for (
int x = 0; x < obstacles.rows(); x++)
94 for (
int y = 0; y < obstacles.cols(); y++)
98 const Eigen::Vector3f pos{
99 static_cast<float>(x) * resolution,
static_cast<float>(y) * resolution, 0};
103 map_T_obj.translation() = pos;
105 Eigen::Affine3f world_T_obj = world_T_map * map_T_obj;
109 auto cube = factory.createBox(boxSize, boxSize, boxSize);
111 const VirtualRobot::CollisionModelPtr collisionModel(
112 new VirtualRobot::CollisionModel(cube));
115 "box_" +
std::to_string(sceneObjects->getSize()), cube, collisionModel));
116 sceneObject->setGlobalPose(world_T_obj.matrix());
118 sceneObjects->addSceneObject(sceneObject);
127 objectPoseClient_(client)
131 VirtualRobot::SceneObjectSetPtr
150 for (
const auto& pose : objectPoses)
155 return std::make_shared<ManipulationObjectSet>(
set);
163 auto faces = model->getTriMeshModel()->faces;
164 std::vector<armarx::viz::data::Face> viz_faces;
168 std::back_inserter(viz_faces),
171 return armarx::viz::data::Face(
172 face.id1, face.id2, face.id3, face.idColor1, face.idColor2, face.idColor3);
174 mesh.
vertices(model->getTriMeshModel()->vertices)
176 .
pose(model->getGlobalPose());