You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: WSMPTraffic.m
    path of file: ./repos/MATLAB-NS3/scenarios/manhattanHazardWarning
    
    the code of the file until where you have to start completion: classdef WSMPTraffic
    % WSMP TRAFFIC construction and sending and reception
    
    %
    % Copyright (
    
function [payloadBuf, payloadSize] = constructHazardWarning(nodeId, routeInfo, mobilityModel)
            
            node = NodeList.GetNode(nodeId);
            mmObj = node.GetObject(mobilityModel);
            
            currentPosition = mmObj.GetPosition ();
            currentPosition(1) = ceil(currentPosition(1));
            currentPosition(2) = ceil(currentPosition(2));
            currentPosition(3) = ceil(currentPosition(3));
            
            currentStreetId = routeInfo.getStreetIdByIndex();
            
            
            % ***********  Position beacon payload format ****************
            %      pktType(1 byte), time-to-live(1 byte), nodeId(2 bytes)
            %      streetId(2 bytes), xPos(2 bytes), yPos (2 bytes), zPos(2
            %      bytes)
            
            % Packet filling: Filling of packet fields must be in the same
            % order as desired in the packet.
            
            payload.pktType = uint8(WSMPTraffic.hazardWarning); % filling packet type
            payload.ttl = uint8(2); % filling TTL */
            payload.nodeId = uint16(nodeId); % Filling Send