Esempio n. 1
0
void RemoteKinematics::LookAtMethod::execute(xmlrpc_c::paramList const& paramList, xmlrpc_c::value* const resultP) {
    paramList.verifyEnd(4);
    double x = paramList.getDouble(0);
    double y = paramList.getDouble(1);
    double z = paramList.getDouble(2);
    bool top_camera = paramList.getBoolean(3);
    this->m_kinematics->lookAt(x, y, z, top_camera);
    *resultP = value_nil();
}
	virtual void get_rate_limit(xmlrpc_c::paramList const& paramList, xmlrpc_c::value* retvalP) {
		ACE_TRACE("modEmulateRate_Interface::get_rate");
		int rate = 0;

		if (paramList.size() > 2 ) {
			rate = find_handler(paramList)->getRateLimitAtTime(paramList.getDouble(2));
		}
		else {
			rate = find_handler(paramList)->getRateLimit();
		}

		*retvalP = xmlrpc_c::value_double(rate);
	}
Esempio n. 3
0
void RemoteKinematics::JointsLookAtMethodLookAtMethod::execute(xmlrpc_c::paramList const& paramList,
                                                               xmlrpc_c::value* const resultP) {
    paramList.verifyEnd(4);
    double x = paramList.getDouble(0);
    double y = paramList.getDouble(1);
    double z = paramList.getDouble(2);
    bool top_camera = paramList.getBoolean(3);
    ValuesVectorPtr data = this->m_kinematics->jointsLookAt(x, y, z, top_camera);

    xmlrpc_env env;
    xmlrpc_env_init(&env);
    xmlrpc_value* elem;
    xmlrpc_value* values;
    values = xmlrpc_array_new(&env);
    for (int i = 0; i < data->size(); ++i) {
        elem = xmlrpc_double_new(&env, data->at(i));
        xmlrpc_array_append_item(&env, values, elem);
        xmlrpc_DECREF(elem);
    }
    resultP->instantiate(values);
    // Clean this shit!
    xmlrpc_DECREF(values);
    xmlrpc_env_clean(&env);
}