0.2.0 • Published 4 months ago

@oarc/gpp-access v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Simple client library for the Open AR Cloud GeoPoseProtocol for visual positioning.

New with version 0.2.0:

  • BREAKING: upgrade to GeoPoseProtocol v2

New with version 0.1.0:

  • conversion from JavaScript to TypeScript

New with version 0.0.3:

  • update to new GeoPose format

Simple usage

    import { sendRequest, validateRequest, GeoPoseRequest, type GeoposeResponseType } from '@oarc/gpp-access';
    import { ImageOrientation, IMAGEFORMAT, CameraParam, CAMERAMODEL } from '@oarc/gpp-access';

    /*
    // Input
    image: string, // base64 encoded JPG image
    width: number,
    height: number,
    cameraIntrinsics: { fx: number; fy: number; cx: number; cy: number; }
    */

    let cameraParams = new CameraParam();
    cameraParams.model = CAMERAMODEL.PINHOLE;
    cameraParams.modelParams = [cameraIntrinsics.fx, cameraIntrinsics.fx, cameraIntrinsics.cx, cameraIntrinsics.cy];

    const geoPoseRequest = new GeoPoseRequest(uuidv4())
        .addCameraData(IMAGEFORMAT.JPG, [width, height], image.split(',')[1], 0, new ImageOrientation(false, 0), cameraParams)
        .addLocationData(latAngle, lonAngle, 0, 0, 0, 0, 0)

    sendRequest(`${serviceUrl}`, JSON.stringify(geoPoseRequest))
        .then(data => {
            // handle GeoPoseResponse
        })

More information about the GeoPoseProtocol can be found here:

https://github.com/OpenArCloud/oscp-geopose-protocol

0.2.0

4 months ago

0.1.1

11 months ago

0.1.0

11 months ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.3

3 years ago

0.0.5

3 years ago

0.0.6

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago