UDP

This component establishes a two way communication between a device with UDP interface and the DDS bus. This means relaying UDP signals to DDS and vice versa. Currently, this component only relays UDP signals to DDS.

The component is configured by an input file with the following structure:

  • Options:
    • PeriodMs: 1000
  • UdpReadPackages: A yaml list of UDP packages to be read and transmitted to the DDS bus. Each element should have the following structure:
    • Name: Name of the signal package.
    • LocalPort: The port on the local host which the remote device sends udp packages to.
    • SenderAddress: The remote address to receive UDP packages from. To allow UDP packages from any host, use the value any.
    • BufferMargin: Adds a safety margin to the allocated buffer for incoming packages, in bytes. Necessary if only parts of the package is parsed.
    • Signals: A yaml list of the DDS signals to parse the UDP package into. Each signal has the structure:
      • UdpType: The type to read from the package. This can be one of
        • float (Reads 4 bytes and parsesd as float)
        • bool (Reads 1 byte and parses as bool)
        • double (Reads 8 bytes and parses as double)
        • int (Reads 4 bytes and parses as integer)
        • unsigned int (reads 4 bytes and parses as unsigned integer)
        • bitgroup (Reads 1 byte and extracts the indivisual bnits as bool values)
      • DdsType: The DDS type to write.
      • Topic: This is the DDS topic name(s) to write to. If the UdpType is bitgroup, this should be a yaml array with 8 elements. Otherwise it should be a single topicname.
      • Partition: The DDS partition to publish to.

An example input file is shown below, as well as here.

Options:
PeriodMs: 1000
UdpReadPackages:
- Name: ACON_Signals1
LocalPort: 2001
SenderAddress: any
BufferMargin: 8
Signals:
- {UdpType: bitgroup, DdsType: BoolVal, Topic: [Test1], Partition: ACON}
- {UdpType: float, DdsType: DoubleVal, Topic: Speed_Log, Partition: ACON}
- {UdpType: float, DdsType: DoubleVal, Topic: Rudder_Angle, Partition: ACON}
- {UdpType: float, DdsType: DoubleVal, Topic: Draught_AP, Partition: ACON}
- {UdpType: float, DdsType: DoubleVal, Topic: Draught_FP, Partition: ACON}
- {UdpType: float, DdsType: DoubleVal, Topic: ME1_RPM, Partition: ACON}
- {UdpType: float, DdsType: DoubleVal, Topic: ME1_Consumption, Partition: ACON}
- {UdpType: float, DdsType: DoubleVal, Topic: ME1_Load, Partition: ACON}
- {UdpType: float, DdsType: DoubleVal, Topic: ME1_KW, Partition: ACON}
- Name: Winch_Signals7
LocalPort: 2107
SenderAddress: any
BufferMargin: 8
Signals:
- {UdpType: bitgroup, DdsType: BoolVal, Topic: [Mode_Manual, Mode_Shoot, Mode_Tow1, Mode_Hoist, Mode_Bottom_Trawl, Mode_Single_Trawl, Mode_Double_Trawl], Partition: Winch}
- {UdpType: float, DdsType: DoubleVal, Topic: Wire_Lenght_Out_SB, Partition: Winch}
- {UdpType: float, DdsType: DoubleVal, Topic: Wire_Lenght_Out_PS, Partition: Winch}
- {UdpType: float, DdsType: DoubleVal, Topic: Wire_Lenght_Out_Mid, Partition: Winch}
- Name: Winch_Signals15
LocalPort: 2115
SenderAddress: any
BufferMargin: 8
Signals:
- UdpType: bitgroup
DdsType: BoolVal
Topic:
- Trawl_Winch_SB_Running
- Trawl_Winch_PS_Running
- Sweepline_SB_Outer_Running
- Sweepline_SB_Center_Running
- Sweepline_SB_Inner_Running
- Out_Haul_Running
- Gilson_Winch_SB_Running
- Gilson_Winch_PS_Running
- Net_Sounder_Running
- Trawl_Winch_Mid_Running
- Sweepline_PS_Inner_Running
- Sweepline_PS_Center_Running
- Sweepline_PS_Outer_Running
- Cod_End_SB_Running
- In_Haul_SB_Running
Partition: Winch