Skip to content

CSPS query interface_beta 0.4

Nils Hamel edited this page Mar 13, 2015 · 5 revisions

Overview

Because of the library architecture, results of the processing of a topology is necessarily stored in streams. The library provides a way of accessing the data contained in the streams through a query interface. Moreover, the query interface allows to perform queries on values that are not necessarily on a time discretization node using cubic interpolation. It follows that any timestamp contained in the stream time range can be given to access results data.

Query interface

Taking into account that client software have to perform a large number of query on a specific result stream, the query interface operates in three steps : the first step consists in result stream openning and loading returning a structure that is then used for queries as a second step. The last step consists simply in structure release to unallocate memory.

Several types of query can be performed using the library dedicated interface such as queries on positions and queries on orientations. Depending on query type, additionnal methods are available to access results stored in the query structure through different parameters.

Query on synchronization

The query on synchronization consists in getting the master timestamp and the synchornization timestamp to ensure synchronization between all engaged devices in the device assembly and the image files named using the master timestamp. The query is based on the offset of the values in data stream or on a provided master timestamp.

Query on position

The query on position answers the positions of the device assembly in ellipsoidal coordinates considering the WGS84 geoid based on a provided timestamp. Interpolation is used to compute the most accurate position according to the timestamp value.

Query on orientation

The query on orientation gives the orientations of the device assembly according to earth using a provided timestamp. Interpolation is used to provides the best approximation according to provided timestamp.

Query on inertial still ranges

The query on inertial still ranges answers a boolean value that indicates if the device assembly is contained in an automatically detected inertial still range based on a provided timestamp.

Query example

Considering a processed structure of a device assembly engaging a GPS reciever, the following code gives an example of query interface usage for earth-attached position :

/* Query structure creation */
lp_Position_t Query = lp_query_position_create( 

    "/some/path/", 
    "ls20031", 
    "mod-SGNQF" 

);

/* Verify query structure creation */
if ( lp_query_position_state( & Query ) == LP_TRUE ) {

    /* Perform a query on position */
    lp_query_position( & Query, lp_timestamp_compose( 1400684250lu, 0lu ) );

    /* Check query results */
    if ( Query.qrStatus == LP_TRUE ) {

        /* Display queried position */
        printf( "Position : %f, %f, %f\n", 

            Query.qrLatitude,
            Query.qrLongitude,
            Query.qrAltitude 

        );

    } else {

        /* The query on position failed */
        printf( "The query failed\n" );

    }

    /* Release query structure */
    lp_query_position_delete( & Query );

} else {

    /* Creation of query structure failed */
    printf( "The query structure creation failed\n" );

}

On this example, a query on position is made considering positioning results provided by the mod-SGNQF module and related to a GPS device tagged by ls20031. The first condition tests if query structure is correctly created. The second condition tests if the performed query as succeed. Finally, the query structure is released. If the query structure is not released, memory leaks have to be expected.

If the topology used to process the considered CSPS structure contains defined origin directive, the query structure creation can be replaced as follows :

/* Query structure creation */
lp_Position_t Query = lp_query_position_origin( "/some/path/" );

The created query structure is identical if the origin directive is defined using the same device and module (ls20031, mod-SGNQF).

Failures on structure creation are essentially due to bad path specification or bad switches on module name and device tag. If query structure creation failed, the implemented query functions always return a query failure status.

Failures on query are essentially due to index or timestamp that are out of the range defined by the stream components.


  [Home](Home)

  Section : device assembly

  • [CSPS device assembly](CSPS device assembly)

  Section : architecture

  • [CSPS architecture](CSPS architecture)

  Section : streams

  • [CSPS streams](CSPS streams)

  Section : extraction modules

  • [Module : cam-mod-DSIDE](Module cam-mod-DSIDE)
  • [Module : imu-mod-DSIDE](Module imu-mod-DSIDE)
  • [Module : gps-mod-DSIDE](Module gps-mod-DSIDE)

  Section : stream modules

  • [Module : gps-mod-SGNQF](Module gps-mod-SGNQF)
  • [Module : imu-mod-IFETI](Module imu-mod-IFETI)
  • [Module : imu-mod-IOISA](Module imu-mod-IOISA)
  • [Module : imu-mod-ISRAD](Module imu-mod-ISRAD)
  • [Module : imu-mod-SGNDN](Module imu-mod-SGNDN)
  • [Module : imu-mod-SGSFR](Module imu-mod-SGSFR)
  • [Module : imu-mod-AACEX](Module imu-mod-AACEX)
  • [Module : imu-mod-IFICR](Module imu-mod-IFICR)
  • [Module : imu-mod-IOBMA](Module imu-mod-IOBMA)

  Section : topology

  • [CSPS topology](CSPS topology)

  Section : query interface

  • [CSPS query interface](CSPS query interface)

  Section : Library usage

  • [Library usage](Library usage)

  Development : logs


Clone this wiki locally