static calculateMsgId(date) {
        const now = date.getTime();

        if (now > FEB_1970_UNIXTIME_MS) { // If we're not in january 1970, assume that time is synced
            /*
                When time is synced, we shift our msgIds by one whole day in seconds so that even if our counter
                wraps, there won't be any collisions caused by the time sync.

                This assumes that the robot will sync its time in less than a day.
                If it takes longer, there will be a chance of msgId collisions.
                This however is unlikely as all known robots today (2022-02-26) reboot daily

                This also won't be an issue if the time is never synced at all.
                In that state, the amount of messages exchanged with the robot on the local interface will be limited to 1 per second,
                but apart from that, everything should just work up until MAX_INT32 seconds have passed since boot

                During normal operation, all messages should be sent via the cloud interface anyway, meaning that
                this limit should not have any effect at all
             */
            const id = Math.round(now / 10); //With a synced time, we'll have 100 unique MsgIds per second
            const offset = 24 * 60 * 60; // 1 day in seconds

            return offset + (id % (MAX_INT32 - offset)); // wrap if id + offset is larger than MAX_INT32
        } else {
            /*
                We're somewhere in january 1970 meaning that there's no synced time (yet)

                Therefore, we limit the amount of usable msgIds to one every second
                so that there are more IDs available for the 100-per-second synced time state
                without any risk of collisions right after the time sync
             */

            return Math.round(now / 1000);
        }
    }
@private
@param {Date} date
@return {number} must be less than MAX_INT32