Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RoboMission_line_demo
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
STEM Coding RoboMission
RoboMission_line_demo
Commits
961b6997
Commit
961b6997
authored
3 weeks ago
by
ft-Demo
Browse files
Options
Downloads
Patches
Plain Diff
commit by robo pro coding
parent
473095c1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
RoboMission_line_demo.blockly
+16
-7
16 additions, 7 deletions
RoboMission_line_demo.blockly
RoboMission_line_demo.py
+3
-2
3 additions, 2 deletions
RoboMission_line_demo.py
lib/line.blockly
+2
-2
2 additions, 2 deletions
lib/line.blockly
lib/line.py
+2
-2
2 additions, 2 deletions
lib/line.py
with
23 additions
and
13 deletions
RoboMission_line_demo.blockly
+
16
−
7
View file @
961b6997
...
...
@@ -40,10 +40,19 @@
<field name="name">read_line_sensors</field>
<data>{"id":"!4|dT?1`M`4]w*0P23*;","filename":"lib/line.py"}</data>
<next>
<block type="import_function_noreturn" id="?r5]N,v_e^w/4]vYi}g,">
<mutation parentId="xo$T:J:?9]BOpX(6C*Np" parentFilename="lib/line.py"/>
<field name="name">print_line_info</field>
<data>{"id":"xo$T:J:?9]BOpX(6C*Np","filename":"lib/line.py"}</data>
<block type="controls_if" id="^pS1dfv]6Ja#h~4ew:uw">
<value name="IF0">
<block type="logic_boolean" id="MopX:+1n6kKMIDSYUnes">
<field name="BOOL">FALSE</field>
</block>
</value>
<statement name="DO0">
<block type="import_function_noreturn" id="?r5]N,v_e^w/4]vYi}g,">
<mutation parentId="xo$T:J:?9]BOpX(6C*Np" parentFilename="lib/line.py"/>
<field name="name">print_line_info</field>
<data>{"id":"xo$T:J:?9]BOpX(6C*Np","filename":"lib/line.py"}</data>
</block>
</statement>
<next>
<block type="controls_if" id="=|@=3O|)YL)3oiQO:%HK">
<mutation elseif="1" else="1"/>
...
...
@@ -132,7 +141,7 @@
</value>
<value name="speed_rotate">
<block type="math_number" id="xYweH`]c4}--J.I#]CA}">
<field name="NUM">
4
50</field>
<field name="NUM">5
0
0</field>
</block>
</value>
</block>
...
...
@@ -158,7 +167,7 @@
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="([,q3;KDt25p^%ZYwL4r" x="0" y="7
37
">
<block type="procedures_defnoreturn" id="([,q3;KDt25p^%ZYwL4r" x="0" y="7
80
">
<field name="NAME">thread_display_update</field>
<statement name="STACK">
<block type="display_set_button_enabled" id="R+*qC2@{F,.u[/yT_|/o">
...
...
@@ -275,7 +284,7 @@
</block>
</statement>
</block>
<block type="display_on_button_clicked" id="h9NEZ1yTj+pDceca-h/n" x="0" y="11
23
">
<block type="display_on_button_clicked" id="h9NEZ1yTj+pDceca-h/n" x="0" y="11
66
">
<field name="instance_name">txt_button_start</field>
<statement name="statement">
<block type="variables_set" id="Z8*_J+Em!H4iE==YSjZ#">
...
...
This diff is collapsed.
Click to expand it.
RoboMission_line_demo.py
+
3
−
2
View file @
961b6997
...
...
@@ -39,7 +39,8 @@ while True:
calib_line_rotate360
()
while
True
:
read_line_sensors
()
print_line_info
()
if
False
:
print_line_info
()
if
is_white
():
TXT_M_M1_encodermotor
.
set_speed
(
int
(
512
),
Motor
.
CCW
)
TXT_M_M2_encodermotor
.
set_speed
(
int
(
512
),
Motor
.
CW
)
...
...
@@ -57,6 +58,6 @@ while True:
break
time
.
sleep
(
0.010
)
else
:
success
=
follow_line_step
(
512
,
4
50
)
success
=
follow_line_step
(
512
,
5
0
0
)
This diff is collapsed.
Click to expand it.
lib/line.blockly
+
2
−
2
View file @
961b6997
...
...
@@ -562,7 +562,7 @@
<field name="direction_0">Motor.CCW</field>
<value name="speed">
<shadow type="motor_number" id="nXG]b0Q3T(XdH]t44j(J">
<field name="MOTOR_NUM">1
1
0</field>
<field name="MOTOR_NUM">1
5
0</field>
</shadow>
</value>
</block>
...
...
@@ -590,7 +590,7 @@
<field name="direction_0">Motor.CCW</field>
<value name="speed">
<shadow type="motor_number" id="|@bpzGZ*8qr@j1,hb=51">
<field name="MOTOR_NUM">1
1
0</field>
<field name="MOTOR_NUM">1
5
0</field>
</shadow>
</value>
<next>
...
...
This diff is collapsed.
Click to expand it.
lib/line.py
+
2
−
2
View file @
961b6997
...
...
@@ -63,10 +63,10 @@ def follow_line_step(speed_fwd, speed_rotate):
elif
line
<
50
:
TXT_M_M1_encodermotor
.
set_speed
(
int
(
speed_rotate
),
Motor
.
CCW
)
TXT_M_M1_encodermotor
.
start_sync
()
TXT_M_M2_encodermotor
.
set_speed
(
int
(
1
1
0
),
Motor
.
CCW
)
TXT_M_M2_encodermotor
.
set_speed
(
int
(
1
5
0
),
Motor
.
CCW
)
TXT_M_M2_encodermotor
.
start_sync
()
elif
line
>
-
50
:
TXT_M_M1_encodermotor
.
set_speed
(
int
(
1
1
0
),
Motor
.
CCW
)
TXT_M_M1_encodermotor
.
set_speed
(
int
(
1
5
0
),
Motor
.
CCW
)
TXT_M_M1_encodermotor
.
start_sync
()
TXT_M_M2_encodermotor
.
set_speed
(
int
(
speed_rotate
),
Motor
.
CCW
)
TXT_M_M2_encodermotor
.
start_sync
()
...
...
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