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);
armarx::FramedPoseBasePtr convertToWorldPose(const std::string &agentName, const armarx::FramedPoseBasePtr &localPose, const Ice::Current &c=Ice::emptyCurrent) const override
void removeEntity(const ::std::string &id, const ::Ice::Current &=Ice::emptyCurrent) override
AgentInstancesSegment(armarx::IceManagerPtr ic)
void removeAllEntities(const ::Ice::Current &=Ice::emptyCurrent) override
std::string upsertEntityByName(const std::string &entityName, const EntityBasePtr &newEntity, const ::Ice::Current &=Ice::emptyCurrent) override
void setRemoteRobotPose(EntityBasePtr entity)
std::string upsertEntity(const std::string &entityId, const EntityBasePtr &newEntity, const ::Ice::Current &=Ice::emptyCurrent) override
AgentInstanceBaseList getAllAgentInstances(const ::Ice::Current &=Ice::emptyCurrent) const override
AgentInstanceBasePtr getAgentInstanceByName(const std::string &name, const ::Ice::Current &=Ice::emptyCurrent) const override
std::string addEntity(const EntityBasePtr &entity, const Ice::Current &) override
AgentInstanceBasePtr getAgentInstanceById(const std::string &id, const ::Ice::Current &=Ice::emptyCurrent) const override
void updateEntity(const std::string &id, const EntityBasePtr &entity, const Ice::Current &) override
armarx::FramedPoseBasePtr convertToLocalPose(const std::string &agentName, const armarx::PoseBasePtr &worldPose, const std::string &targetFrame, const Ice::Current &c=Ice::emptyCurrent) const override
std::string upsertEntityByName(const std::string &entityName, const EntityBasePtr &newEntity, const ::Ice::Current &c=Ice::emptyCurrent) override
std::string addEntity(const EntityBasePtr &entity, const ::Ice::Current &c=Ice::emptyCurrent) override
addEntity addes an entity to this segment. The registered fusion methods are applied in order to fuse...
void removeEntity(const ::std::string &id, const ::Ice::Current &c=Ice::emptyCurrent) override
std::string upsertEntity(const std::string &entityId, const EntityBasePtr &newEntity, const ::Ice::Current &c=Ice::emptyCurrent) override
void removeAllEntities(const ::Ice::Current &c=Ice::emptyCurrent) override
void updateEntity(const std::string &entityId, const EntityBasePtr &update, const ::Ice::Current &c=Ice::emptyCurrent) override
EntityBasePtr getEntityByName(const ::std::string &name) const
WorkingMemoryEntitySegment()
EntityBasePtr getEntityById(const ::std::string &id) const
EntityBaseList getAllEntities(const Ice::Current &c=Ice::emptyCurrent) const override
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
#define ARMARX_DEBUG_S
The logging level for output that is only interesting while debugging.
#define ARMARX_ERROR_S
The logging level for unexpected behaviour, that must be fixed.
#define ARMARX_IMPORTANT_S
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
#define ARMARX_WARNING_S
The logging level for unexpected behaviour, but not a serious problem.
std::string const GlobalFrame
Variable of the global coordinate system.
IceInternal::Handle< Pose > PosePtr
IceInternal::Handle< FramedPosition > FramedPositionPtr
IceInternal::Handle< FramedOrientation > FramedOrientationPtr
IceUtil::Handle< IceManager > IceManagerPtr
IceManager smart pointer.
IceInternal::Handle< FramedPose > FramedPosePtr
IceInternal::Handle< AgentInstance > AgentInstancePtr
Typedef of AgentEntityPtr as IceInternal::Handle<AgentEntity> for convenience.