3. API description
All the following calls must be performed from the robot.
Environment setup API
In order to get the module to connect to your roscore, you should send it your IP.
voidROS-Driver::setMasterURI (const std::string&uri )Set current master URI. The IP adress given is from defauth eth0 network interface.
param: uri - string in form of
http://<ip>:11311voidROS-Driver::setMasterURINet (const std::string&uri,const std::string&network_interface )Set current master URI using a given network interface.
param: uri - string in form of
http://<ip>:11311param: network_interface - string. For example
tether.const std::string&ROS-Driver::getMasterURI ()Get current master URI using a given network interface.
return: string in form of
http://<ip>:11311
Converters API
The converters are responsible for operating conversion between NAOqi messages and ROS messages, in accordance with given frequency.
const std::vector< std::string >&ROS-Driver::getAvailableConverters ()Get all registered converters in the module.
return: vector of string of all converter’s topic name
voidROS-Driver::registerMemoryConverter (const std::string&key,floatfrequency,inttype )Register a new converter for the memory key given.
param: key - naoqi memory key. For example
ALMemory/KeyAdded.param: frequency - frequency of the converter (in Hz)
param: type - type identifier of the given memory data.
Available types are: * 0 - None/Undefined * 1 - Int * 2 - Float * 3 - String * 4 - Bool
voidROS-Driver::addMemoryConverters (std::stringfilePath )Add some new converters for memory keys. This call requires as argument the path to a JSON file (stored on the robot) structured as the following one. memKeys and topic must be present and filled. Frequency is optional, and if not there, the default value is 10 Hz.
param: filePath - path of the JSON file
{ "memKeys": [ "KeyName1", "KeyName2" ], "topic": "topicName", "frequency": 10 }
Publishers API
voidROS-Driver::startPublishing ()Start/enable publishing all registered publisher
voidROS-Driver::stopPublishing ()Stop/disable publishing all registered publisher
const std::vector< std::string >&ROS-Driver::getSubscribedPublishers ()Get all subscribed publishers.
return: vector of string of publisher’s topic name
Recorders API
voidROS-Driver::startRecording ()Start/enable recording all registered recorder.
This will record all topics in one ROSbag, named after current date & time. The ROSbag is stored in the exact path where the ROS-Driver module is launched (meaning that it will be stored on the robot if it’s launched from here).
voidROS-Driver::stopRecording ()Stop/disable recording all registered recorder.
You can now have a look to the list of available topics, or you can go back to the index.
If you want to know more about the API, you can look at the doxygen documentation here