public void RegPublisher <DataType, BridgeType>(IBridgePlugin plugin, Func <DataType, BridgeType> converter) { plugin.AddType <DataType>(RosUtils.GetMessageType <BridgeType>()); plugin.AddPublisherCreator <DataType>( (instance, topic) => { var rosInstance = instance as RosBridgeInstance; rosInstance.AddPublisher <BridgeType>(topic); var writer = new RosWriter <BridgeType>(rosInstance, topic); return(new Publisher <DataType>((data, completed) => writer.Write(converter(data), completed))); } ); }
const double Height = 0; // sea level to WGS84 ellipsoid public RosNmeaWriter(RosBridgeInstance instance, string topic) { Writer = new RosWriter <Ros.Sentence>(instance, topic); }
public RosPointCloudWriter(RosBridgeInstance instance, string topic) { Writer = new RosWriter <Ros.PointCloud2>(instance, topic); }