turtlebot3_behavior_demos icon indicating copy to clipboard operation
turtlebot3_behavior_demos copied to clipboard

Blackboard, complex object instead of single values?

Open PaddyCube opened this issue 1 year ago • 1 comments

Let's say I want to implement a class representing a real robot. This class subscribes to sensor data, communicate with hardware and keeps sensor data, overall status current task and so on as attributes. It also provides methods to set actuators.

Is it possible to share this class across blackboard variable instead of pushing every Attribute as a single variable to blackboard?

Thanks for All your time explain robotic stuff to community. Me as a hobbyists robotics ebgineer, I learned so much about robots.

PaddyCube avatar Jan 28 '24 12:01 PaddyCube

You can use any arbitrary data type in your blackboard, but I wouldn't recommend doing something like a "drivers class" in there.

Instead, I would have that instantiated in your code and pass it in as a pointer/reference to any BT nodes that require your robot interface. Like so!

https://www.behaviortree.dev/docs/tutorial-basics/tutorial_08_additional_args

(If you're using Python, it's even easier because you can just add a public attribute to the node)

sea-bass avatar Jan 28 '24 13:01 sea-bass