pcdLib Reference
Module defined in `lua/common/tech/pcdLib.lua`. Creates PCD (Point Cloud Data) files - the standard format for lidar, radar, and other point cloud sensor data.
Module defined in lua/common/tech/pcdLib.lua. Creates PCD (Point Cloud Data) files - the standard format for lidar, radar, and other point cloud sensor data.
Exports
Functions
M.newPcd()
Create a new PCD file writer instance.
- Returns: Pcd - A new point cloud data object
Pcd Object Methods
pcd:addField(name, size, type)
Add a field definition to the point cloud schema.
- Parameters:
name- string - Field name (e.g., "x", "y", "z", "intensity")size- number - Byte size per element (1, 2, 4, 8)type- string - Data type: "F" (float), "U" (unsigned), "I" (signed)
pcd:setViewpoint(pos, rotQuat)
Set the sensor viewpoint for this cloud.
- Parameters:
pos- vec3 - Sensor positionrotQuat- quat - Sensor rotation quaternion
pcd:setData(data, bytes)
Set the raw binary payload data.
- Parameters:
data- cdata/string - Raw point databytes- number - Byte length
pcd:save(filename)
Write the PCD file to disk (header + binary payload).
- Parameters:
filename- string - Output file path
- Returns: boolean|nil - false on error
pcd:writeHeader(file)
Write only the PCD header to an open file handle.
- Parameters:
file- file - Open file handle
Internal Notes
- PCD version 0.7 format
- Binary data mode (not ASCII)
- Point count auto-calculated from payload size / point size
- Height always 1 (unorganized dataset)
- Uses
string.bufferfor efficient binary payload accumulation
tech/ - Co-simulation & Technical Interface Modules
Core modules for BeamNG's tech layer - external tool integration, sensor data, and co-simulation communication.
techCommunication Reference
Module defined in `lua/common/tech/techCommunication.lua`. TCP socket communication layer for BeamNG's tech/co-simulation interface. Handles client connections, MessagePack-encoded message exchange, a