From b4e46b75f5e2a890b41d2e20a89767590e54ccb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=BDabkar?= Date: Tue, 15 Dec 2015 10:34:40 +0100 Subject: Dodani plani za robotske probleme. --- robot/problems/introduction/forward1m/sl.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'robot/problems/introduction/forward1m') diff --git a/robot/problems/introduction/forward1m/sl.py b/robot/problems/introduction/forward1m/sl.py index 8045d58..2240d3c 100644 --- a/robot/problems/introduction/forward1m/sl.py +++ b/robot/problems/introduction/forward1m/sl.py @@ -12,12 +12,22 @@ hint = { '''

robot.connect_motor( 'left' ).

'''], 'connectMotorRight':['''

Robotu priključi desni motor

''', '''

robot.connect_motor( 'right' ).

'''], - 'moveSteering':['''

Sinhroniziraj motorja in ju zaženi za 3 sekunde.

''', + 'moveSteering':['''

Sinhroniziraj motorja in ju zaženi.

''', '''

Za sinhronizirano vožnjo je najbolj primerna metoda robot.move_steering( ... ).

'''], 'onForRotations':['''

Prvi argument metode robot.move_steering naj pove, da bo delovanje motorjev določeno s številom obratov.

''', '''

robot.move_steering('on_for_rotations', ... ).

'''], 'direction':['''

Navedi smer premikanja motorjev, naravnost = 0.

''', '''

robot.move_steering( 'on_for_rotations', direction=0, ... ).

'''], - 'rotations':['''

Določi število obratov; za koliko obratov naj se zavrtita motorja? Izmeri dolžino 1m, izpisuj obrate print(robot.motor['left'].count_per_rot, robot.motor['right'].count_per_rot) in tako določi ustrezno število obratov.

''', + 'rotations':['''

Določi število obratov; za koliko obratov naj se zavrtita motorja? Izmeri obseg kolesa in preračunaj, koliko obratov je potrebnih za 1m.

''', '''

robot.move_steering( 'on_for_rotations', direction=0, rotations=5 ).

'''], } + +plan = ['''\ +

Program izvedemo v naslednjih korakih:

+
    +
  1. Naredimo objekt mindstorms_widgets(), s katerim predstavimo robota.
  2. +
  3. Nanj povežemo oba pogonska motorja.
  4. +
  5. Vklopimo oba motorja v sinhronem načinu tako, da robot vozi naravnost.
  6. +
  7. Glede na obseg koles izračunamo, koliko obratov mora narediti kolo na dolžini 1m; ustrezno nastavimo število obratov, po katerih se robot ustavi.
  8. +
''' +] -- cgit v1.2.1 From 0883cb2a6b0bac23bd7553618f4e8db7c882a757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=BDabkar?= Date: Tue, 15 Dec 2015 13:13:49 +0100 Subject: Popravki programov pred zagovorom projekta. --- robot/problems/introduction/forward1m/common.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'robot/problems/introduction/forward1m') diff --git a/robot/problems/introduction/forward1m/common.py b/robot/problems/introduction/forward1m/common.py index a8dd9ad..201a981 100644 --- a/robot/problems/introduction/forward1m/common.py +++ b/robot/problems/introduction/forward1m/common.py @@ -10,9 +10,6 @@ number = 2 visible = True solution = '''\ -from ev3dev import * -from mindstorms_widgets import mindstorms_widgets - robot = mindstorms_widgets() robot.connect_motor( 'left' ) robot.connect_motor( 'right' ) -- cgit v1.2.1 From f80206e6a4e4cec1574a375cb04dbdf07d3e02cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=BDabkar?= Date: Wed, 23 Dec 2015 11:28:05 +0100 Subject: angleska verzija --- robot/problems/introduction/forward1m/en.py | 21 +++++++++++++++++++-- robot/problems/introduction/forward1m/sl.py | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'robot/problems/introduction/forward1m') diff --git a/robot/problems/introduction/forward1m/en.py b/robot/problems/introduction/forward1m/en.py index bdf2a45..f923059 100644 --- a/robot/problems/introduction/forward1m/en.py +++ b/robot/problems/introduction/forward1m/en.py @@ -7,9 +7,26 @@ name = 'Forward 1m' slug = 'Forward 1m' description = '''\ - + Write a program that would make the robot drive forward and stop after 1 meter. ''' hint = { - + 'mW_init':mod.hint['init'], + 'connectMotorLeft':mod.hint['connectMotorLeft'], + 'connectMotorRight':mod.hint['connectMotorRight'], + 'moveSteering':mod.hint['moveSteering'], + 'onForRotations':mod.hint['onForRotations'], + 'direction':mod.hint['direction']+['''

robot.move_steering( '...', direction=0, ... ).

'''], + 'seconds':mod.hint['seconds']+['''

robot.move_steering( 'on_for_seconds', direction=0, seconds=3 ).

'''], + 'rotations':mod.hint['rotations'], } + +plan = ['''\ +

Program izvedemo v naslednjih korakih:

+
    +
  1. create a mindstorms_widgets() object, which represents the robot in your code.
  2. +
  3. connect the driving motors.
  4. +
  5. measure the circumference of robot's wheels and compute the number of rotations per meter.
  6. +
  7. synchronize the motors and run them so that the robot would move forward for computed number of rotations.
  8. +
''' +] diff --git a/robot/problems/introduction/forward1m/sl.py b/robot/problems/introduction/forward1m/sl.py index 2240d3c..f6209eb 100644 --- a/robot/problems/introduction/forward1m/sl.py +++ b/robot/problems/introduction/forward1m/sl.py @@ -4,7 +4,7 @@ name = 'Naprej 1m' slug = 'Naprej 1m' description = '''\ -

Napiši program, da bo robot peljal naravnost naprej 3 sekunde in se nato ustavil.

''' +

Napiši program, da bo robot peljal 1 meter naravnost in se nato ustavil.

''' hint = { 'mW_init':['''

Robota v programu predstavimo z mindstorms_widgets(): robot = mindstorms_widgets().

'''], -- cgit v1.2.1 From bebd9806a957cd91fe0e507091bc7d0fd385f865 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Wed, 23 Dec 2015 14:57:52 +0100 Subject: Fix: import robot hints from the correct directory --- robot/problems/introduction/forward1m/en.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'robot/problems/introduction/forward1m') diff --git a/robot/problems/introduction/forward1m/en.py b/robot/problems/introduction/forward1m/en.py index f923059..f47d088 100644 --- a/robot/problems/introduction/forward1m/en.py +++ b/robot/problems/introduction/forward1m/en.py @@ -1,6 +1,6 @@ # coding=utf-8 import server -mod = server.problems.load_language('python', 'en') +mod = server.problems.load_language('robot', 'en') id = 208 name = 'Forward 1m' -- cgit v1.2.1