Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
omniwheels_x4_soccer_goal
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
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fischertechnik examples
TOY Robotics Hightech
omniwheels_x4_soccer_goal
Commits
6f134364
Commit
6f134364
authored
3 years ago
by
ft-Demo
Browse files
Options
Downloads
Patches
Plain Diff
commit by robo pro coding
parent
4119e5a4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
omniwheels_x4_soccer_goal.blockly
+107
-47
107 additions, 47 deletions
omniwheels_x4_soccer_goal.blockly
omniwheels_x4_soccer_goal.py
+13
-13
13 additions, 13 deletions
omniwheels_x4_soccer_goal.py
with
120 additions
and
60 deletions
omniwheels_x4_soccer_goal.blockly
+
107
−
47
View file @
6f134364
This diff is collapsed.
Click to expand it.
omniwheels_x4_soccer_goal.py
+
13
−
13
View file @
6f134364
...
...
@@ -215,9 +215,9 @@ def search_ball_rot(v):
right_v
(
v
)
def
turn
Ball
Left
():
def
turn
Side
Left
():
global
v
,
ticks
,
factor_x
,
ts_ball
,
ts_goal_left
,
ts_goal_right
,
cmd
,
factor_y
,
posx_ball
,
counters
,
factor_ball_rot
,
posy_ball
,
posx_goal
,
search_dir_left
,
v_slow
,
x_min
,
v_var_ball_xpos
,
x_max
,
v_var_ball_ypos
,
y_ball_far
,
y_ball_near
,
y_ball_touch
,
v_fast
,
goal_width
,
pos_goal_both
,
state
cmd
=
'
turn
Ball
Left
'
cmd
=
'
turn
Side
Left
'
TXT_M_M1_encodermotor
.
set_speed
(
int
(
v_slow
),
Motor
.
CCW
)
TXT_M_M2_encodermotor
.
set_speed
(
int
(
v_slow
),
Motor
.
CW
)
TXT_M_M1_encodermotor
.
start_sync
(
TXT_M_M2_encodermotor
)
...
...
@@ -226,9 +226,9 @@ def turnBallLeft():
TXT_M_M3_encodermotor
.
start_sync
(
TXT_M_M4_encodermotor
)
def
turn
Ball
Right
():
def
turn
Side
Right
():
global
v
,
ticks
,
factor_x
,
ts_ball
,
ts_goal_left
,
ts_goal_right
,
cmd
,
factor_y
,
posx_ball
,
counters
,
factor_ball_rot
,
posy_ball
,
posx_goal
,
search_dir_left
,
v_slow
,
x_min
,
v_var_ball_xpos
,
x_max
,
v_var_ball_ypos
,
y_ball_far
,
y_ball_near
,
y_ball_touch
,
v_fast
,
goal_width
,
pos_goal_both
,
state
cmd
=
'
turn
Ball
Right
'
cmd
=
'
turn
Side
Right
'
TXT_M_M1_encodermotor
.
set_speed
(
int
(
v_slow
),
Motor
.
CW
)
TXT_M_M2_encodermotor
.
set_speed
(
int
(
v_slow
),
Motor
.
CCW
)
TXT_M_M1_encodermotor
.
start_sync
(
TXT_M_M2_encodermotor
)
...
...
@@ -379,7 +379,7 @@ while True:
elif
posy_ball
>
y_ball_far
and
posy_ball
<=
y_ball_near
:
fwd_v
(
v_slow
)
elif
posy_ball
>
y_ball_near
and
posy_ball
<=
y_ball_touch
:
turn
Ball
Left
()
turn
Side
Left
()
elif
posy_ball
<=
y_ball_touch
:
bwd_v
(
v_slow
)
else
:
...
...
@@ -396,9 +396,9 @@ while True:
fwd_v
(
v_slow
)
elif
posy_ball
<=
y_ball_near
:
if
posx_goal
[
0
]
<
posx_ball
:
turn
Ball
Right
()
turn
Side
Right
()
elif
posx_goal
[
0
]
>
posx_ball
:
turn
Ball
Left
()
turn
Side
Left
()
else
:
stop
()
elif
posy_ball
<=
y_ball_touch
:
...
...
@@ -411,9 +411,9 @@ while True:
fwd_v
(
v_slow
)
elif
posy_ball
<=
y_ball_near
:
if
posx_goal
[
1
]
<
posx_ball
:
turn
Ball
Right
()
turn
Side
Right
()
elif
posx_goal
[
1
]
>
posx_ball
:
turn
Ball
Left
()
turn
Side
Left
()
else
:
stop
()
elif
posy_ball
<=
y_ball_touch
:
...
...
@@ -428,9 +428,9 @@ while True:
if
posx_ball
>
posx_goal
[
0
]
and
posx_ball
<
posx_goal
[
1
]:
fwd_v
(
v_slow
)
elif
posx_ball
<
posx_goal
[
0
]
and
posx_ball
<
posx_goal
[
1
]:
turn
Ball
Left
()
turn
Side
Left
()
elif
posx_ball
>
posx_goal
[
0
]
and
posx_ball
>
posx_goal
[
1
]:
turn
Ball
Right
()
turn
Side
Right
()
else
:
stop
()
elif
posy_ball
<=
y_ball_touch
:
...
...
@@ -444,9 +444,9 @@ while True:
if
pos_goal_both
>=
x_min
and
pos_goal_both
<=
x_max
:
fwd_v
(
v_slow
)
elif
pos_goal_both
<
x_min
:
left
_v
(
v_slow
)
left
(
v_var_ball_xpos
,
min
(
max
(
goal_width
*
factor_ball_rot
,
3
),
100
)
)
elif
pos_goal_both
>
x_max
:
right
_v
(
v_slow
)
right
(
v_var_ball_xpos
,
min
(
max
(
goal_width
*
factor_ball_rot
,
3
),
100
)
)
else
:
stop
()
elif
(
posx_ball
==
None
or
posy_ball
==
None
)
and
(
posx_goal
[
0
]
!=
None
or
posx_goal
[
1
]
==
None
):
...
...
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