Skip to content
mika edited this page Mar 31, 2022 · 5 revisions

There's only few public methods in the Velodyne.VelodyneViewer currently (see "PUBLIC METHODS" area at the bottom of viewer script), see also FeedCustomData.cs for example on how to draw your own point data using Viewer.

public void CallThreadedPCAPReader()

  • Starts loading/streaming from file (normally its called automatically in the viewer is public bool loadAtStart = true)

public void InitBuffersForStreaming()

  • Initializes compute buffers for streamed data (this gets called from InitPCAPBuffers() already, so not needed normally)

public void InitPCAPBuffers()

  • Initializes buffers for point and color data

public void InitializeUDPListener()

  • Opens UDP listener and ports

public void UpdateAnimationBuffers()

  • Same as UpdatePointDataFromStream() but for displaying loaded data (one frame of it)

public void UpdatePointDataFromStream()

  • Actually draws single frame points (for mesh it sets vertices, or for DX11 buffer it sets buffer data)

public bool TogglePCAPRecorder()

  • Toggles live recording on/off (isRecording bool is flipped on each call), only for live device recording

public string GetLastRecordedFilePath()

  • returns "recordfile" string, its time stamped filename, ("yyyy-MM-dd_HH-mm-ss_" + detectedModelID + ".pcap"), inside streaming assets

public bool VeloToggleLaser(int index)

  • Hides single laser output (by offsetting it out from screen), calling this again removes offset for that index

public bool VeloLaserOffset(int index, Vector3 offset)

  • Manually set offset for single laser output (for example could move it 10 meters higher), if you call this again, it overwrites existing offset (so setting it 0 resets it)

public void PauseToggle()

  • Toggles playback pause on/off

public void PrevFrame()

  • Go to previous frame (if rewind is supported/enabled)

public void NextFrame()

  • Go to next frame (if rewind is supported/enabled)

public void GotoFrame(int frame)

  • Jump to frame N (if rewind is supported/enabled)

public int GetCurrentFrame()

  • Returns current frame index (for pcap data)

public int GetTotalFrames()

  • Returns total frames count (for pcap data)

public bool IsLoading()

  • If still loading pcap data

EVENTS

public event OnLoadComplete OnLoadingComplete

  • Invokes when loading (of pcap file is completed, not for streaming data), returns filename
Clone this wiki locally