-
Notifications
You must be signed in to change notification settings - Fork 93
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
Using memory converters #78
Comments
Hi, First of all, I am glad you found that functionality. It was meant to avoid us the bothersome to add a piece of code for each possible memory key (there are so many..). If it is not used, it is mainly because the most used memory keys have their own converters / publishers. I am guessing this is the main reason. But maybe the documentation is also not good enough about this function ? I am however surprised that this function was not working, which functionalities did you need to add ? About your bool becoming a float, I don't exactly remember the reason for this, but it might be a limitation of ALMemory or libqi. You can see here that the type of the data is checked, but bool is not there. However, your data is properly sent. Which could mean that the bool value is incorrectly returned to us as a float. Finally, there is no secret function for inserting data. This bridge's main purpose was to perform read-only operations. Besides, inserting data in ALMemory can be a bit more complicated than simply calling insertData when it is related to sensors (because sensors will keep inserting their own real data, which might cause weird behavior, so sensors must be turned off, and it's a bit more invasive). |
Hi, Thanks for the quick reply! The changes I made are quite minor and can be found here: cdondrup@e332fbc Mainly, I have to find the config file, call the function, and removed the check if the nodehandle is I can, of course, live with the bool being a float but it is a bit unexpected. After seeing that there is no field I understand that inserting data is a bit more complicated that's why I hoped someone else might have done that already. |
The truth is we already did it from time to time (inserting data) but the hack we needed to do to make it work smoothly are so dependent on the key we want to modify that it never made it out to the open-source world :p About the function you were looking, it is basically the same you are using, but for only one key. Finally, I understand what you meant by "never used". It is indeed never used in the code. But actually, we use them. I have no idea what it would take to make this accessible to the catkin community though :( |
Ah, that explains a lot, thanks for the clarification :) I just implemented a subscriber that receives the same kind of message that is published by the memory_list converter and adds the values to the memory. Works for basic datatypes and should be fine for our purposes for now: cdondrup@48922f5 If you are interested in any of this (enabling the publisher via the config file and/or the subscriber), let me know and I will open a PR after I did some more testing. If not, feel free to close this issue. Thank you for your help! Especially the fact that everybody seems to have their own version of the driver makes me feel a bit more relaxed about our own version of the driver ;) |
Great ! Sure you can make a PR once you're done ! :) |
Hi,
I have a question regarding the memory converters. I found a nice function that currently doesn't appear to be used: https://github.com/ros-naoqi/naoqi_driver/blob/master/src/naoqi_driver.cpp#L1158-L1225 which allows to add arbitrary memory keys using a config file like this:
To automatically create a topic that publishes the values of these keys:
The only confusing thing being that the
bool
valueDevice/SubDeviceList/Platform/ILS/Sensor/Value
is published as afloat
.Since, it didn't work out of the box, wasn't called anywhere, and I had to add functionality to find the config file I created, I assume that this is not used (or ever has been?!). My question is, is there a reason for not using this?
I mean it obviously uses
ALMemory.getData
quite a few times which is bound to be slower than implementing a specialised converter that queries all your memory keys using only oneALMemory.getListData
call but apart from that I don't see a reason.Also, is there similar hidden functionality for inserting data into the memory? A quick grep for
insertData
seems to suggest there isn't.The text was updated successfully, but these errors were encountered: