30 catch (
const std::exception& e)
32 ROS_ERROR(
"Memory: Failed to connect to Memory Proxy!\n\tTrace: %s", e.what());
43 std::vector <std::string> keys;
44 for(std::vector<std::string>::const_iterator it=joints.begin(); it!=joints.end(); ++it)
46 keys.push_back(
"Device/SubDeviceList/" + *it +
"/Position/Sensor/Value");
62 keys_qi =
memory_proxy_.call<qi::AnyValue>(
"getListData", keys);
64 catch(
const std::exception& e)
66 ROS_ERROR(
"Memory: Could not read joints data from Memory Proxy \n\tTrace: %s", e.what());
70 return joint_positions;
80 catch (
const std::exception& e)
82 ROS_WARN(
"Memory: Failed to get the robot's name \n\tTrace: %s", e.what());
88 const std::string &callback_module,
89 const std::string &callback_method,
90 const std::string &callback_message)
94 memory_proxy_.call<
int>(
"subscribeToMicroEvent", name, callback_module, callback_message, callback_method);
96 catch(
const std::exception& e)
98 ROS_WARN(
"Memory: Failed to subscribe to micro-event '%s'.\n\tTrace: %s", name.c_str(), e.what());
103 const std::string &callback_module)
107 memory_proxy_.call<
void>(
"unsubscribeToMicroEvent", name, callback_module);
109 catch(
const std::exception& e)
111 ROS_WARN(
"Memory: Failed to unsubscribe from micro-event '%s'.\n\tTrace: %s", name.c_str(), e.what());
qi::AnyObject memory_proxy_
void unsubscribeFromMicroEvent(const std::string &name, const std::string &callback_module)
unsubscribe from a micro-event
std::vector< float > getListData()
Get values of keys.
std::string getData(const std::string &str)
get a key-value pair stored in memory
void subscribeToMicroEvent(const std::string &name, const std::string &callback_module, const std::string &callback_method, const std::string &callback_message)
subscribe to a micro-event
std::vector< std::string > initMemoryKeys(const std::vector< std::string > &joints)
initialize memory keys to read
void init(const std::vector< std::string > &joints_names)
initialize with joints names to control
std::vector< std::string > keys_positions_
Memory(const qi::SessionPtr &session)