Skip to content

Commit

Permalink
Add handling for the simulation of time progression in raw packets
Browse files Browse the repository at this point in the history
  • Loading branch information
msz-rai committed Dec 18, 2024
1 parent 30677bc commit f93212f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Assets/RGLUnityPlugin/Scripts/LidarUdpPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public class LidarUdpPublisher : MonoBehaviour

public bool emitRawPackets = true;

[Header("General UDP Flags")]

[Tooltip("If enabled the timestamp for all packets will be the same (current scene time).\n" +
"If disabled the time progression (based on LiDAR manuals) will be simulated and different timestamps for each packet will be assigned.")]
public bool useTheSameTimestampForAllPackets = true;

[Header("Hesai LiDARs Flags")]

[Tooltip("Enable labeling the sequence number of Point Cloud UDP packets. It increases the packet size by an additional field.")]
Expand Down Expand Up @@ -304,6 +310,7 @@ private RGLUdpOptions GetUdpOptions(LidarModel currentLidarModel)
udpOptions += enableHesaiUdpSequence ? (UInt32)RGLUdpOptions.RGL_UDP_ENABLE_HESAI_UDP_SEQUENCE : 0;
udpOptions += enableHesaiUpCloseBlockageDetection ? (UInt32)RGLUdpOptions.RGL_UDP_UP_CLOSE_BLOCKAGE_DETECTION : 0;
udpOptions += enableHesaiPandarDriverCompatibilityForQt ? (UInt32)RGLUdpOptions.RGL_UDP_FIT_QT64_TO_HESAI_PANDAR_DRIVER : 0;
udpOptions += useTheSameTimestampForAllPackets ? (UInt32)RGLUdpOptions.RGL_UDP_SAME_TIMESTAMP_FOR_PACKETS : 0;

// Check if high resolution mode is enabled (available only on Hesai Pandar128E4X)
if (currentLidarModel == LidarModel.HesaiPandar128E4X)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ public enum RGLUdpOptions : UInt32
RGL_UDP_HIGH_RESOLUTION_MODE = 1 << 1,
RGL_UDP_UP_CLOSE_BLOCKAGE_DETECTION = 1 << 2,
RGL_UDP_FIT_QT64_TO_HESAI_PANDAR_DRIVER = 1 << 3,
RGL_UDP_SAME_TIMESTAMP_FOR_PACKETS = 1 << 4
};

public enum RGLQosPolicyReliability
Expand Down

0 comments on commit f93212f

Please sign in to comment.