27 bool ICubClient::home(
const string &part)
32 yError() <<
"[iCubClient] Called home() but ARE subsystem is not available.";
36 return are->
home(part);
39 bool ICubClient::release(
const std::string &oLocation,
const yarp::os::Bottle &options)
41 Entity *target = opc->getEntity(oLocation,
true);
44 yError() <<
"[iCubClient] Called release() on a unallowed location: \"" << oLocation <<
"\"";
49 if (!oTarget || oTarget->
m_present != 1.0)
51 yWarning() <<
"[iCubClient] Called release() on an unavailable entity: \"" << oLocation <<
"\"";
59 bool ICubClient::release(
const yarp::sig::VectorOf<double> &target,
const yarp::os::Bottle &options)
64 yError() <<
"[iCubClient] Called release() but ARE subsystem is not available.";
68 if (isTargetInRange(target))
69 return are->
dropOn(target, options);
72 yWarning() <<
"[iCubClient] Called release() on a unreachable location: (" << target.toString(3, 3).c_str() <<
")";
77 bool ICubClient::waving(
const bool sw) {
81 yError() <<
"[iCubClient] Called waving() but ARE subsystem is not available.";
94 yError() <<
"[iCubClient] Called pointfar() but ARE subsystem is not available.";
99 opt.addString(
"still");
100 return are->
point(target, opt);
106 Entity *target = opc->getEntity(sName,
true);
109 yWarning() <<
"[iCubClient] Called point() on a unallowed location: \"" << sName <<
"\"";
114 if(oTarget!=
nullptr) {
119 return point(target, options);
121 yError() <<
"[iCubClient] Called point() but ARE subsystem is not available.";
125 yError() <<
"[iCubClient] pointfar: Could not cast Entity to Object";
131 bool ICubClient::push(
const string &oLocation,
const Bottle &options)
136 yError() <<
"[iCubClient] Called push() but ARE subsystem is not available.";
141 opt.addString(
"still");
143 return are->
push(oLocation, opt);
147 bool ICubClient::take(
const std::string& oName,
const Bottle &options)
152 yError() <<
"[iCubClient] Called take() but ARE subsystem is not available.";
157 opt.addString(
"still");
158 return are->
take(oName, opt);
162 bool ICubClient::look(
const std::string &target,
const yarp::os::Bottle &options)
166 if (
Object *oTarget = dynamic_cast<Object*>(opc->getEntity(target,
true)))
167 if (oTarget->m_present == 1.0)
168 return are->look(oTarget->m_ego_position, options);
170 yWarning() <<
"[iCubClient] Called look() on an unavailable target: \"" << target <<
"\"";
174 yError() <<
"Error, neither Attention nor ARE are running...";
178 bool ICubClient::look(
const yarp::sig::VectorOf<double> &target,
const yarp::os::Bottle &options)
182 return are->look(target, options);
185 yError() <<
"Error, ARE not running...";
189 bool ICubClient::lookAtBodypart(
const std::string &sBodypartName)
194 vLoc = getPartnerBodypartLoc(sBodypartName);
195 if (vLoc.size() == 3){
196 return are->look(vLoc, yarp::os::Bottle());
199 yWarning() <<
"[iCubClient] Called lookAtBodypart() on an unvalid/unpresent agent or bodypart (" << sBodypartName <<
")";
bool point(const yarp::sig::VectorOf< double > &target, const yarp::os::Bottle &options=yarp::os::Bottle())
Point at a specified location from the iCub.
Represent any entity that can be stored within the OPC.
SubSystem to deal with the actionsRenderingEngine module (a.k.a.
bool push(const std::string &sName, const yarp::os::Bottle &options=yarp::os::Bottle())
Reach the specified [target] from one side and then push it laterally.
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...
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 point(const yarp::sig::VectorOf< double > &targetUnsafe, const yarp::os::Bottle &options=yarp::os::Bottle())
Point at the specified [target] with the index finger.
bool home(const std::string &part="all")
Put the specified part ih home position.
bool take(const std::string &sName, const yarp::os::Bottle &options=yarp::os::Bottle())
Reach the specified [target] and grasp it.
void selectHandCorrectTarget(yarp::os::Bottle &options, yarp::sig::VectorOf< double > &target, const std::string &objName, const std::string handToUse="")
bool dropOn(const yarp::sig::VectorOf< double > &targetUnsafe, const yarp::os::Bottle &options=yarp::os::Bottle())
Drop the object on a given target.
bool waving(const bool sw)
Enable/disable arms waving.