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
Tree Execution Error When Setting InputPort Value to Empty String with std::optional<T> Default Value as std::nullopt After Commit 789ce6ea0ad3627923bd2389b8fb9199ffab6d84
#768
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
Following the changes made in commit 789ce6e, an error occurs during tree execution when std::nullopt is set as the default value for an InputPort of type std::optional<T>, and the InputPort's value is subsequently set to an empty string ("").
This issue is exemplified when T is set to std::optional<geometry_msgs::Pose>, resulting in the following error message:
You (maybe indirectly) called BT::convertFromString() for type [std::optional<geometry_msgs::Pose_<std::allocator<void> > >], but I can't find the template specialization.
[ERROR] [1707813348.400082594]: [port_utils::getInput] Failed to get input 'poses': You didn't implement the template specialization of convertFromString for this type: std::optional<geometry_msgs::Pose_<std::allocator<void> > >
[ERROR] [1707813348.400098635]: [BT][InputTest][InputTest](UID 1): failed to get inputs
In Groot2, when an InputPort doesn't explicitly have a value assigned by the user, the system automatically assigns an empty string (""). However, this automatic assignment leads to runtime errors when the InputPort is of type std::optional with std::nullopt set as its default value. Ideally, the system should detect when an empty string is auto-assigned to such InputPorts and instead utilize the user-defined std::nullopt default value to prevent these runtime errors.
The text was updated successfully, but these errors were encountered:
@facontidavide
Thank you for your prompt response. However, the issue still persists. I have implemented a unit test to reproduce it and submitted a pull request #773.
Following the changes made in commit 789ce6e, an error occurs during tree execution when
std::nullopt
is set as the default value for anInputPort
of typestd::optional<T>
, and theInputPort
's value is subsequently set to an empty string ("").This issue is exemplified when
T
is set tostd::optional<geometry_msgs::Pose>
, resulting in the following error message:In Groot2, when an InputPort doesn't explicitly have a value assigned by the user, the system automatically assigns an empty string (""). However, this automatic assignment leads to runtime errors when the InputPort is of type std::optional with std::nullopt set as its default value. Ideally, the system should detect when an empty string is auto-assigned to such InputPorts and instead utilize the user-defined std::nullopt default value to prevent these runtime errors.
The text was updated successfully, but these errors were encountered: