"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const integration_base_1 = require("@things-factory/integration-base");
const util_1 = require("./util");
async function AdjustPose(step, { logger, data }) {
    var { params: { accessor, overrider, pose } } = step;
    var position = (0, util_1.getPositionFromAccessor)('accessor', accessor, data, logger);
    (0, util_1.checkValidPose)('accessor', position);
    var overposition = overrider ? (0, util_1.getPositionFromAccessor)('overrider', overrider, data, logger) : {};
    return {
        data: Object.assign(Object.assign(Object.assign({}, position), (0, util_1.prunePose)('overrider', overposition, logger)), (0, util_1.prunePose)('pose', Object.assign({}, pose), logger))
    };
}
AdjustPose.parameterSpec = [
    {
        type: 'scenario-step-input',
        label: 'accessor',
        name: 'accessor'
    },
    {
        type: 'scenario-step-input',
        label: 'overrider',
        name: 'overrider'
    },
    {
        type: 'pose',
        label: 'pose',
        name: 'pose'
    }
];
AdjustPose.connectorFree = true;
AdjustPose.help = 'robotics/task/adjust-pose';
integration_base_1.TaskRegistry.registerTaskHandler('adjust-pose', AdjustPose);
//# sourceMappingURL=adjust-pose.js.map