Skip to content

Commit 4b831ac

Browse files
committed
first structure done
1 parent cd41075 commit 4b831ac

File tree

75 files changed

+424
-329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+424
-329
lines changed

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.pythonPath": "C:\\Users\\fleischp\\anaconda3\\envs\\compas_rrc_dev\\python.exe"
3+
}

Compas_RRC_Course.rspag

-2.21 MB
Binary file not shown.

Python/00_welcome.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import compas_rrc as rrc
2+
3+
if __name__ == '__main__':
4+
5+
# Create Ros Client
6+
ros = rrc.RosClient()
7+
ros.run()
8+
9+
# Create ABB Client
10+
abb = rrc.AbbClient(ros, '/rob1')
11+
print('Connected.')
12+
13+
# Print text on FlexPenant
14+
result = abb.send_and_wait(rrc.PrintText('Welcome to COMPAS_RRC'))
15+
print(result)
16+
17+
# End of Code
18+
print('Finished')
19+
20+
# Close client
21+
ros.close()
22+
ros.terminate()
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
from compas_rrc import *
2-
from compas_fab.backends.ros import RosClient
3-
4-
if __name__ == '__main__':
5-
6-
# Create Ros Client
7-
ros = RosClient()
8-
ros.run()
9-
10-
# Create ABB Client
11-
abb = AbbClient(ros, '/rob1')
12-
print('Connected.')
13-
14-
# Test compas_rrc
15-
result = abb.send_and_wait(PrintText('Welcome to COMPAS_RRC'))
16-
print(result)
17-
18-
# End of Code
19-
print('Finished')
20-
21-
# Close client
22-
ros.close()
23-
ros.terminate()
1+
import compas_rrc as rrc
2+
from compas_fab.backends import RosClient
3+
4+
if __name__ == '__main__':
5+
6+
# Create Ros Client
7+
ros = RosClient()
8+
ros.run()
9+
10+
# Create ABB Client
11+
abb = rrc.AbbClient(ros, '/rob1')
12+
print('Connected.')
13+
14+
# Print text on FlexPenant
15+
result = abb.send_and_wait(rrc.PrintText('Welcome to COMPAS_RRC'))
16+
print(result)
17+
18+
# End of Code
19+
print('Finished')
20+
21+
# Close client
22+
ros.close()
23+
ros.terminate()
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
from compas_rrc import *
2-
from compas_fab.backends.ros import RosClient
3-
4-
if __name__ == '__main__':
5-
6-
# Create Ros Client
7-
ros = RosClient()
8-
ros.run()
9-
10-
# Create ABB Client
11-
abb = AbbClient(ros, '/rob1')
12-
print('Connected.')
13-
14-
# Set tool
15-
done = abb.send_and_wait(SetTool('tool0'))
16-
17-
# Set work object
18-
done = abb.send_and_wait(SetWorkObject('wobj0'))
19-
20-
# Set acceleration
21-
acc = 100 # Unit [%]
22-
ramp = 100 # Unit [%]
23-
done = abb.send_and_wait(SetAcceleration(acc, ramp))
24-
25-
# Set max speed
26-
override = 100 # Unit [%]
27-
max_tcp = 2500 # Unit [mm/s]
28-
done = abb.send_and_wait(SetMaxSpeed(override, max_tcp))
29-
30-
# End of Code
31-
print('Finished')
32-
33-
# Close client
34-
ros.close()
35-
ros.terminate()
1+
import compas_rrc as rrc
2+
from compas_fab.backends import RosClient
3+
4+
if __name__ == '__main__':
5+
6+
# Create Ros Client
7+
ros = RosClient()
8+
ros.run()
9+
10+
# Create ABB Client
11+
abb = rrc.AbbClient(ros, '/rob1')
12+
print('Connected.')
13+
14+
# Set tool
15+
done = abb.send_and_wait(rrc.SetTool('tool0'))
16+
17+
# Set work object
18+
done = abb.send_and_wait(rrc.SetWorkObject('wobj0'))
19+
20+
# Set acceleration
21+
acc = 100 # Unit [%]
22+
ramp = 100 # Unit [%]
23+
done = abb.send_and_wait(rrc.SetAcceleration(acc, ramp))
24+
25+
# Set max speed
26+
override = 100 # Unit [%]
27+
max_tcp = 2500 # Unit [mm/s]
28+
done = abb.send_and_wait(rrc.SetMaxSpeed(override, max_tcp))
29+
30+
# End of Code
31+
print('Finished')
32+
33+
# Close client
34+
ros.close()
35+
ros.terminate()
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
1-
from compas_rrc import *
2-
from compas.geometry import Frame
3-
from compas_fab.backends.ros import RosClient
4-
5-
if __name__ == '__main__':
6-
7-
# Create Ros Client
8-
ros = RosClient()
9-
ros.run()
10-
11-
# Create ABB Client
12-
abb = AbbClient(ros, '/rob1')
13-
print('Connected.')
14-
15-
# Switches for Code
16-
on = True
17-
off = False
18-
19-
# Get and move to joints
20-
if on:
21-
22-
# Get joints
23-
robot_joints, external_axes = abb.send_and_wait(GetJoints())
24-
25-
# Print received values
26-
print(robot_joints, external_axes)
27-
28-
# Change value and move to new position
29-
robot_joints.rax_1 += 15
30-
speed = 100 # Unit [mm/s]
31-
done = abb.send_and_wait(MoveToJoints(robot_joints, external_axes, speed, Zone.FINE))
32-
33-
# Get and move to frame
34-
if on:
35-
36-
# Get frame
37-
frame = abb.send_and_wait(GetFrame())
38-
39-
# Print received values
40-
print(frame)
41-
42-
# Change any frame value and move robot to new position
43-
frame.point[0] += 50
44-
speed = 100 # Unit [mm/s]
45-
done = abb.send_and_wait(MoveToFrame(frame, speed, Zone.FINE, Motion.LINEAR))
46-
47-
# Get and move to robtarget
48-
if on:
49-
50-
# Get frame and external axes
51-
frame, external_axes = abb.send_and_wait(GetRobtarget())
52-
53-
# Print received values
54-
print(frame, external_axes)
55-
56-
# Change any value and move to new position
57-
frame.point[0] += 50
58-
speed = 100 # Unit [mm/s]
59-
done = abb.send_and_wait(MoveToRobtarget(frame, external_axes, speed, Zone.FINE))
60-
61-
# Move robot to start position
62-
if on:
63-
64-
# Set start values
65-
robot_joints, external_axes =[0.0, -30, 0, 0, 30, 0], []
66-
67-
# Move robot to start position
68-
done = abb.send_and_wait(MoveToJoints(robot_joints, external_axes, 1000, Zone.FINE))
69-
70-
# End of Code
71-
print('Finished')
72-
73-
# Close client
74-
ros.close()
75-
ros.terminate()
76-
1+
import compas_rrc as rrc
2+
from compas.geometry import Frame
3+
from compas_fab.backends.ros import RosClient
4+
5+
if __name__ == '__main__':
6+
7+
# Create Ros Client
8+
ros = RosClient()
9+
ros.run()
10+
11+
# Create ABB Client
12+
abb = AbbClient(ros, '/rob1')
13+
print('Connected.')
14+
15+
# Switches for Code
16+
on = True
17+
off = False
18+
19+
# Get and move to joints
20+
if on:
21+
22+
# Get joints
23+
robot_joints, external_axes = abb.send_and_wait(GetJoints())
24+
25+
# Print received values
26+
print(robot_joints, external_axes)
27+
28+
# Change value and move to new position
29+
robot_joints.rax_1 += 15
30+
speed = 100 # Unit [mm/s]
31+
done = abb.send_and_wait(MoveToJoints(robot_joints, external_axes, speed, Zone.FINE))
32+
33+
# Get and move to frame
34+
if off:
35+
36+
# Get frame
37+
frame = abb.send_and_wait(GetFrame())
38+
39+
# Print received values
40+
print(frame)
41+
42+
# Change any frame value and move robot to new position
43+
frame.point[0] += 50
44+
speed = 100 # Unit [mm/s]
45+
done = abb.send_and_wait(MoveToFrame(frame, speed, Zone.FINE, Motion.LINEAR))
46+
47+
# Get and move to robtarget
48+
if off:
49+
50+
# Get frame and external axes
51+
frame, external_axes = abb.send_and_wait(GetRobtarget())
52+
53+
# Print received values
54+
print(frame, external_axes)
55+
56+
# Change any value and move to new position
57+
frame.point[0] += 50
58+
speed = 100 # Unit [mm/s]
59+
done = abb.send_and_wait(MoveToRobtarget(frame, external_axes, speed, Zone.FINE))
60+
61+
# Move robot to start position
62+
if off:
63+
64+
# Set start values
65+
robot_joints, external_axes =[0.0, -30, 0, 0, 30, 0], []
66+
67+
# Move robot to start position
68+
done = abb.send_and_wait(MoveToJoints(robot_joints, external_axes, 1000, Zone.FINE))
69+
70+
# End of Code
71+
print('Finished')
72+
73+
# Close client
74+
ros.close()
75+
ros.terminate()
76+

0 commit comments

Comments
 (0)