You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the method getLockedPortContent with a node that declares the port with a default blackboard entry does not actually add an initial value to the blackboard.
How to Reproduce
The first time that getLockedPortContent is called for a key that is not added to the blackboard already, the call does not create any blackboard entry. It returns a default AnyPtrLocked which is not placed into the blackboard storage.
For example, an action can declare a port with default blackboard entry name like InputPort<Pointcloud>("cloud", "{=)", "Point cloud"). Then in the action it can access the locked content and assign it.
if(auto any_locked = getLockedPortContent("cloud"))
{
if(any_locked->empty())
{
// the entry in the blackboard hasn't been initialized yet.// You can initialize it doing:
any_locked.assign(my_initial_pointcloud);
}
But unless the XML declares the port explicitly, the value returned from getLockedPortContent will not actually be a value from blackboard storage and so the call to any_locked.assign does not persist the assignment after any_locked goes out of scope.
I think that one resolution is to create the blackboard entry in the call to getLockedPortContent if there is a mapped key.
Describe the bug
Using the method
getLockedPortContent
with a node that declares the port with a default blackboard entry does not actually add an initial value to the blackboard.How to Reproduce
The first time that
getLockedPortContent
is called for a key that is not added to the blackboard already, the call does not create any blackboard entry. It returns a defaultAnyPtrLocked
which is not placed into the blackboard storage.For example, an action can declare a port with default blackboard entry name like
InputPort<Pointcloud>("cloud", "{=)", "Point cloud")
. Then in the action it can access the locked content and assign it.But unless the XML declares the port explicitly, the value returned from
getLockedPortContent
will not actually be a value from blackboard storage and so the call toany_locked.assign
does not persist the assignment afterany_locked
goes out of scope.I think that one resolution is to create the blackboard entry in the call to
getLockedPortContent
if there is a mapped key.Workaround
Without fixing the issue, the port must be declared in the XML
The text was updated successfully, but these errors were encountered: