29 AgentInstancesSegmentBase::AgentInstancesSegmentBase(),
37 AgentInstanceBaseList result;
39 result.reserve(allEntities.size());
41 for (
auto&& entity : allEntities)
43 AgentInstanceBasePtr agentEntity = AgentInstanceBasePtr::dynamicCast(std::move(entity));
48 <<
" is not of type AgentInstance!";
52 result.push_back(std::move(agentEntity));
66 AgentInstanceBasePtr res = AgentInstanceBasePtr::dynamicCast(entity);
70 ARMARX_WARNING_S <<
"Entity with id " <<
id <<
" is not of type AgentInstance!";
78 const ::Ice::Current&)
const
85 AgentInstanceBasePtr res = AgentInstanceBasePtr::dynamicCast(entity);
89 ARMARX_WARNING_S <<
"Entity with name '" << name <<
"' is not of type AgentEntity!";
95 armarx::FramedPoseBasePtr
97 const armarx::FramedPoseBasePtr& localPose,
98 const Ice::Current&
c)
const
114 armarx::FramedPositionPtr::dynamicCast(agent->getPositionBase());
116 armarx::FramedOrientationPtr::dynamicCast(agent->getOrientationBase());
118 new armarx::Pose(agentOrientation->toEigen(), agentPosition->toEigen());
123 auto robotPrx = agent->getSharedRobot();
127 ARMARX_ERROR_S <<
"Could not create proxy to robot state - proxy string was : "
128 << agent->getStringifiedSharedRobotInterfaceProxy() <<
" for agent "
133 localPoseCast->changeFrame(robotPrx, robotPrx->getRootNode()->getName());
134 Eigen::Matrix4f objectPoseGlobal = agentPose->toEigen() * localPoseCast->toEigen();
140 armarx::FramedPoseBasePtr
142 const armarx::PoseBasePtr& worldPose,
143 const std::string& targetFrame,
144 const Ice::Current&
c)
const
154 armarx::FramedPositionPtr::dynamicCast(agent->getPositionBase());
156 armarx::FramedOrientationPtr::dynamicCast(agent->getOrientationBase());
158 new armarx::Pose(agentOrientation->toEigen(), agentPosition->toEigen());
163 auto robotPrx = agent->getSharedRobot();
167 ARMARX_ERROR_S <<
"Could not create proxy to robot state - proxy string was : "
168 << agent->getStringifiedSharedRobotInterfaceProxy();
172 worldPoseCast->changeFrame(robotPrx, robotPrx->getRootNode()->getName());
173 Eigen::Matrix4f objectPoseLocal = worldPoseCast->toEigen() * agentPose->toEigen().inverse();
176 objectPoseLocal, robotPrx->getRootNode()->getName(), robotPrx->getName()));
177 p->changeFrame(robotPrx, targetFrame);
193 const EntityBasePtr& entity,
204 const EntityBasePtr& newEntity,
205 const ::Ice::Current&)
213 const EntityBasePtr& newEntity,
214 const ::Ice::Current&)
243 auto robotPrx = agentInstance->getSharedRobot();
252 new armarx::Pose(agentInstance->getPosition(), agentInstance->getOrientation());
253 robotPrx->setGlobalPose(pose);