Documentation ¶
Overview ¶
Package vlp16 provides primitives for reading and parsing data from Velodyne VLP-16 LiDAR sensors.
Index ¶
Constants ¶
const ( // BlocksPerPacket is the number of blocks in a packet. BlocksPerPacket = 12 // ChannelsPerBlock is the number of channels in a block. ChannelsPerBlock = 32 )
const ( // ColumnsPerPacket is the number of columns in point cloud matrix. ColumnsPerPacket = BlocksPerPacket * 2 // RowsPerColumnSingleReturn is the number of rows in point cloud in single return mode. RowsPerColumnSingleReturn = 16 // FullFiringTime is the total time for laser firings plus recharge (55.296 µs). FullFiringTime = 55296 * time.Nanosecond // SingleFiringTime is the time for one laser firing (2.304 µs). SingleFiringTime = 2304 * time.Nanosecond // RechargeTime is the recharge time between laser firings (18.432 µs). RechargeTime = 18432 * time.Nanosecond // LowestElevation is the elevation angle of first row of measurements. LowestElevationDegrees = -15 // DeltaElevation is the angle difference between two rows. DeltaElevationDegrees = 2 )
const SizeOfPacket = 1206
SizeOfPacket is the size of a single VLP-16 packet in bytes.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct { Flag uint16 Azimuth uint16 Channels [ChannelsPerBlock]Channel }
Block is a VLP-16 block.
type ListenOption ¶
type ListenOption func(*listenOptions)
ListenOption configures a VLP-16 listener.
func WithReadBatchSize ¶
func WithReadBatchSize(n int) ListenOption
WithReadBatchSize configures the max number of messages to read from the kernel in a single batch.
func WithReadBufferSize ¶
func WithReadBufferSize(n int) ListenOption
WithReadBufferSize configures the kernel read buffer size (in bytes).
type Packet ¶
type Packet struct { Blocks [BlocksPerPacket]Block Timestamp uint32 ReturnMode ReturnMode ProductID ProductID }
Packet is a VLP-16 packet.
func (*Packet) UnmarshalRawPacket ¶
type PacketListener ¶
type PacketListener struct {
// contains filtered or unexported fields
}
PacketListener listens for VLP-16 packets.
func ListenUDP ¶
func ListenUDP(ctx context.Context, addr string, listenOpts ...ListenOption) (_ *PacketListener, err error)
ListenUDP listens for VLP-16 UDP packets on the specified address.
func (*PacketListener) Close ¶
func (c *PacketListener) Close() error
Close the client's underlying UDP connection.
func (*PacketListener) Packet ¶
func (c *PacketListener) Packet() *Packet
Packet returns the last received VLP-16 packet.
func (*PacketListener) RawPacket ¶
func (c *PacketListener) RawPacket() *RawPacket
RawPacket returns the raw, unprocessed last received VLP-16 packet.
func (*PacketListener) ReadPacket ¶
func (c *PacketListener) ReadPacket() error
ReadPacket reads a VLP-16 packet.
func (*PacketListener) SetReadDeadline ¶
func (c *PacketListener) SetReadDeadline(deadline time.Time) error
SetReadDeadline sets the read deadline associated with the listener's underlying UDP connection.
func (*PacketListener) SourceIP ¶
func (c *PacketListener) SourceIP() net.IP
SourceIP returns the source IP of the last received VLP-16 packet.
type ReturnMode ¶
type ReturnMode uint8
ReturnMode represents a VLP-16 return mode.
const ( ReturnModeStrongest ReturnMode = 0x37 ReturnModeLastReturn ReturnMode = 0x38 ReturnModeDualReturn ReturnMode = 0x39 )
func (ReturnMode) String ¶
func (i ReturnMode) String() string