Skip to content

Commit

Permalink
Merge pull request #42 from LaboratoireMecaniqueLille/41-some-example…
Browse files Browse the repository at this point in the history
…s-in-tutorial-are-not-working

[fix] Bug in example code in the documentation
  • Loading branch information
WeisLeDocto authored Aug 30, 2023
2 parents 431f60a + c45f1ab commit 004be56
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
19 changes: 14 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@ sphinx:
configuration: docs/source/conf.py

# Optionally set the version of Python and requirements required to build your docs
build:
os: ubuntu-22.04
tools:
python: "3.9"

sphinx:
builder: html
configuration: docs/source/conf.py
fail_on_warning: true

python:
version: "3.8"
install:
- method: setuptools
path: .
- requirements: requirements.txt
install:
- requirements: requirements.txt
- method: pip
path: .
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,4 @@
# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
12 changes: 5 additions & 7 deletions docs/source/tutorials/gettingstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,7 @@ previous sections:
gen = crappy.blocks.Generator([
{'type': 'constant', 'value': 1000, 'condition': 'delay=3'},
{'type': 'ramp', 'speed': 100, 'condition': 'delay=5',
'cmd': 0},
{'type': 'ramp', 'speed': 100, 'condition': 'delay=5'},
{'type': 'constant', 'value': 1800, 'condition': 'delay=3'},
{'type': 'constant', 'value': 500, 'condition': 'delay=3'},
{'type': 'sine', 'amplitude': 2000, 'offset': 1000, 'freq': .3,
Expand All @@ -370,7 +369,7 @@ previous sections:
kd=0.05,
out_max=10,
out_min=-10,
i_limit=0.5,
i_limit=(-5, 5),
target_label='command_speed',
labels=['t(s)', 'voltage'],
input_label='actual_speed')
Expand All @@ -389,16 +388,15 @@ outputted by the PID block. Finally the grapher needs to know the current speed
and the command speed, just like the PID. So let's add the appropriate links :

.. code-block:: python
:emphasize-lines: 37-45
:emphasize-lines: 36-44
import crappy
if __name__ == '__main__':
gen = crappy.blocks.Generator([
{'type': 'constant', 'value': 1000, 'condition': 'delay=3'},
{'type': 'ramp', 'speed': 100, 'condition': 'delay=5',
'cmd': 0},
{'type': 'ramp', 'speed': 100, 'condition': 'delay=5'},
{'type': 'constant', 'value': 1800, 'condition': 'delay=3'},
{'type': 'constant', 'value': 500, 'condition': 'delay=3'},
{'type': 'sine', 'amplitude': 2000, 'offset': 1000, 'freq': .3,
Expand All @@ -422,7 +420,7 @@ and the command speed, just like the PID. So let's add the appropriate links :
kd=0.05,
out_max=10,
out_min=-10,
i_limit=0.5,
i_limit=(-5, 5),
target_label='command_speed',
labels=['t(s)', 'voltage'],
input_label='actual_speed')
Expand Down

0 comments on commit 004be56

Please sign in to comment.