Vectors being initialized with `json:[]` string
Opened this issue · 1 comments
edu-rossrobotics commented
Describe the bug
In the recent versions of the library, I've seen an issue with vectors on custom nodes, where they get initialized to have the following string: json:[]
How to Reproduce*
I have a node that has an input port like this:
BT::InputPort<std::vector<std::string>>("string_vector", {}, "A string vector"),
And I don't declare any input on the XML file so I expect the vector to be empty. I print then the contents on the node and I get this
json:[]edu-rossrobotics commented
Apparently I was using a wrong way to initialize the empty vector, the correct way to do it (in case someone has the same doubt) is:
BT::InputPort<std::vector<std::string>>("string_vector", "", "A string vector"),But, as a matter of curiosity, when has this change? Because I have an old installation of the library (v4.6) where my code above works perfectly fine. I've checked the last changes but I can not see anything related.