public void RegPublisher <DataType, BridgeType>(IBridgePlugin plugin, Func <DataType, BridgeType> converter)
 {
     plugin.AddType <DataType>(Ros2Utils.GetMessageType <BridgeType>());
     plugin.AddPublisherCreator(
         (instance, topic) =>
     {
         var ros2Instance = instance as Ros2BridgeInstance;
         ros2Instance.AddPublisher <BridgeType>(topic);
         var writer = new Ros2Writer <BridgeType>(ros2Instance, topic);
         return(new Publisher <DataType>((data, completed) => writer.Write(converter(data), completed)));
     }
         );
 }
Exemple #2
0
 public Ros2PointCloudWriter(Ros2BridgeInstance instance, string topic)
 {
     Writer = new Ros2Writer <Ros.PointCloud2>(instance, topic);
 }