splintered-reality/py_trees_ros

Subscribers.ToBlackboard initialised with rosmsg()?

naveedhd opened this issue · 2 comments

Is there a way to feed the initialise_variables with the rosmsg instance?

for example:


pose_to_blackboard = ToBlackboard(topic_name="pose",
                                                 topic_type=geometry_msgs.msg.Pose,
                                                 blackboard_variables = {'pose': None},
                                                 initialise_variables=geometry_msgs.msg.Pose()
                                                 )

As I understand, we can supply a python dict which means initializing with dummy data would require rosmsg -> python dict conversion.

I think what you're trying to do is:

pose_to_blackboard = ToBlackboard(topic_name="pose",
    topic_type=geometry_msgs.msg.Pose,
    blackboard_variables = {'pose': None},
    initialise_variables={'pose': geometry_msgs.msg.Pose()}
)

exactly!