-
Notifications
You must be signed in to change notification settings - Fork 40
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
What is the easiest way to get blackboard variable from rclpy node? #171
Comments
Perhaps you haven't written anything to the blackboard yet? Registering a key just informs the blackboard what access the client has to the specified variable. It doesn't actually populate the variable, you'll have to write to the blackboard first. Example program:
With output:
The '-' indicates that it's a registered variable, but hasn't been populated yet. |
No, it was definitely written to. I am not able to come up right now with MWE, but I had set-up like this:
|
You're trying to access the blackboard from a process in the 1st terminal from a separate process in the 3rd terminal? The blackboard is in-memory (RAM) storage accessible only if you're in the same process. If you are in a different process, you absolutely need some kind of middleware (pubs and subs) to ferry the data.
Admittedly, I hadn't expected anyone to want to use something like What you might be wanting is something convenient that (partially) mirrors the blackboard in that other process so, for example, you can make use of the |
Okay, I see. I thought that key-value storage for blackboard is accessible for all of the system(like a small DB). Just out of the curiosity, why you have chosen to do blackboard only accessible within the process? Because, I was looking for kind of 'ros parameter server' blackboard. I just want to separate parameters and values that are indented to change the behavior of the agent(these goes to blackboard) and pure configurational stuff, like baudrate, map size etc..(these goes to parameter server). For me particular use case was like this: Your last proposal is about mirroring the blackboard could be the solution, but I for me it is a little bit clunky, with adding all the middleware things like creating topic for value retrieval. If there would be a way to get the blackboard variable from different process with ros2 service call for example, it would be much more convenient, I think. Unless, off course, there are some underlying reasons of not doing so. Just FYI I really liked py-trees in terms of things it can do with behavior trees and after all I think it's like one and only ros-compatible python-solution out there. I have encountered paper about behaviour trees frameworks review and your project was I think literally the only one which is written in python and compatible with ros and still maintained. |
Late reply, but for completeness...
There are many non-ros applications of blackboards and they all need blackboards, so the initial design had to work for a core library that does not have ROS (or some other higher level framework).
|
Hi there!
I am struggling to get blackboard variable from one of my nodes, approaches I've tried:
And then getting variable like this
But it tells me that ther is no such variable, though I can get it from running
py-trees-blackboard-watcher
But this way it creates new topic and the way for me to get blackboard variable is to subscribe to this topic.
Can you please tell me, what way will be the best to get the data inside blackboard variable?
The text was updated successfully, but these errors were encountered: