Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
TicTacToe-Robot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lukas Hoffleit
TicTacToe-Robot
Commits
10d3ac3d
Commit
10d3ac3d
authored
1 month ago
by
Lukas Hoffleit
Browse files
Options
Downloads
Patches
Plain Diff
Farben und Pick-Place angepasst and neue nupsis
parent
b9e2bb83
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
robot_utils.py
+22
-16
22 additions, 16 deletions
robot_utils.py
tictactoe.py
+2
-2
2 additions, 2 deletions
tictactoe.py
with
24 additions
and
18 deletions
robot_utils.py
+
22
−
16
View file @
10d3ac3d
import
phantomController
as
pc
import
time
import
traceback
PICK_HIGHT
=
1
5
PICK_HIGHT
=
1
0
LIFT_HIGHT
=
100
GRIP_OPEN
=
511
GRIP_CLOSED
=
400
GRIP_CLOSED
=
380
MOVE_SPEED
=
800
class
RobotError
(
Exception
):
"""
Error during Robot Move
"""
...
...
@@ -23,19 +24,19 @@ class RobotUtils():
def
pick_place
(
self
,
start
,
finish
)
->
None
:
start
.
extend
([
LIFT_HIGHT
,
0
,
0
,
-
1
])
self
.
move_to_pose
(
start
,
GRIP_OPEN
,
1000
)
self
.
move_to_pose
(
start
,
GRIP_OPEN
,
MOVE_SPEED
)
start
[
2
]
=
PICK_HIGHT
self
.
move_to_pose
(
start
,
GRIP_OPEN
,
1000
)
self
.
move_to_pose
(
start
,
GRIP_CLOSED
,
1000
)
self
.
move_to_pose
(
start
,
GRIP_OPEN
,
MOVE_SPEED
)
self
.
move_to_pose
(
start
,
GRIP_CLOSED
,
MOVE_SPEED
)
start
[
2
]
=
LIFT_HIGHT
self
.
move_to_pose
(
start
,
GRIP_CLOSED
,
1000
)
self
.
move_to_pose
(
start
,
GRIP_CLOSED
,
MOVE_SPEED
)
finish
.
extend
([
LIFT_HIGHT
,
0
,
0
,
-
1
])
self
.
move_to_pose
(
finish
,
GRIP_CLOSED
,
1000
)
self
.
move_to_pose
(
finish
,
GRIP_CLOSED
,
MOVE_SPEED
)
finish
[
2
]
=
PICK_HIGHT
self
.
move_to_pose
(
finish
,
GRIP_CLOSED
,
1000
)
self
.
move_to_pose
(
finish
,
GRIP_OPEN
,
1000
)
self
.
move_to_pose
(
finish
,
GRIP_CLOSED
,
MOVE_SPEED
)
self
.
move_to_pose
(
finish
,
GRIP_OPEN
,
MOVE_SPEED
)
finish
[
2
]
=
LIFT_HIGHT
self
.
move_to_pose
(
finish
,
GRIP_OPEN
,
1000
)
self
.
move_to_pose
(
finish
,
GRIP_OPEN
,
MOVE_SPEED
)
def
disconnect
(
self
)
->
None
:
pc
.
sleep
(
self
.
ser
)
...
...
@@ -44,12 +45,17 @@ class RobotUtils():
if
__name__
==
"
__main__
"
:
robot
=
RobotUtils
()
try
:
robot
.
pick_place
([
130
,
120
],
[
50
,
120
])
robot
.
disconnect
()
except
:
print
(
traceback
.
format_exc
())
while
True
:
robot
.
pick_place
([
130
,
0
],
[
0
,
130
])
robot
.
disconnect
()
#robot.move_to_pose([40, 250, 20, 0, 0, -1], 511, 1000)
#robot.disconnect()
#try:
# robot.pick_place([130, 120], [50, 120])
# robot.disconnect()
#except:
# print(traceback.format_exc())
# robot.disconnect()
This diff is collapsed.
Click to expand it.
tictactoe.py
+
2
−
2
View file @
10d3ac3d
...
...
@@ -14,8 +14,8 @@ SYMBOLS = {
Player
.
undefined
:
"
"
}
COLORS
=
{
Player
.
one
:
"
\033
[
32
m
"
,
# green
Player
.
two
:
"
\033
[
94
m
"
,
#
blue
Player
.
one
:
"
\033
[
91
m
"
,
# green
Player
.
two
:
"
\033
[
32
m
"
,
#
green
Player
.
undefined
:
""
}
END_COLOR
=
"
\033
[0m
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment