30 bool ICubClient::pushKarmaLeft(
const std::string &objName,
const double &targetPosYLeft,
31 const std::string &armType,
32 const yarp::os::Bottle &options)
37 yError() <<
"[iCubClient] Called pushKarmaLeft() but KARMA subsystem is not available.";
41 if (opc->isConnected())
43 Entity *target = opc->getEntity(objName,
true);
46 yWarning() <<
"[iCubClient] Called pushKarmaLeft() on a unallowed entity: \"" << objName <<
"\"";
51 if (!oTarget || oTarget->
m_present != 1.0)
53 yWarning() <<
"[iCubClient] Called pushKarmaLeft() on an unavailable entity: \"" << objName <<
"\"";
57 yInfo(
"[icubClient pushKarmaLeft] object %s position from OPC (no calibration): %s", oTarget->
name().c_str(),
63 yWarning() <<
"[iCubClient] There is no OPC connection";
69 bool ICubClient::pushKarmaRight(
const std::string &objName,
const double &targetPosYRight,
70 const std::string &armType,
71 const yarp::os::Bottle &options)
76 yError() <<
"[iCubClient] Called pushKarmaRight() but KARMA subsystem is not available.";
80 if (opc->isConnected())
82 Entity *target = opc->getEntity(objName,
true);
85 yWarning() <<
"[iCubClient] Called pushKarmaRight() on a unallowed entity: \"" << objName <<
"\"";
90 if (!oTarget || oTarget->
m_present != 1.0)
92 yWarning() <<
"[iCubClient] Called pushKarmaRight() on an unavailable entity: \"" << objName <<
"\"";
96 yInfo(
"[icubClient pushKarmaRight] object %s position from OPC (no calibration): %s", oTarget->
name().c_str(),
102 yWarning() <<
"[iCubClient] There is no OPC connection";
108 bool ICubClient::pushKarmaFront(
const std::string &objName,
const double &targetPosXFront,
109 const std::string &armType,
110 const yarp::os::Bottle &options)
113 if (karma ==
nullptr)
115 yError() <<
"[iCubClient] Called pushKarmaFront() but KARMA subsystem is not available.";
119 if (opc->isConnected())
121 Entity *target = opc->getEntity(objName,
true);
124 yWarning() <<
"[iCubClient] Called pushKarmaFront() on a unallowed entity: \"" << objName <<
"\"";
129 if (!oTarget || oTarget->
m_present != 1.0)
131 yWarning() <<
"[iCubClient] Called pushKarmaFront() on an unavailable entity: \"" << objName <<
"\"";
135 yInfo(
"[icubClient pushKarmaFront] object %s position from OPC (no calibration): %s", oTarget->
name().c_str(),
141 yWarning() <<
"[iCubClient] There is no OPC connection";
147 bool ICubClient::pushKarma(
const yarp::sig::VectorOf<double> &targetCenter,
const double &theta,
const double &radius,
148 const yarp::os::Bottle &options)
151 if (karma ==
nullptr)
153 yError() <<
"[iCubClient] Called pushKarma() but KARMA subsystem is not available.";
156 return karma->
push(targetCenter, theta, radius, options);
160 bool ICubClient::pullKarmaBack(
const std::string &objName,
const double &targetPosXBack,
161 const std::string &armType,
162 const yarp::os::Bottle &options)
165 if (karma ==
nullptr)
167 yError() <<
"[iCubClient] Called pullKarmaBack() but KARMA subsystem is not available.";
171 if (opc->isConnected())
173 Entity *target = opc->getEntity(objName,
true);
176 yWarning() <<
"[iCubClient] Called pushKarmaFront() on a unallowed entity: \"" << objName <<
"\"";
181 if (!oTarget || oTarget->
m_present != 1.0)
183 yWarning() <<
"[iCubClient] Called pushKarmaFront() on an unavailable entity: \"" << objName <<
"\"";
187 yInfo(
"[icubClient pullKarmaBack] object %s position from OPC (no calibration): %s", oTarget->
name().c_str(),
193 yWarning() <<
"[iCubClient] There is no OPC connection";
199 bool ICubClient::drawKarma(
const yarp::sig::VectorOf<double> &targetCenter,
const double &theta,
200 const double &radius,
const double &dist,
201 const yarp::os::Bottle &options)
204 if (karma ==
nullptr)
206 yError() <<
"[iCubClient] Called drawKarma() but KARMA subsystem is not available.";
209 return karma->
draw(targetCenter, theta, radius, dist, options);
bool pullBack(const std::string &objName, const yarp::sig::VectorOf< double > &objCenter, const double &targetPosXBack, const std::string &armType="selectable", const yarp::os::Bottle &options=yarp::os::Bottle())
pullBack (KARMA): pull an object to a certain location along x-axis of robot RoF
Represent any entity that can be stored within the OPC.
virtual bool isType(std::string _entityType) const
Test if an entity is inheriting a given type.
double m_present
Is the object present in the scene A value of 1.0 means that the object currently is in the scene A v...
SubSystem to deal with the experimental affordance learning module (a.k.a.
Represent any physical entity (including objects and agents) that can be stored within the OPC...
yarp::sig::VectorOf< double > m_ego_position
Position of the Object, in the initial ego-centered reference frame of the agent mainting the OPC (in...
bool draw(const yarp::sig::VectorOf< double > &targetCenter, const double theta, const double radius, const double dist, const yarp::os::Bottle &options=yarp::os::Bottle())
draw (KARMA): draw action, along the positive direction of the x-axis (in robot FoR) ...
std::string name() const
Return the name of an entity (which has to be unique within the OPC)
bool pushFront(const std::string &objName, const yarp::sig::VectorOf< double > &objCenter, const double &targetPosXFront, const std::string &armType="selectable", const yarp::os::Bottle &options=yarp::os::Bottle())
pushFront (KARMA): push an object to a certain location along x-axis of robot RoF ...
bool push(const yarp::sig::VectorOf< double > &targetCenter, const double theta, const double radius, const yarp::os::Bottle &options=yarp::os::Bottle())
push (KARMA): push to certain position, along a defined direction
bool pushAside(const std::string &objName, const yarp::sig::VectorOf< double > &objCenter, const double &targetPosY, const double &theta, const std::string &armType="selectable", const yarp::os::Bottle &options=yarp::os::Bottle())
pushAside (KARMA): push an object to a certain location along y-axis of robot RoF ...