How to generate Ports and add them to std::vector<tOutput<...>> out_... ?
Current behavior
During compilation I don't know how many ports I need. During runtime a configuration file is read. Depending on the configuration either 0, 1 or multiple distance data ports are required in the ib2c group. How do I properly generate them such that I can connect them in finstruct? Below I described how I did it. But of course finstruct is not sure to which of the ports in std::vector<tOutputrrlib::distance_data::tDistanceData> it should connect.
It shows Interface selection ambiguous...
Expected behavior
It should connect.
Steps to reproduce
On the one side there is this port:
class gbbMapFusion : public ib2c::tLayer<ib2c::tGroup>
{
public:
tCertaintyInputInterface<rrlib::distance_data::tDistanceData, std::vector<ib2c::tVectorSigma<3>>>* in_combined_point_cloud;
On the other side there is this port:
class gSpawnConvertersFromConfig : public structure::tGroup
{
public:
std::vector<tOutput<rrlib::distance_data::tDistanceData>> out_3d_laser;
...
Ports are added as follows during construction:
auto lidar_converter = new finroc::unreal::converters::lidar::mRayTracingLiDAR(this, sensor.name + " Converter");
lidar_converter->in_location_buffer.ConnectTo("tcp:/Unreal/Output/" + sensor.name + " Data");
lidar_converter->in_number_of_datapoints.ConnectTo("tcp:/Unreal/Output/" + sensor.name + " BufferSize");
auto lidar_output = new tOutput<rrlib::distance_data::tDistanceData>(sensor.name + " pointcloud", this, tFlag::SHARED);
out_3d_laser.emplace_back(*lidar_output);
lidar_converter->out_point_cloud.ConnectTo(*lidar_output);
Other information
I can not connect to the std::vector but to lidar_converter->out_point_cloud
Java finstruct Stacktrace
java.lang.Exception: Interface selection ambiguous for component Interfaces/TCP/finroc_libraries_reaction_examples_basic_vehicle (sinope:4445)/Main Thread/Test Vehicle/Hardware Interface
at org.finroc.tools.finstruct.SmartConnecting.getConnectActionImplementation(SmartConnecting.java:642)
at org.finroc.tools.finstruct.SmartConnecting.getConnectAction(SmartConnecting.java:453)
at org.finroc.tools.finstruct.FinstructConnectionPanel.connect(FinstructConnectionPanel.java:358)
at org.finroc.tools.gui.ConnectionPanel.mouseReleased(ConnectionPanel.java:626)
at org.finroc.tools.finstruct.FinstructConnectionPanel.mouseReleased(FinstructConnectionPanel.java:574)
at org.finroc.tools.gui.commons.EventRouter.fireMouseReleasedEvent(EventRouter.java:274)
at org.finroc.tools.gui.util.gui.MJTree.mouseReleased(MJTree.java:283)
at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
at java.desktop/java.awt.Component.processEvent(Component.java:6391)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:747)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Finstruct::showErrorMessage() (Finstruct.java:518) >> Interface selection ambiguous for component Interfaces/TCP/finroc_libraries_reaction_examples_basic_vehicle (sinope:4445)/Main Thread/Test Vehicle/Hardware Interface