🪠 Removes feature code

This commit is contained in:
Rune Harlyk
2024-06-03 18:43:01 +02:00
committed by Rune Harlyk
parent bfca33e55d
commit 4bf630edd3
9 changed files with 16742 additions and 16260 deletions
+7 -13
View File
@@ -45,7 +45,7 @@
];
let settings = {
'Internal kinematic':true,
'Internal kinematic':false,
'Robot transform controls':false,
'Auto orient robot':true,
'Trace feet':debug,
@@ -87,14 +87,6 @@
settings.x = data.ly / 2
settings.z = data.lx / 2
break;
case ModesEnum.Walk:
// target_position.yaw += data.lx / 100
// const angle = radToDeg(Math.atan2(data.rx, data.ry)) - 90 + $mpu.heading + target_position.yaw;
// const distance = Math.sqrt(data.rx**2 + data.ry**2) / 25
// target_position.x = distance * Math.cos(degToRad(angle))
// target_position.z = distance * Math.sin(degToRad(angle))
break;
}
})
});
@@ -267,6 +259,11 @@
settings.z = -robot.position.x * 100
}
const updateTargetPosition = () => {
target.position.x = lerp(target.position.x, target_position.x, 0.5)
target.position.z = lerp(target.position.z, target_position.z, 0.5)
}
const render = () => {
const robot = sceneManager.model;
if (!robot) return;
@@ -293,10 +290,7 @@
}
orient_robot(robot, toes)
target.position.x = lerp(target.position.x, target_position.x, 0.5)
// target.position.y = lerp(target.position.y, robot.position.y, 0.5)
target.position.z = lerp(target.position.z, target_position.z, 0.5)
updateTargetPosition();
};
+7 -7
View File
@@ -33,7 +33,7 @@ export default class Kinematic {
L: number;
W: number;
DEGREES2RAD = 0.017453292519943;
DEG2RAD = 0.017453292519943;
sHp = sin(Math.PI / 2);
cHp = cos(Math.PI / 2);
@@ -115,12 +115,12 @@ export default class Kinematic {
}
bodyIK(p: body_state_t) {
const cos_omega = cos(p.omega * this.DEGREES2RAD);
const sin_omega = sin(p.omega * this.DEGREES2RAD);
const cos_phi = cos(p.phi * this.DEGREES2RAD);
const sin_phi = sin(p.phi * this.DEGREES2RAD);
const cos_psi = cos(p.psi * this.DEGREES2RAD);
const sin_psi = sin(p.psi * this.DEGREES2RAD);
const cos_omega = cos(p.omega * this.DEG2RAD);
const sin_omega = sin(p.omega * this.DEG2RAD);
const cos_phi = cos(p.phi * this.DEG2RAD);
const sin_phi = sin(p.phi * this.DEG2RAD);
const cos_psi = cos(p.psi * this.DEG2RAD);
const sin_psi = sin(p.psi * this.DEG2RAD);
const Tm: number[][] = [
[cos_phi * cos_psi, -sin_psi * cos_phi, sin_phi, p.xm],
+1 -1
View File
@@ -19,7 +19,7 @@ export enum ModesEnum {
Walk
}
export const mode: Writable<ModesEnum> = writable(ModesEnum.Walk);
export const mode: Writable<ModesEnum> = writable(ModesEnum.Idle);
export const outControllerData = writable([0, 0, 0, 0, 0, 70, 0]);