Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposing memory publishers and adding update memory topic #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cdondrup
Copy link

As discussed in #78 this PR adds the following:

  • Via the config file share/mem_config.json arbitrary memory keys can be specified that are published with the given frequency on the desired topic. An example of such an entry to get some battery information could be:
{
   "memKeys": [
       "Device/SubDeviceList/Battery/Charge/Sensor/Value",
       "Device/SubDeviceList/Battery/Charge/Sensor/TotalVoltage",
       "Device/SubDeviceList/Platform/ILS/Sensor/Value",
       "Device/SubDeviceList/Battery/Charge/Sensor/Charging"
   ],
   "topic": "battery",
   "frequency": 10
}

which publishes the desired information on /naoqi_driver_node/battery with a frequency of 10Hz:

header: 
 seq: 7
 stamp: 
   secs: 1481880866
   nsecs: 386633421
 frame_id: ''
strings: []
ints: 
 - 
   memoryKey: Device/SubDeviceList/Battery/Charge/Sensor/Charging
   data: 4
floats: 
 - 
   memoryKey: Device/SubDeviceList/Battery/Charge/Sensor/Value
   data: 1.0
 - 
   memoryKey: Device/SubDeviceList/Battery/Charge/Sensor/TotalVoltage
   data: 28.7770004272
 - 
   memoryKey: Device/SubDeviceList/Platform/ILS/Sensor/Value
   data: 0.0
---

This functionality was already available but has now been exposed via the mentioned config file.

  • A rudamentary memory update topic has been added which receives messages of type naoqi_bridge_msgs/MemoryList on /update_memory and adds the given information under the specified key:
$ rostopic pub /update_memory naoqi_bridge_msgs/MemoryList "header:
 seq: 0
 stamp:
   secs: 0
   nsecs: 0
 frame_id: ''
strings:
- memoryKey: 'foobar'
 data: 'test'
ints:
- memoryKey: 'spam'
 data: 2
floats:
- memoryKey: 'eggs'
 data: 5.0" 

Tested on pepper with naoqi 2.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant