Changes between Version 13 and Version 14 of en/ProgrammingRobotsCourse/GettingWwwInfo
- Timestamp:
- Mar 16, 2020, 3:38:24 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
en/ProgrammingRobotsCourse/GettingWwwInfo
v13 v14 2 2 3 3 == How to get info from web? 4 5 Remember that Python usage in Pepper robots is limited to Python 2 and old version of packages. It is possible to install some (small) Python packages via `pip --user` to `/home/nao` but the space is limited. 6 7 If you want to test without the real robot, you can run the Python code using the virtual robot - see [# 4 8 5 9 === Use API … … 70 74 }}} 71 75 72 In dialog, detect variables, pass them to service, and parse call result to say answer:76 In dialog, detect variables, pass them to service, and parse the call result to say answer: 73 77 74 78 {{{ … … 78 82 c1:(In _* currently _*) V místnosti $1 je právě $2 79 83 }}} 84 85 Note that in `c1:` we can use `_*` since this regular expression is matched against ''text'' from the service, not against human ''speech''. The text can be in English (or even in non-language), the answer to humans is then specified in the concrete dialog topic, e.g. in Czech. Unfortunately, the [http://doc.aldebaran.com/2-5/naoqi/interaction/dialog/dialog-syntax_full.html#call documentation] is not clear in what can and what cannot be matched by `_*` here, tests are needed with real data. 80 86 81 87 {{{u1}}} detects letter and number (concepts defined earlier in dialog) and calls {{{get_current_lesson()}}}. This function return strings, that are parsed in dialog and answer is translated to each locale. … … 103 109 }}} 104 110 105 Dialog detect word with station name and calls {{{say_answer1()}}}. No answer is passed back, answer is said directly in script.111 Dialog detects word with station name and calls {{{say_answer1()}}}. No answer is passed back, answer is said directly in script. 106 112 107 113 {{{#!python