Commit ad44e19e authored by Bejarano Rodriguez Ronal's avatar Bejarano Rodriguez Ronal
Browse files

As submitted by PW group 08 - 2021

parents
__pycache__
db.sqlite3
# Gr8_ProjectWork
Repo for Project work - Group 08: Adaptive automated mobile manipulators in agile manufacturing at Aalto Univeristy.
Agile manufacturing is an approach to manufacturingthat leverages flexibility, bottom-upinnovation, and augmentation in order to quickly adapt,through an iterative process, to changingconditions such as customer needs and market changeswhile still controlling costs and quality. Theterm is applied to an organization that has createdthe processes, tools, and training needed to beable to do so.
Using collaborative robots that are integrated intoautomated guided vehicles (AGVs) is a new wayto promote agile manufacturing that also brings manytechnological challenges. Having betterresilience under unexpected changes and conditionsis demanded from every system on the factoryfloor in this futuristic setup. One example of suchdemands or requirements would be howautomated mobile manipulators respond to deviationsin physical location of workpieces andenvironment tools. This project aims to implementand review methods that facilitate the dockingand manipulation of the autonomous mobile manipulators(MiR100+UR3e and SEIT100+YuMI)available in the Aalto Factory of the Future (AFoF).
A complete solution was implemented only for the MiR100+UR3emobile manipulator, while theimage recognition unit and pick-and-place operationof the YuMI robot was developed and testedwithout combining them with the SEIT100’s guided missionto form a complete solution. A coupleof 3D markers were created (both physically and inthe MiR100’s API) and used by theMiR100+UR3e mobile manipulator to guide it into thecorrect position for doing the assignedpick-and-place tasks. For the UR3e robot arm and gripper,an orange tag attached to the gripper wasused in the calibration process. The tag was recognizedby the image recognition unit (camera +Jetson Nano) and the appropriate coordinate transformation(between the camera coordinate frameand the UR3e’s base coordinate frame) was calculatedand sent to the mobile manipulator to ensurethat the gripper would reach accurately to the workpiecein the pick-and-place operation.
## Folders
### src
The directory containing the main program **run_camera.py**. Also contains helper functions.
### docs
Documentation for used equipment in lab.
### interface / django
The needed modules for the web interface.
### mir_API_client
Directory for MiR100 API Client created by project work group from 2020 ([Distributed intelligent production involving remote actors](https://wiki.aalto.fi/display/AEEproject/Distributed+intelligent+production+involving+remote+actors)).
Improved version with a terminal user interface (python-inquirer).
### opencv
Script for finding HSV values of an image. Also scrap code for calculating pixel to meter calibration values and angle values.
### URScript
The URScripts meant for the UR robot. Saved in *.txt but should be in *.urp format for UR3.
### YuMi
Folder containing development on the YuMi+SEIT100.
## List of registers
### **int** registers
**05** : trigger boolean for Jetson
**06** : trigger boolean for UR3
**07** : trigger boolean for when at *center_pose*
### **float** registers
**101** : for storing desired relative x-coordinates
**102** : for storing desired relative y-coordinates
**103** : for storing desired relative z-coordinates
## User manual
### MiR100 + UR3e
- Power on the MiR100 and UR3e
- Open the the program `gr8_move_to_grasp.urp` in the UR3e teaching pendant
- Set the UR3e in remote mode
- There is no need to put the MiR in Executing queue state, as the software does so via the rest API
- Place the 3D marker on the floor according to figure 1 below
- Check that the Jetson Nano on ENAS is powered on
- Connect your laptop or workstation to the AFoF5 wifi and open the terminal
- Connect to Jetson via ssh `ssh jetson-gr8@192.168.1.124`
- Enter the password `projectwork` when prompted
- Continue in section 1 or 2 as preferred
#### 1. Running the system via web interface
-
- Navigate to the interface folder `cd gr8_projectwork/interface`
- Run the local server `python3 manage.py runserver 0.0.0.0:8000`
- Connect to the web interface via the web browser `192.168.1.124:8000` (Make sure you are connected to AFoF5)
- Login to the interface with username `admin` and password `admin`
- From here you can start the process
#### 2. Running the system via terminal
- If the web interface for some reason is not working properly it is possible to start the process via the terminal
- Navigate to the src folder `cd gr8_projectwork/src`
- Run the file `python3 run_camera.py`
##### Back to common usage
- Place a workpiece somewhere in the camera's field of view
- - Check that the MiR does not hit something during execution
- Like a desk which it cannot see
Note:
- The MiR executes a mission called “gr8_pick_up_workpiece”.
- If using a different network; Jetson, MiR and the workstation should be connected to the same network.
- By using the labs OpenVPN cloud platform, all resources are available.
![figure1](docs/3d_marker_position.png)
\ No newline at end of file
Program
Robot Program
x_grasp≔getMirPlcRegister(101)
y_grasp≔getMirPlcRegister(102)
z_grasp≔getMirPlcRegister(103)
Gripper Activate
MoveJ
Initial_pos
MoveJ
Ready_Pose
'Go to our supposed center_pose'
center_pose≔pose_add(Ready_Pose, p[x_grasp,y_grasp,z_grasp,0,0.9,0])
MoveL
center_pose
setMirPlcRegister(5,1)
setMirPlcRegister(6,0)
Wait: 3.0
Loop getMirPlcRegister(6)==0
Wait: 1.0
overextended≔getMirPlcRegister(7)
'Loop until we're at center_pose'
'register 7 == 1, if we're at center_pose'
Loop getMirPlcRegister(7)==0
x_grasp≔getMirPlcRegister(101)
y_grasp≔getMirPlcRegister(102)
center_pose≔pose_add(center_pose, p[x_grasp,y_grasp,0,0,0,0])
MoveL
center_pose
setMirPlcRegister(5,1)
setMirPlcRegister(6,0)
Loop getMirPlcRegister(6)==0
Wait: 1.0
'Move to pregrasp_pose'
Wait: 3.0
x_grasp≔getMirPlcRegister(101)
y_grasp≔getMirPlcRegister(102)
z_grasp≔getMirPlcRegister(103)
pregrasp_pose≔pose_add(center_pose, p[x_grasp,y_grasp,z_grasp,0,0,0])
MoveL
pregrasp_pose
'Old version: grasp_pose:=pose_add(pregrasp_pose,p[x_grasp,y_grasp,z_grasp,0,0,0])'
grasp_pose≔pose_add(pregrasp_pose, p[0,0,-0.1,0,0,0])
MoveL
grasp_pose
Wait: 0.5
Gripper Close (1)
MoveL
pregrasp_pose
MoveL
Ready_Pose
MoveJ
Initial_pos
MoveL
Drop_pose
Gripper Open (1)
MoveJ
Initial_pos
MODULE MainModule
CONST robtarget home:=[[197.08,354.50,296.60],[0.0438683,-0.494626,0.867878,0.0144155],[0,1,-1,4],[120.897,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget shirt:=[[447.31,123.91,132.17],[0.0185459,0.392416,0.9116,-0.121042],[-1,2,0,4],[131.126,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftshirt:=[[160.55,197.25,252.37],[0.0167024,-0.37432,-0.92537,0.0574181],[0,2,0,4],[141.907,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget cd:=[[429.87,322.22,213.23],[0.0259492,-0.676393,-0.735668,0.0247397],[-1,1,1,4],[130.133,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftcd1:=[[-87.34,255.90,239.55],[0.0729193,-0.839271,0.534115,0.0709135],[0,2,-1,4],[91.9038,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftcd2:=[[560.51,250.68,457.37],[0.276236,0.513235,0.810863,-0.0527657],[-1,1,0,4],[174.245,9E+09,9E+09,9E+09,9E+09,9E+09]];
PERS bool block2:=FALSE;
PERS bool L_yumi2bool:=FALSE;
VAR syncident sync1;
VAR syncident sync2;
VAR syncident sync3;
PERS tasks tasklist1{2}:=[["T_ROB_L"], ["T_ROB_R"]];
PROC syncmove()
SyncMoveOn sync1, tasklist1;
MoveL liftshirt \ID:=10, v200, fine, tool0;
SyncMoveOff sync2;
UNDO
SyncMoveUndo;
ENDPROC
PROC main()
g_Init \maxSpd:=10 \holdForce:=20 \Calibrate;
g_SetForce 20;
g_SetMaxSpd 10;
g_GripOut;
MoveJ home, v500, z50, tool0;
MoveJ Offs(shirt, 0, 0, 100), v500, z50, tool0;
MoveL shirt, v200, z50, tool0;
g_GripIn \holdForce:=20;
syncmove;
g_GripOut;
MoveJ Offs(cd, 0, 0, 100), v200, z50, tool0;
MoveL cd, v100, z50, tool0;
g_GripIn\holdForce:=20;
MoveL Offs(cd, 0, 0, 100), v200, z50, tool0;
FOR i FROM 1 TO 3 DO
MoveJ liftcd2, v300, z50, tool0;
WaitTime(0.5);
MoveL Offs(cd, 0, 0, 100), v300, z50, tool0;
WaitTime(0.5);
ENDFOR
MoveJ cd, v100, z50, tool0;
g_GripOut;
MoveL Offs(cd, 0, 0, 100), v200, z50, tool0;
MoveJ home, v500, z50, tool0;
ENDPROC
ENDMODULE
\ No newline at end of file
MODULE Group8_L
CONST robtarget home_l:=[[197.08,354.50,296.60],[0.0438683,-0.494626,0.867878,0.0144155],[0,1,-1,4],[120.897,9E+09,9E+09,9E+09,9E+09,9E+09]];
!CONST robtarget home_l:=[[220.08,300.50,350.60],[0.0438683,-0.494626,0.867878,0.0144155],[0,1,-1,4],[120.897,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget shirt:=[[447.31,123.91,132.17],[0.0185459,0.392416,0.9116,-0.121042],[-1,2,0,4],[131.126,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftshirt:=[[160.55,197.25,252.37],[0.0167024,-0.37432,-0.92537,0.0574181],[0,2,0,4],[141.907,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget cd:=[[429.87,322.22,213.23],[0.0259492,-0.676393,-0.735668,0.0247397],[-1,1,1,4],[130.133,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftcd1:=[[-87.34,255.90,239.55],[0.0729193,-0.839271,0.534115,0.0709135],[0,2,-1,4],[91.9038,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftcd2:=[[560.51,250.68,457.37],[0.276236,0.513235,0.810863,-0.0527657],[-1,1,0,4],[174.245,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_Testing_gr8:=[[339.00,410.89,313.79],[0.0495403,0.463966,-0.87241,-0.145539],[-1,1,-1,4],[143.711,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Target_Disc:=[[543.96,130.55,97.44],[0.0352028,-0.258048,-0.965482,-0.0039925],[-1,1,0,4],[-164.65,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget horns1:=[[177.13,396.29,637.01],[0.761025,-0.148952,0.120783,-0.61973],[1,-1,-1,4],[-176.716,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget horns2:=[[362.35,363.35,536.30],[0.653779,-0.297409,0.54587,-0.431446],[-1,1,-1,4],[147.122,9E+09,9E+09,9E+09,9E+09,9E+09]];
PERS bool block2:=FALSE;
PERS bool L_yumi2bool:=FALSE;
VAR syncident sync1;
VAR syncident sync2;
VAR syncident sync3;
PERS tasks tasklist1{2}:=[["T_ROB_L"], ["T_ROB_R"]];
PROC syncmove()
SyncMoveOn sync1, tasklist1;
FOR i FROM 1 TO 5 DO
MoveJ horns2 \ID:=10, v500, z50, tool0;
WaitTime(0.5);
MoveJ horns1 \ID:=11, v500, z50, tool0;
WaitTime(0.5);
ENDFOR
SyncMoveOff sync2;
UNDO
SyncMoveUndo;
ENDPROC
PROC main()
g_Init \maxSpd:=10 \holdForce:=20 \Calibrate;
g_SetForce 20;
g_SetMaxSpd 10;
g_GripOut;
MoveJ home_l, v500, z50, tool0;
MoveJ Offs(Target_Disc, 0, 0, 100), v500, z50, tool0; !pre-grasp position
MoveL Target_Disc, v200, z50, tool0; !grasp pos.
WaitTime \InPos,0;
g_GripIn \holdForce:=20;
MoveJ Offs(Target_Disc, 0, 0, 100), v500, z50, tool0;
MoveJ home_l, v500, z50, tool0;
syncmove;
!move back
MoveJ Offs(Target_Disc, 0, 0, 100), v500, z50, tool0; !pre-grasp position
MoveL Target_Disc, v200, z50, tool0; !grasp pos.
WaitTime \InPos, 0;
g_GripOut;
MoveJ Offs(Target_Disc, 0, 0, 100), v500, z50, tool0;
g_GripOut;
MoveJ home_l, v500, z50, tool0;
ENDPROC
ENDMODULE
\ No newline at end of file
MODULE Group8_R
CONST robtarget home_r:=[[132.32,-292.29,279.71],[0.075835,0.990885,-0.109632,0.0194362],[0,-2,-2,4],[-110.68,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget shirt:=[[342.27,-170.59,134.28],[0.0631174,0.98789,-0.135409,0.0418875],[1,-2,-1,4],[-161.922,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftshirt:=[[122.30,-100.58,216.23],[0.0042691,0.937309,-0.316999,-0.144724],[0,-2,-1,4],[-126.571,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget horns1:=[[177.13,-396.29,637.01],[0.761025,-0.148952,0.120783,-0.61973],[1,-1,-1,4],[-176.716,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget horns2:=[[289.64,-349.58,508.70],[0.625292,-0.46516,0.341906,-0.525106],[1,-1,-1,4],[-135.629,9E+09,9E+09,9E+09,9E+09,9E+09]];
PERS bool block2:=FALSE;
PERS bool L_yumi2bool:=FALSE;
VAR syncident sync1;
VAR syncident sync2;
VAR syncident sync3;
PERS tasks tasklist1{2}:=[["T_ROB_L"], ["T_ROB_R"]];
PROC syncmove()
SyncMoveOn sync1, tasklist1;
FOR i FROM 1 TO 5 DO
MoveJ horns1 \ID:=10, v500, z50, tool0;
WaitTime(0.5);
MoveJ horns2 \ID:=11, v500, z50, tool0;
WaitTime(0.5);
ENDFOR
SyncMoveOff sync2;
UNDO
SyncMoveUndo;
ENDPROC
PROC main()
g_Init \maxSpd:=10 \holdForce:=10 \Calibrate;
g_SetForce 10;
g_SetMaxSpd 10;
g_GripOut;
MoveJ home_r, v500, z50, tool0;
MoveJ Offs(shirt, 0, 0, 100), v500, z50, tool0;
MoveL shirt, v200, z50, tool0;
g_GripIn;
syncmove;
g_GripOut;
MoveJ home_r, v500, z50, tool0;
ENDPROC
ENDMODULE
MODULE Group8_L
CONST robtarget Img_pos_gr8:=[[439.48,20.27,152.43],[0.249211,0.220339,0.65304,-0.680355],[-1,-1,2,5],[125.656,9E+09,9E+09,9E+09,9E+09,9E+09]];
VAR cameratarget mycameratarget;
PROC LoadCam()
CamSetProgramMode leftHand;
CamLoadJob leftHand, "gr8.job";
CamSetRunMode leftHand;
ENDPROC
PROC main()
g_Init \maxSpd:=10 \holdForce:=20 \Calibrate;
g_SetForce 20;
g_SetMaxSpd 10;
MoveJ Img_pos_gr8, v500, z50, tool0;
LoadCam;
CamReqImage leftHand;
CamGetResult leftHand, mycameratarget;
MoveJ Offs(Img_pos_gr8,mycameratarget.cframe.trans.x,mycameratarget.cframe.trans.y,0), v500, z50, tool0;
! Change the above cframe.trans.x/y to val1/2 etc.
ENDPROC
ENDMODULE
\ No newline at end of file
MODULE Group8_L
CONST robtarget Img_pos_gr8:=[[439.48,20.27,152.43],[0.249211,0.220339,0.65304,-0.680355],[-1,-1,2,5],[125.656,9E+09,9E+09,9E+09,9E+09,9E+09]];
VAR cameratarget mycameratarget;
PROC LoadCam()
CamSetProgramMode leftHand;
CamLoadJob leftHand, "gr8.job";
CamSetRunMode leftHand;
ENDPROC
PROC main()
g_Init \maxSpd:=10 \holdForce:=20 \Calibrate;
g_SetForce 20;
g_SetMaxSpd 10;
MoveJ Img_pos_gr8, v500, z50, tool0;
LoadCam;
CamReqImage leftHand;
CamGetResult leftHand, mycameratarget;
MoveJ Offs(Img_pos_gr8,mycameratarget.cframe.trans.x,mycameratarget.cframe.trans.y,0), v500, z50, tool0;
! Change the above cframe.trans.x/y to val1/2 etc.
ENDPROC
ENDMODULE
\ No newline at end of file
MODULE MainModule
CONST robtarget home:=[[197.08,354.50,296.60],[0.0438683,-0.494626,0.867878,0.0144155],[0,1,-1,4],[120.897,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget shirt:=[[447.31,123.91,132.17],[0.0185459,0.392416,0.9116,-0.121042],[-1,2,0,4],[131.126,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftshirt:=[[160.55,197.25,252.37],[0.0167024,-0.37432,-0.92537,0.0574181],[0,2,0,4],[141.907,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget cd:=[[429.87,322.22,213.23],[0.0259492,-0.676393,-0.735668,0.0247397],[-1,1,1,4],[130.133,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftcd1:=[[-87.34,255.90,239.55],[0.0729193,-0.839271,0.534115,0.0709135],[0,2,-1,4],[91.9038,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftcd2:=[[560.51,250.68,457.37],[0.276236,0.513235,0.810863,-0.0527657],[-1,1,0,4],[174.245,9E+09,9E+09,9E+09,9E+09,9E+09]];
PERS bool block2:=FALSE;
PERS bool L_yumi2bool:=FALSE;
VAR syncident sync1;
VAR syncident sync2;
VAR syncident sync3;
PERS tasks tasklist1{2}:=[["T_ROB_L"], ["T_ROB_R"]];
PROC syncmove()
SyncMoveOn sync1, tasklist1;
MoveL liftshirt \ID:=10, v200, fine, tool0;
SyncMoveOff sync2;
UNDO
SyncMoveUndo;
ENDPROC
PROC main()
g_Init \maxSpd:=10 \holdForce:=20 \Calibrate;
g_SetForce 20;
g_SetMaxSpd 10;
g_GripOut;
MoveJ home, v500, z50, tool0;
MoveJ Offs(shirt, 0, 0, 100), v500, z50, tool0;
MoveL shirt, v200, z50, tool0;
g_GripIn \holdForce:=20;
syncmove;
g_GripOut;
MoveJ Offs(cd, 0, 0, 100), v200, z50, tool0;
MoveL cd, v100, z50, tool0;
g_GripIn\holdForce:=20;
MoveL Offs(cd, 0, 0, 100), v200, z50, tool0;
FOR i FROM 1 TO 3 DO
MoveJ liftcd2, v300, z50, tool0;
WaitTime(0.5);
MoveL Offs(cd, 0, 0, 100), v300, z50, tool0;
WaitTime(0.5);
ENDFOR
MoveJ cd, v100, z50, tool0;
g_GripOut;
MoveL Offs(cd, 0, 0, 100), v200, z50, tool0;
MoveJ home, v500, z50, tool0;
ENDPROC
ENDMODULE
RRR
MODULE MainModule
CONST robtarget home:=[[132.32,-292.29,279.71],[0.075835,0.990885,-0.109632,0.0194362],[0,-2,-2,4],[-110.68,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget shirt:=[[342.27,-170.59,134.28],[0.0631174,0.98789,-0.135409,0.0418875],[1,-2,-1,4],[-161.922,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftshirt:=[[122.30,-100.58,216.23],[0.0042691,0.937309,-0.316999,-0.144724],[0,-2,-1,4],[-126.571,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget horns1:=[[177.13,-396.29,637.01],[0.761025,-0.148952,0.120783,-0.61973],[1,-1,-1,4],[-176.716,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget horns2:=[[289.64,-349.58,508.70],[0.625292,-0.46516,0.341906,-0.525106],[1,-1,-1,4],[-135.629,9E+09,9E+09,9E+09,9E+09,9E+09]];
PERS bool block2:=FALSE;
PERS bool L_yumi2bool:=FALSE;
VAR syncident sync1;
VAR syncident sync2;
VAR syncident sync3;
PERS tasks tasklist1{2}:=[["T_ROB_L"], ["T_ROB_R"]];
PROC syncmove()
SyncMoveOn sync1, tasklist1;
MoveL liftshirt \ID:=10, v200, fine, tool0;
SyncMoveOff sync2;
UNDO
SyncMoveUndo;
ENDPROC
PROC main()
g_Init \maxSpd:=10 \holdForce:=10 \Calibrate;
g_SetForce 10;
g_SetMaxSpd 10;
g_GripOut;
MoveJ home, v500, z50, tool0;
MoveJ Offs(shirt, 0, 0, 100), v500, z50, tool0;
MoveL shirt, v200, z50, tool0;
g_GripIn;
syncmove;
g_GripOut;
FOR i FROM 1 TO 10 DO
MoveJ horns1, v500, z50, tool0;
WaitTime(0.5);
MoveJ horns2, v500, z50, tool0;
WaitTime(0.5);
ENDFOR
MoveJ home, v500, z50, tool0;
ENDPROC
ENDMODULE
MODULE MainModule
CONST robtarget home:=[[197.08,354.50,296.60],[0.0438683,-0.494626,0.867878,0.0144155],[0,1,-1,4],[120.897,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget shirt:=[[447.31,123.91,132.17],[0.0185459,0.392416,0.9116,-0.121042],[-1,2,0,4],[131.126,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftshirt:=[[160.55,197.25,252.37],[0.0167024,-0.37432,-0.92537,0.0574181],[0,2,0,4],[141.907,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget cd:=[[429.87,322.22,213.23],[0.0259492,-0.676393,-0.735668,0.0247397],[-1,1,1,4],[130.133,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftcd1:=[[-87.34,255.90,239.55],[0.0729193,-0.839271,0.534115,0.0709135],[0,2,-1,4],[91.9038,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftcd2:=[[560.51,250.68,457.37],[0.276236,0.513235,0.810863,-0.0527657],[-1,1,0,4],[174.245,9E+09,9E+09,9E+09,9E+09,9E+09]];
PERS bool block2:=FALSE;
PERS bool L_yumi2bool:=FALSE;
VAR syncident sync1;
VAR syncident sync2;
VAR syncident sync3;
PERS tasks tasklist1{2}:=[["T_ROB_L"], ["T_ROB_R"]];
PROC syncmove()
SyncMoveOn sync1, tasklist1;
MoveL liftshirt \ID:=10, v200, fine, tool0;
SyncMoveOff sync2;
UNDO
SyncMoveUndo;
ENDPROC
PROC main()
g_Init \maxSpd:=10 \holdForce:=20 \Calibrate;
g_SetForce 20;
g_SetMaxSpd 10;
g_GripOut;
MoveJ home, v500, z50, tool0;
MoveJ Offs(shirt, 0, 0, 100), v500, z50, tool0;
MoveL shirt, v200, z50, tool0;
g_GripIn \holdForce:=20;
syncmove;
g_GripOut;
MoveJ Offs(cd, 0, 0, 100), v200, z50, tool0;
MoveL cd, v100, z50, tool0;
g_GripIn\holdForce:=20;
MoveL Offs(cd, 0, 0, 100), v200, z50, tool0;
FOR i FROM 1 TO 3 DO
MoveJ liftcd2, v300, z50, tool0;
WaitTime(0.5);
MoveL Offs(cd, 0, 0, 100), v300, z50, tool0;
WaitTime(0.5);
ENDFOR
MoveJ cd, v100, z50, tool0;
g_GripOut;
MoveL Offs(cd, 0, 0, 100), v200, z50, tool0;
MoveJ home, v500, z50, tool0;
ENDPROC
ENDMODULE
RRR
MODULE MainModule
CONST robtarget home:=[[132.32,-292.29,279.71],[0.075835,0.990885,-0.109632,0.0194362],[0,-2,-2,4],[-110.68,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget shirt:=[[342.27,-170.59,134.28],[0.0631174,0.98789,-0.135409,0.0418875],[1,-2,-1,4],[-161.922,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget liftshirt:=[[122.30,-100.58,216.23],[0.0042691,0.937309,-0.316999,-0.144724],[0,-2,-1,4],[-126.571,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget horns1:=[[177.13,-396.29,637.01],[0.761025,-0.148952,0.120783,-0.61973],[1,-1,-1,4],[-176.716,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget horns2:=[[289.64,-349.58,508.70],[0.625292,-0.46516,0.341906,-0.525106],[1,-1,-1,4],[-135.629,9E+09,9E+09,9E+09,9E+09,9E+09]];
PERS bool block2:=FALSE;
PERS bool L_yumi2bool:=FALSE;
VAR syncident sync1;
VAR syncident sync2;
VAR syncident sync3;
PERS tasks tasklist1{2}:=[["T_ROB_L"], ["T_ROB_R"]];
PROC syncmove()
SyncMoveOn sync1, tasklist1;
MoveL liftshirt \ID:=10, v200, fine, tool0;
SyncMoveOff sync2;
UNDO
SyncMoveUndo;
ENDPROC
PROC main()
g_Init \maxSpd:=10 \holdForce:=10 \Calibrate;
g_SetForce 10;
g_SetMaxSpd 10;
g_GripOut;
MoveJ home, v500, z50, tool0;
MoveJ Offs(shirt, 0, 0, 100), v500, z50, tool0;
MoveL shirt, v200, z50, tool0;
g_GripIn;
syncmove;
g_GripOut;
FOR i FROM 1 TO 10 DO
MoveJ horns1, v500, z50, tool0;
WaitTime(0.5);
MoveJ horns2, v500, z50, tool0;
WaitTime(0.5);
ENDFOR
MoveJ home, v500, z50, tool0;
ENDPROC
ENDMODULE
import socket
Chost = '192.168.125.1'
Cport = 1025
c = socket.socket()
c.connect((Chost, Cport))
c.sendall(b'100')
data = c.recv(1024)
print (repr(data))
while True:
data = c.recv(1024)
print (repr(data))
if data == str('Done'):
c.close()
print ('Finished')
break
else:
c.sendall('Ok')
MODULE MainModule
CONST robtarget Pick_target:=[[-18.16,-791.23,766.70],[0.847293,0.0278708,-0.00170491,-0.530391],[-2,0,-1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Place_target:=[[17.22,-455.15,756.11],[0.995917,0.0224285,0.0270788,-0.0831465],[-1,0,-1,1],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Home :=[[-564.28,76.46,837.02],[0.506659,-0.487527,0.514093,0.491246],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
VAR robtarget Coin;
VAR robtarget Deposit;
VAR socketdev server_socket;
VAR socketdev client_socket;
VAR socketdev conf_socket;
VAR string client_ip;
VAR num process;
VAR string PRB;
VAR string COB;
VAR pos coinL;
VAR bool ok;
PROC main()
coinL := [0,0,0];
SocketCreate server_socket;
SocketBind server_socket, "192.168.125.1", 1025;
SocketListen server_socket;
WHILE TRUE DO
SocketAccept server_socket, client_socket \ClientAddress:=client_ip;
SocketReceive client_socket \Str:=PRB;
SocketSend client_socket \Str:=PRB;
ok := StrToVal(PRB, process);
SocketReceive client_socket \Str:=COB;
SocketSend client_socket \Str:=COB;
ok := StrToVal(COB, coinL);
IF process = 1 THEN
Coin := offs(Pick_target,-coinL.x, -coinL.y, 0);