armbot trigger
This commit is contained in:
@@ -1,21 +1,86 @@
|
||||
import { useEffect } from "react";
|
||||
import RoboticArmInstances from "./instances/roboticArmInstances";
|
||||
import { useArmBotStore } from "../../../store/simulation/useArmBotStore";
|
||||
import { useFloorItems } from "../../../store/store";
|
||||
|
||||
function RoboticArm() {
|
||||
const { armBots, addArmBot, addCurrentAction } = useArmBotStore();
|
||||
const { armBots, addArmBot, removeArmBot } = useArmBotStore();
|
||||
const { floorItems } = useFloorItems();
|
||||
|
||||
const armBotStatusSample: RoboticArmEventSchema[] = [
|
||||
{
|
||||
state: "idle",
|
||||
// currentAction: {
|
||||
// actionUuid: "action-001",
|
||||
// actionName: "Pick Component",
|
||||
// },
|
||||
modelUuid: "armbot-xyz-001",
|
||||
modelName: "ArmBot-X200",
|
||||
position: [0, 0, 0],
|
||||
rotation: [91.94347308985614, 0, 6.742905194869091],
|
||||
position: [91.94347308985614, 0, 6.742905194869091],
|
||||
rotation: [0, 0, 0],
|
||||
type: "roboticArm",
|
||||
speed: 1.5,
|
||||
point: {
|
||||
uuid: "point-123",
|
||||
position: [0, 1.5, 0],
|
||||
rotation: [0, 0, 0],
|
||||
actions: [
|
||||
{
|
||||
actionUuid: "action-003",
|
||||
actionName: "Pick Component",
|
||||
actionType: "pickAndPlace",
|
||||
process: {
|
||||
startPoint: [5.52543010919071, 1, -8.433681161200905],
|
||||
endPoint: [10.52543010919071, 1, -12.433681161200905],
|
||||
},
|
||||
triggers: [
|
||||
{
|
||||
triggerUuid: "trigger-001",
|
||||
triggerName: "Start Trigger",
|
||||
triggerType: "onStart",
|
||||
delay: 0,
|
||||
triggeredAsset: {
|
||||
triggeredModel: {
|
||||
modelName: "Conveyor A1",
|
||||
modelUuid: "conveyor-01",
|
||||
},
|
||||
triggeredPoint: {
|
||||
pointName: "Start Point",
|
||||
pointUuid: "conveyor-01-point-001",
|
||||
},
|
||||
triggeredAction: {
|
||||
actionName: "Move Forward",
|
||||
actionUuid: "conveyor-action-01",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
triggerUuid: "trigger-002",
|
||||
triggerName: "Complete Trigger",
|
||||
triggerType: "onComplete",
|
||||
delay: 0,
|
||||
triggeredAsset: {
|
||||
triggeredModel: {
|
||||
modelName: "StaticMachine B2",
|
||||
modelUuid: "machine-02",
|
||||
},
|
||||
triggeredPoint: {
|
||||
pointName: "Receive Point",
|
||||
pointUuid: "machine-02-point-001",
|
||||
},
|
||||
triggeredAction: {
|
||||
actionName: "Process Part",
|
||||
actionUuid: "machine-action-01",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
state: "idle",
|
||||
modelUuid: "armbot-xyz-002",
|
||||
modelName: "ArmBot-X200",
|
||||
position: [95.94347308985614, 0, 6.742905194869091],
|
||||
rotation: [0, 0, 0],
|
||||
type: "roboticArm",
|
||||
speed: 1.5,
|
||||
point: {
|
||||
@@ -28,8 +93,8 @@ function RoboticArm() {
|
||||
actionName: "Pick Component",
|
||||
actionType: "pickAndPlace",
|
||||
process: {
|
||||
startPoint: [1.2, 0.3, 0.5],
|
||||
endPoint: [-0.8, 1.1, 0.7],
|
||||
startPoint: [2.52543010919071, 0, 8.433681161200905],
|
||||
endPoint: [95.3438373267953, 0, 9.0279187421610025],
|
||||
},
|
||||
triggers: [
|
||||
{
|
||||
@@ -80,20 +145,20 @@ function RoboticArm() {
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
removeArmBot(armBotStatusSample[0].modelUuid);
|
||||
addArmBot('123', armBotStatusSample[0]);
|
||||
// addArmBot('123', armBotStatusSample[1]);
|
||||
// addCurrentAction('armbot-xyz-001', 'action-001');
|
||||
}, []);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
console.log('armBots: ', armBots);
|
||||
//
|
||||
}, [armBots]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
<RoboticArmInstances />
|
||||
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user