From b981f6e4943d5158544de124b5984d2abba51b3b Mon Sep 17 00:00:00 2001 From: Evan Astle Date: Mon, 11 Sep 2023 18:27:52 -0700 Subject: [PATCH 1/2] Fix to enable setting speed for arm with slider. --- src/components/ArmSystem.tsx | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/components/ArmSystem.tsx b/src/components/ArmSystem.tsx index 05aff3a..bf7d71c 100644 --- a/src/components/ArmSystem.tsx +++ b/src/components/ArmSystem.tsx @@ -44,14 +44,14 @@ export default function ArmSystem({ commands }) { useEffect(() => { const interval = setInterval(() => { - updateController(); + if(getGamePad()) {updateController();} }, 125); return () => clearInterval(interval); }, []); function updateCommands(newCommands) { commands.current = armStringFormat(newCommands); - setArmCommands(newCommands); + setArmCommands(prev => ({...prev, ...newCommands})); } function handleChange(e) { @@ -64,7 +64,7 @@ export default function ArmSystem({ commands }) { } function updateController() { - updateCommands({ ...getCommands(), speed: armCommands.speed }); + updateCommands({ ...getCommands() }); } function getCommands(): ArmCommandDTO { @@ -75,17 +75,16 @@ export default function ArmSystem({ commands }) { } let currentCommands = commandsRef.current; - let commands = DEFAULT_ARM_COMMANDS; - - commands.rotunda_angle = controller.getRotundaAngle(currentCommands); - commands.shoulder_angle = controller.getShoulderAngle(currentCommands); - commands.elbow_angle = controller.getElbowAngle(currentCommands); - commands.wrist_roll_angle = controller.getWristRollAngle(currentCommands); - commands.wrist_pitch_angle = controller.getWristPitchAngle(currentCommands); - commands.end_effector_angle = controller.getEndEffectorAngle(currentCommands); - - - return commands; + let newCommands = DEFAULT_ARM_COMMANDS; + + newCommands.rotunda_angle = controller.getRotundaAngle(currentCommands); + newCommands.shoulder_angle = controller.getShoulderAngle(currentCommands); + newCommands.elbow_angle = controller.getElbowAngle(currentCommands); + newCommands.wrist_roll_angle = controller.getWristRollAngle(currentCommands); + newCommands.wrist_pitch_angle = controller.getWristPitchAngle(currentCommands); + newCommands.end_effector_angle = controller.getEndEffectorAngle(currentCommands); + delete newCommands.speed; + return newCommands; } function getGamePad() { From d9f12e3cdd3ec7b64b3762e2f10eae23c2b43138 Mon Sep 17 00:00:00 2001 From: Evan Astle Date: Mon, 11 Sep 2023 18:28:18 -0700 Subject: [PATCH 2/2] Switch to TP-Link cameras IP. --- src/App.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 75fc457..6eddc30 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -70,8 +70,8 @@ function App() { {system === 'science' && } - - + +