From be94b55b835283de53c686343164641e15abe806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=BDabkar?= Date: Mon, 14 Dec 2015 12:44:58 +0100 Subject: Zadnje spremembe pred zagovorom. --- robot/problems/introduction/circle20/sl.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'robot/problems/introduction/circle20') diff --git a/robot/problems/introduction/circle20/sl.py b/robot/problems/introduction/circle20/sl.py index 219f9c7..abe70eb 100644 --- a/robot/problems/introduction/circle20/sl.py +++ b/robot/problems/introduction/circle20/sl.py @@ -24,3 +24,11 @@ hint = { '''

Za dani polmer izmeri čas, ki ga robot potrebuje za en obhod.

''', '''

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

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

1) Naredi robota

+''', +''' + +''' +] -- cgit v1.2.1 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/circle20/sl.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'robot/problems/introduction/circle20') diff --git a/robot/problems/introduction/circle20/sl.py b/robot/problems/introduction/circle20/sl.py index abe70eb..735458a 100644 --- a/robot/problems/introduction/circle20/sl.py +++ b/robot/problems/introduction/circle20/sl.py @@ -13,7 +13,7 @@ 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.

''', '''

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

'''], 'onForSeconds':['''

Prvi argument metode robot.move_steering naj pove, da bo delovanje motorjev časovno omejeno.

''', '''

robot.move_steering('on_for_seconds', ... ).

'''], @@ -25,10 +25,12 @@ hint = { '''

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

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

1) Naredi robota

-''', -''' - -''' +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. Izračunamo ostrino zavoja, pri kateri bo robot vozil po krogu s polmerom 20 cm.
  6. +
  7. Sinhronizirano poženemo oba motorja za premik v izračunani smeri in časovno omejimo na en obhod.
  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/circle20/common.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'robot/problems/introduction/circle20') diff --git a/robot/problems/introduction/circle20/common.py b/robot/problems/introduction/circle20/common.py index 879f198..4d283d0 100644 --- a/robot/problems/introduction/circle20/common.py +++ b/robot/problems/introduction/circle20/common.py @@ -10,14 +10,11 @@ number = 5 visible = True solution = '''\ -from ev3dev import * -from mindstorms_widgets import mindstorms_widgets - robot = mindstorms_widgets() robot.connect_motor( 'left' ) robot.connect_motor( 'right' ) -fct = 9 # full circle time +fct = 8.9 # full circle time rad = 20 # Direction to make a good radius for the circle robot.move_steering( 'on_for_seconds', direction=rad, power=40, seconds=fct ) ''' -- 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/circle20/en.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'robot/problems/introduction/circle20') diff --git a/robot/problems/introduction/circle20/en.py b/robot/problems/introduction/circle20/en.py index 8210d71..c677cce 100644 --- a/robot/problems/introduction/circle20/en.py +++ b/robot/problems/introduction/circle20/en.py @@ -7,8 +7,26 @@ name = 'Circle 20 cm' slug = 'Circle 20 cm' description = '''\ -''' +

Write a program that will make the robot drive in circle (r=20cm) and stop after one loop.

''' hint = { - + 'mW_init':mod.hint['init'], + 'connectMotorLeft':mod.hint['connectMotorLeft'], + 'connectMotorRight':mod.hint['connectMotorRight'], + 'moveSteering':mod.hint['moveSteering'], + 'onForSeconds':mod.hint['onForSeconds'], + 'direction':mod.hint['direction']+['''

The value of this parameter should be such that would make the robot circle with radius 20cm. This value highly depends on the construction of the robot.

''', + '''

robot.move_steering( 'on_for_seconds', direction=20, ... ).

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

Experimentally determine the time (in seconds) the robot needs for one loop.

''', + '''

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

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

The program should:

+
    +
  1. create a mindstorms_widgets() object, which represents the robot in your code.
  2. +
  3. connect the driving motors.
  4. +
  5. calculate the turn so that the robot would drive in circle with radius 20 cm.
  6. +
  7. synchronize the motors and run them for a specified time, so that the robot stops after one round.
  8. +
''' +] -- 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/circle20/en.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'robot/problems/introduction/circle20') diff --git a/robot/problems/introduction/circle20/en.py b/robot/problems/introduction/circle20/en.py index c677cce..d2c410c 100644 --- a/robot/problems/introduction/circle20/en.py +++ b/robot/problems/introduction/circle20/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 = 205 name = 'Circle 20 cm' -- cgit v1.2.1