#
luxiaotao1123
2024-05-08 9efa735d68a8385a73290156b73850f7233e05fe
#
2个文件已修改
18 ■■■■ 已修改文件
src/components/agv.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/common.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/agv.jsx
@@ -14,7 +14,8 @@
} from '../config/setting'
const Agv = (props) => {
    const { agvNo, position, theta, trayList, hasBox } = props;
    const { agvNo, position, trayList, hasBox } = props;
    const theta = -props.theta;
    const height = props.height * 0.04;
    const forkLength = props.forkLength * 0.1;
    const loaderTheta = Number(props.loaderTheta?.toFixed(1));
@@ -50,8 +51,8 @@
        }
        // group theta
        if (groupTheta !== -theta && props.theta !== null) {
            const minTheta = Common.minDiffTheta(groupTheta, -theta);
        if (groupTheta !== theta && props.theta !== null) {
            const minTheta = Common.normalizeAngle(theta);
            new TWEEN.Tween({ value: groupTheta })
                .to({ value: minTheta }, INTERVAL_TIME)
                .easing(TWEEN.Easing.Linear.None)
@@ -83,9 +84,10 @@
        // console.log("loaderTheta", loaderTheta);
        // console.log("loaderAbsoluteAngle", loaderAbsoluteAngle);
        if (integrateTheta !== loaderAbsoluteAngle && props.loaderTheta !== null) {
            const minTheta = Common.normalizeAngle(loaderAbsoluteAngle);
            // const minTheta = Common.minDiffTheta(integrateTheta, loaderAbsoluteAngle);
            new TWEEN.Tween({ value: integrateTheta })
                .to({ value: loaderAbsoluteAngle }, INTERVAL_TIME)
                .to({ value: minTheta }, INTERVAL_TIME)
                .easing(TWEEN.Easing.Linear.None)
                .onUpdate((e) => {
                    setIntegrateTheta(e.value)
src/utils/common.js
@@ -28,6 +28,14 @@
    return (targetTheta - originTheta > 180) ? targetTheta - 360 : targetTheta;
}
export const normalizeAngle = (angle) => {
    let newAngle = angle % 360;
    if (newAngle < 0) {
        newAngle += 360;
    }
    return newAngle;
}
export const calculateMappedPosition = (realPos) => {
    return [
        realPos[0] * REAL_COMPARE_MAP_SCALE + REAL_COMPARE_MAP_OFFSET_X,