Skip to content

Commit 8f6a1cc

Browse files
committed
Add lecture 08
1 parent 9ba1756 commit 8f6a1cc

28 files changed

+816
-1
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This PhD-level course introduces digital fabrication methods and tools building
1515
| 05 | 30.03. | **Path planning**<br>Cartesian and kinematic path planning using MoveIt.<br>Planning scene operations. End effectors and discrete build elements.<br>👉[Go to lecture](lecture_05/README.md) | GKR (RR, GC) |
1616
| 06 | 06.04. | **Assembly of discrete elements I**<br>Brief introduction to directed acyclic graphs. Modelling assembly processes as DAGs. Reachability Maps.<br>👉[Go to lecture](lecture_06/README.md) | GKR (RR, GC) |
1717
| 07 | 13.04. | **Assembly of discrete elements II**<br>Applied exercise from design to planning fabrication for an assembly of discrete elements and preparation for control exercise.<br>👉[Go to lecture](lecture_07/README.md) | GKR (RR, GC) |
18-
| 08 | 27.04. | **Robot control with COMPAS RRC**<br>Online non-real time control of industrial robots. Components of an RRC deployment. Communication primitives (blocking, futures, cyclic). Instructions. Multi controller & location coordination.<br> | GKR (RR, GC) |
18+
| 08 | 27.04. | **Robot control with COMPAS RRC**<br>Online non-real time control of industrial robots. Components of an RRC deployment. Communication primitives (blocking, futures, cyclic). Instructions. Multi controller & location coordination.<br>👉[Go to lecture](lecture_08/README.md) | GKR (RR, GC) |
1919
| 09 | 04.05. | **Assembly of discrete elements III**<br>Continued applied exercise from planning data to robot control for an assembly of discrete elements.<br> | GKR (RR, GC) |
2020
| 10 | 11.05. | **COMPAS SLICER: Basics**<br>Introduction to COMPAS SLICER (presentation).<br>Planar slicing of simple geometry<br>Introducion to scalar field slicing.<br> | DBT & GKR (IM, JB) |
2121
| 11 | 18.05. | **COMPAS SLICER: Advanced**<br>Introduction to non-planar slicing.<br>Non-planar slicing of a geometry.<br>Simulation and planning of robotic motion with COMPAS RRC.<br> | DBT & GKR (IM, JB) |

Diff for: docker/moveit-rrc-noetic/docker-compose.yml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
version: '2'
2+
services:
3+
rrc-driver:
4+
image: gramaziokohler/ros-noetic-dfab
5+
container_name: rrc-driver
6+
environment:
7+
- ROS_HOSTNAME=rrc-driver
8+
- ROS_MASTER_URI=http://ros-core:11311
9+
depends_on:
10+
- ros-core
11+
command:
12+
- roslaunch
13+
- --wait
14+
- compas_rrc_driver
15+
- bringup.launch
16+
- robot_ip:=host.docker.internal
17+
- robot_streaming_port:=30101
18+
- robot_state_port:=30201
19+
- namespace:=rob1
20+
21+
moveit-service:
22+
image: gramaziokohler/ros-noetic-dfab
23+
container_name: moveit-service
24+
environment:
25+
- ROS_HOSTNAME=moveit-service
26+
- ROS_MASTER_URI=http://ros-core:11311
27+
# GUI: To forward the GUI to an external X11 server (eg. XMing), uncomment the following line
28+
# - DISPLAY=host.docker.internal:0.0
29+
depends_on:
30+
- ros-core
31+
command:
32+
- roslaunch
33+
- --wait
34+
# To change the robot, select the corresponding package name here, eg. `ur10e_moveit_config`
35+
- abb_irb4600_40_255_moveit_config
36+
- demo.launch
37+
# To launch the RVIZ GUI, change the following to true
38+
- use_rviz:=false
39+
- pipeline:=ompl
40+
41+
ros-core:
42+
image: gramaziokohler/ros-noetic-dfab
43+
container_name: ros-core
44+
ports:
45+
- "11311:11311"
46+
command:
47+
- roscore
48+
49+
ros-bridge:
50+
image: gramaziokohler/ros-noetic-dfab
51+
container_name: ros-bridge
52+
environment:
53+
- "ROS_HOSTNAME=ros-bridge"
54+
- "ROS_MASTER_URI=http://ros-core:11311"
55+
ports:
56+
- "9090:9090"
57+
depends_on:
58+
- ros-core
59+
command:
60+
- roslaunch
61+
- --wait
62+
- rosbridge_server
63+
- rosbridge_websocket.launch
64+
65+
ros-fileserver:
66+
image: gramaziokohler/ros-noetic-dfab
67+
container_name: ros-fileserver
68+
environment:
69+
- ROS_HOSTNAME=ros-fileserver
70+
- ROS_MASTER_URI=http://ros-core:11311
71+
depends_on:
72+
- ros-core
73+
command:
74+
- roslaunch
75+
- --wait
76+
- file_server
77+
- file_server.launch

Diff for: lecture_08/701_hello_world.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
done = abb.send_and_wait(rrc.PrintText("Welcome to COMPAS_RRC"))
15+
16+
# Print feedback
17+
print("Feedback = ", done)
18+
19+
# End of Code
20+
print("Finished")
21+
22+
# Close client
23+
ros.close()

Diff for: lecture_08/702_send.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
# Send an instruction without waiting for any kind of feedback
14+
abb.send(rrc.PrintText("Hello."))
15+
16+
# End of Code
17+
print("Finished")
18+
19+
# Close client
20+
ros.close()

Diff for: lecture_08/703_send_and_wait.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
# Send and wait
14+
done = abb.send_and_wait(
15+
rrc.PrintText("Send instructions to the robot and wait for feedack.")
16+
)
17+
18+
# Print feedback
19+
print("Feedback = ", done)
20+
21+
# End of Code
22+
print("Finished")
23+
24+
# Close client
25+
ros.close()

Diff for: lecture_08/704_send_and_wait_in_the_future.py

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
# Send and defer waiting
14+
future = abb.send(
15+
rrc.PrintText(
16+
"Send instructions to the robot and check the feedack later.",
17+
feedback_level=rrc.FeedbackLevel.DONE,
18+
)
19+
)
20+
21+
# Here you can execute other operations
22+
print("Execute other code.")
23+
24+
# Wait for feedback
25+
done = future.result(timeout=3.0)
26+
27+
# Print feedback
28+
print("Feedback = ", done)
29+
30+
# End of Code
31+
print("Finished")
32+
33+
# Close client
34+
ros.close()

Diff for: lecture_08/705_set_tool.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
# Set tool
14+
done = abb.send_and_wait(rrc.SetTool("tool0"))
15+
16+
# Print feedback
17+
print("Feedback = ", done)
18+
19+
# End of Code
20+
print("Finished")
21+
22+
# Close client
23+
ros.close()

Diff for: lecture_08/706_set_work_object.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
# Set work object
14+
done = abb.send_and_wait(rrc.SetWorkObject("wobj0"))
15+
16+
# Print feedback
17+
print("Feedback = ", done)
18+
19+
# End of Code
20+
print("Finished")
21+
22+
# Close client
23+
ros.close()

Diff for: lecture_08/707_set_acceleration.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
# Set acceleration
14+
acc = 100 # Unit [%]
15+
ramp = 100 # Unit [%]
16+
done = abb.send_and_wait(rrc.SetAcceleration(acc, ramp))
17+
18+
# Print feedback
19+
print("Feedback = ", done)
20+
21+
# End of Code
22+
print("Finished")
23+
24+
# Close client
25+
ros.close()

Diff for: lecture_08/708_set_max_speed.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
# Set max speed
14+
override = 100 # Unit [%]
15+
max_tcp = 2500 # Unit [mm/s]
16+
done = abb.send_and_wait(rrc.SetMaxSpeed(override, max_tcp))
17+
18+
# Print feedback
19+
print("Feedback = ", done)
20+
21+
# End of Code
22+
print("Finished")
23+
24+
# Close client
25+
ros.close()

Diff for: lecture_08/709_get_and_move_to_frames.py

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
# Set tool
14+
abb.send(rrc.SetTool("tool0"))
15+
16+
# Set work object
17+
abb.send(rrc.SetWorkObject("wobj0"))
18+
19+
# Read current frame position
20+
frame = abb.send_and_wait(rrc.GetFrame())
21+
22+
# Print received values
23+
print(repr(frame))
24+
25+
# Change a X axis (in millimiters)
26+
frame.point[0] -= 50
27+
28+
# Set speed [mm/s]
29+
speed = 100
30+
31+
# Move robot the new pos
32+
done = abb.send_and_wait(
33+
rrc.MoveToFrame(frame, speed, rrc.Zone.FINE, rrc.Motion.LINEAR)
34+
)
35+
36+
# Print feedback
37+
print("Feedback = ", done)
38+
39+
# End of Code
40+
print("Finished")
41+
42+
# Close client
43+
ros.close()

Diff for: lecture_08/710_get_and_move_to_joints.py

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
# Read value of joints
14+
robot_joints, external_axes = abb.send_and_wait(rrc.GetJoints())
15+
16+
# Print received values
17+
print(robot_joints, external_axes)
18+
19+
# Change a joint value [°]
20+
robot_joints.rax_1 += 15
21+
22+
# Set speed [mm/s]
23+
speed = 100
24+
25+
# Move robot the new pos
26+
done = abb.send_and_wait(
27+
rrc.MoveToJoints(robot_joints, external_axes, speed, rrc.Zone.FINE)
28+
)
29+
30+
# Print feedback
31+
print("Feedback = ", done)
32+
33+
# End of Code
34+
print("Finished")
35+
36+
# Close client
37+
ros.close()

0 commit comments

Comments
 (0)