Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Imagery Plugin] Add Related Telemetry functionality and Imager Freshness Indicators #3665

Closed
jvigliotta opened this issue Feb 3, 2021 · 3 comments · Fixed by #3675
Closed
Assignees

Comments

@jvigliotta
Copy link
Contributor

jvigliotta commented Feb 3, 2021

Overview

Some imagery requires additional "related" telemetry to determine if the image is fresh or not. This adds new related telemetry capabilities to the imagery plugin, as well as utilizing that new functionality to show image freshness (currently based on Rover Position and Camera PTU).

Related to: #3658

Expected Behavior

  • If rover position for the image has not changed since the image was taken, then a "POS" fresh indicator should show
  • If camera angles AND rover position for the image has not changed since the image was taken, then a "CAM" fresh indicator should show
  • if reference frames are being used, they should also be used in the calculations for determining freshness
  • if an indicator is NOT fresh, nothing should show

Steps to Reproduce (Locally)

  1. (ImageryViewLayout.vue) Add this to "mounted()" after "this.requestHistory();":
let searchIndexBuildDelay = new Promise((resolve, reject) => {
    setTimeout(resolve, 3000);
});
await searchIndexBuildDelay;
  1. (RelatedTelemetry.js) Add this before the "copyObject(obj)" function:
function devRelatedImagery(openmct, imageHints, keys) {
    let searchService = openmct.$injector.get('searchService');

    // mock related telemetry metadata
    imageHints.relatedTelemetry = {};

    // populate temp keys in imageHints for local testing
    keys.forEach(key => {

        imageHints.relatedTelemetry[key] = {
            dev: true,
            comparisonFunction: function (valueOne, valueTwo) {
                const TOLERANCE = 0.5;
                let larger = valueOne;
                let smaller = valueTwo;

                if (larger < smaller) {
                    larger = valueTwo;
                    smaller = valueOne;
                }

                return (larger - smaller) < TOLERANCE;
            },
            realtime: {
                telemetryObjectId: key,
                valueKey: 'sin'
            },
            historical: {
                telemetryObjectId: key,
                valueKey: 'sin'
            },
            devInit: async () => {
                const searchResults = await searchService.query(key);
                const endpoint = searchResults.hits[0].id;
                const domainObject = await openmct.objects.get(endpoint);

                return domainObject;
            }
        };
    });

    return imageHints;
}
  1. (RelatedTelemetry.js) In the constructor:
    Replace this line:
let imageHints = copyObject(metadata.valuesForHints(['image'])[0]);

with:

let imageHints = devRelatedImagery(
    this._openmct,
    copyObject(metadata.valuesForHints(['image'])[0]),
    telemetryKeys
);
  1. (RelatedTelemetry.js) In _initializeHistorical() method:
    Replace:
