当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript TypedMessage.deserializeBinary方法代码示例

本文整理汇总了TypeScript中@lakemaps/schemas.TypedMessage.deserializeBinary方法的典型用法代码示例。如果您正苦于以下问题:TypeScript TypedMessage.deserializeBinary方法的具体用法?TypeScript TypedMessage.deserializeBinary怎么用?TypeScript TypedMessage.deserializeBinary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@lakemaps/schemas.TypedMessage的用法示例。


在下文中一共展示了TypedMessage.deserializeBinary方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: decode

    static decode(buf: Buffer): BoatConfig {
        const bytes = new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
        const obj = TypedMessage.deserializeBinary(bytes).getBoatConfig();
        if (obj === null) {
            throw new Error(`Missing BoatConfig field`);
        }

        const surgeControllerGains = obj.getSurgeControllerGains();
        const surgeTimeStep = obj.getSurgeControllerDt();
        const yawControllerGains = obj.getYawControllerGains();
        const yawTimeStep = obj.getYawControllerDt();
        return new BoatConfig(
            new PidControllerGains(
                surgeControllerGains.getKp(),
                surgeControllerGains.getKi(),
                surgeControllerGains.getKd(),
            ),
            surgeTimeStep,
            new PidControllerGains(
                yawControllerGains.getKp(),
                yawControllerGains.getKi(),
                yawControllerGains.getKd(),
            ),
            yawTimeStep,
        );
    }
开发者ID:LakeMaps,项目名称:hangashore,代码行数:26,代码来源:BoatConfig.ts

示例2: decode

    static decode(buf: Buffer): MissionInformation {
        const bytes = new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
        const obj = TypedMessage.deserializeBinary(bytes).getMissionInformation();
        if (obj === null) {
            throw new Error(`Missing MissionInformation field`);
        }

        return new MissionInformation(obj.getDistanceToWaypoint());
    }
开发者ID:LakeMaps,项目名称:hangashore,代码行数:9,代码来源:MissionInformation.ts

示例3: decode

 static decode(buf: Buffer): Motion {
     const bytes = new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
     const obj = TypedMessage.deserializeBinary(bytes).getMotion();
     return Motion.fromMessage(obj);
 }
开发者ID:LakeMaps,项目名称:hangashore,代码行数:5,代码来源:Motion.ts

示例4: decode

 static decode(buf: Buffer): TypedMessage {
     const bytes = new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
     const obj = TypedMessageProtobuf.deserializeBinary(bytes);
     return new TypedMessage(obj.getType());
 }
开发者ID:LakeMaps,项目名称:hangashore,代码行数:5,代码来源:TypedMessage.ts

示例5: decode

 static decode(buf: Buffer): Waypoint {
     const bytes = new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
     return Waypoint.fromMessage(TypedMessage.deserializeBinary(bytes).getWaypoint());
 }
开发者ID:LakeMaps,项目名称:hangashore,代码行数:4,代码来源:Waypoint.ts


注:本文中的@lakemaps/schemas.TypedMessage.deserializeBinary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。