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