if (this[key].historical.telemetryObjectId) {

with:

if (true) {

And replace:

this[key].historicalDomainObject = await this._openmct.objects.get(this[key].historical.telemetryObjectId);

with:

this[key].historicalDomainObject = await this[key].devInit();
  1. (RelatedTelemetry.js) In _initializeHistorical() method:
    Replace:
this[key].realtimeDomainObject = await this._openmct.objects.get(this[key].realtime.telemetryObjectId);

with:

this[key].realtimeDomainObject = await this[key].devInit();
  1. Import Imagery Test Objects (below)
  2. create an Example Imagery Object
  3. view the example imagery object (will have to wait for indexer to index the test objects, may have to click on thumbnails)

Imagery Test Objects

{"openmct":{"3abfb74d-37cc-4308-87a2-a211a6b0dc62":{"type":"folder","location":"d2e78f46-f9e0-4826-bc49-dcb5f800b2f3","composition":[{"namespace":"","key":"908a7c5a-19e4-4609-8b1b-ea20741e5808"},{"namespace":"","key":"516b6e34-3210-4b01-8425-440e8bae341b"},{"namespace":"","key":"bc60b26b-356b-45a5-b144-16f0eae85cc3"},{"namespace":"","key":"e8d13867-6f11-41ac-b8d9-edd10e8c8ef6"},{"namespace":"","key":"bd7cbac1-ffb8-49f4-b3ba-2529a6981820"},{"namespace":"","key":"21cebb3b-a87d-49e6-b115-00b50689c1c5"}],"name":"Imagery Test Objects","modified":1612478819644,"persisted":1612478819644,"id":"3abfb74d-37cc-4308-87a2-a211a6b0dc62","identifier":{"namespace":"","key":"3abfb74d-37cc-4308-87a2-a211a6b0dc62"}},"908a7c5a-19e4-4609-8b1b-ea20741e5808":{"telemetry":{"period":1000,"amplitude":180,"offset":0,"dataRateInHz":1,"phase":0,"randomness":0},"name":"sunOrientation","type":"generator","location":"3abfb74d-37cc-4308-87a2-a211a6b0dc62","modified":1612478791858,"persisted":1612478791857,"id":"908a7c5a-19e4-4609-8b1b-ea20741e5808","notes":"","identifier":{"namespace":"","key":"908a7c5a-19e4-4609-8b1b-ea20741e5808"}},"516b6e34-3210-4b01-8425-440e8bae341b":{"telemetry":{"period":400,"amplitude":180,"offset":0,"dataRateInHz":0.02,"phase":80,"randomness":0},"name":"heading","type":"generator","id":"516b6e34-3210-4b01-8425-440e8bae341b","notes":"","location":"3abfb74d-37cc-4308-87a2-a211a6b0dc62","persisted":1612478798051,"modified":1612478798051,"identifier":{"namespace":"","key":"516b6e34-3210-4b01-8425-440e8bae341b"}},"bc60b26b-356b-45a5-b144-16f0eae85cc3":{"telemetry":{"period":400,"amplitude":12,"offset":0,"dataRateInHz":0.03,"phase":80,"randomness":0},"name":"roll","type":"generator","location":"3abfb74d-37cc-4308-87a2-a211a6b0dc62","modified":1612478804500,"persisted":1612478804500,"id":"bc60b26b-356b-45a5-b144-16f0eae85cc3","identifier":{"namespace":"","key":"bc60b26b-356b-45a5-b144-16f0eae85cc3"}},"e8d13867-6f11-41ac-b8d9-edd10e8c8ef6":{"telemetry":{"period":400,"amplitude":8,"offset":0,"dataRateInHz":0.03,"phase":80,"randomness":0},"name":"pitch","type":"generator","location":"3abfb74d-37cc-4308-87a2-a211a6b0dc62","persisted":1612478811856,"modified":1612478811856,"id":"e8d13867-6f11-41ac-b8d9-edd10e8c8ef6","identifier":{"namespace":"","key":"e8d13867-6f11-41ac-b8d9-edd10e8c8ef6"}},"bd7cbac1-ffb8-49f4-b3ba-2529a6981820":{"telemetry":{"period":18,"amplitude":0.75,"offset":0.5,"dataRateInHz":0.03,"phase":0,"randomness":3},"name":"cameraTilt","type":"generator","location":"3abfb74d-37cc-4308-87a2-a211a6b0dc62","modified":1612478829833,"persisted":1612478829833,"id":"bd7cbac1-ffb8-49f4-b3ba-2529a6981820","identifier":{"namespace":"","key":"bd7cbac1-ffb8-49f4-b3ba-2529a6981820"}},"21cebb3b-a87d-49e6-b115-00b50689c1c5":{"telemetry":{"period":18,"amplitude":1.25,"offset":0.5,"dataRateInHz":0.01,"phase":0,"randomness":3},"name":"cameraPan","type":"generator","id":"21cebb3b-a87d-49e6-b115-00b50689c1c5","location":"3abfb74d-37cc-4308-87a2-a211a6b0dc62","persisted":1612478840104,"modified":1612478840104,"identifier":{"namespace":"","key":"21cebb3b-a87d-49e6-b115-00b50689c1c5"}}},"rootId":"3abfb74d-37cc-4308-87a2-a211a6b0dc62"}
@akhenry
Copy link
Contributor

akhenry commented Feb 25, 2021

@jvigliotta @charlesh88 Let's discuss positional freshness. Should use spacecraft position, not orientation.

@charlesh88
Copy link
Contributor

Verified fixed Testathon 3-3-21.

@jvigliotta
Copy link
Contributor Author

Verified Fixed - Testathon: 3/3/2021

@akhenry akhenry removed the unverified label Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants