Software
The software utilize Fibre to communicate with robot arm.
There are several command mode which you can choose from:
- Evaluate Kernel
- Paint Image
- Draw Outline
- Run Script
- Command Line Interface
For most the cases, we only need the last two command mode. The first three types are created specifically for sand painting.
Commander software
Commander software can be found here: https://github.com/Kevin75311/Sand_Art
The commander software was writen in python.
Structure
- Evaluate Kernel (E)
- Paint Image (P)
- Draw Outline (D)
- Run Script (R)
- Command Line Interface (C)
System Architecture:
Sand Painting
|
|-> main
| |-> KernelEvaluator (E)
| |-> SandArtRenderer (P, D)
| |-> RobotCommander (R, C)
|
-----------------------------------------------------------------------------------------------------------------------------------------------------
| | |
|-> KernelEvaluator |-> SandArtRenderer(open-loop/closed-loop, image_path, canvas_path) |-> ImageSegmenter
| | |-> AreaTree
|-> Camera |-> Camera |-> ImageInpainter
|-> Kernel |-> ImageProcessor |-> AreaClassifier
|-> RobotCommander | |-> ImageSegmenter |-> PathPlanner
|
|-> Compensator: closed-loop condition
| |-> ImageSegmenter
|
|-> RobotCommander
How to run / Install
- The commander environment is based on Python 3.8.0
- First clone or download https://github.com/Kevin75311/Sand_Art
- Install all dependencies through
pip install -r ./requirements.txt- There might be some packages that are not listed in the requirements, just manually install them
- Run the entry main pyton
python ./src/main.py
Run script
for i in track(range(len(commands)), description="Executing script..."):
command = commands[i]
if command.find("wait") != -1:
time.sleep(1)
elif command.find("open") != -1:
console.runcode("dummy0.robot.move_ee(-120)")
time.sleep(1.5)
elif command.find("close") != -1:
init_point = True
console.runcode("dummy0.robot.move_ee(0)")
time.sleep(1.5)
else:
console.runcode(command)
if init_point:
console.runcode(command)
time.sleep(6)
init_point = False
else:
# moving command
console.runcode(command)
x_curr = float(((command.split(","))[0]).split("(")[1])
y_curr = float(command.split(",")[1])
wait_time = math.sqrt((x_curr - x_past)**2 + (y_curr - y_past)**2) / (self.speed * self.time_factor)
time.sleep(wait_time)
x_past = x_curr
y_past = y_curr