Skip to content

Commit

Permalink
updated doc. added check that python>=3.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamBindle committed Apr 22, 2017
1 parent dbe615a commit 6cd1255
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 22 deletions.
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
# built documents.
#
# The short X.Y version.
version = '1.1'
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = '1.1'
release = '1.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
7 changes: 6 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,15 @@ These are the setter messages which are currently implemented.
.. autoclass:: pyvesc.SetRPM
.. autoclass:: pyvesc.SetCurrent
.. autoclass:: pyvesc.SetCurrentBrake
.. autoclass:: pyvesc.SetPosition
.. autoclass:: pyvesc.SetRotorPositionMode

Getter Messages
^^^^^^^^^^^^^^^
These are the getter messages which are currently implemented.
These are the getters that are currently implemented.

.. autoclass:: pyvesc.GetValues
.. autoclass:: pyvesc.GetRotorPosition

Implementing Additional Messages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
4 changes: 4 additions & 0 deletions pyvesc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
import sys
if sys.version_info < (3,3):
raise SystemExit("Invalid Python version. PyVESC requires Python 3.3 or greater.")

from pyvesc.interface import *
from pyvesc.messages import *
11 changes: 5 additions & 6 deletions pyvesc/messages/getters.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from pyvesc.messages.base import VESCMessage

class GetValues(metaclass=VESCMessage):
"""
Gets internal sensor data
""" Gets internal sensor data
"""
id = 4

Expand Down Expand Up @@ -30,10 +29,10 @@ class GetValues(metaclass=VESCMessage):


class GetRotorPosition(metaclass=VESCMessage):
"""
Gets rotor position data
Note: Must be set to DISP_POS_MODE_ENCODER or DISP_POS_MODE_PID_POS (Mode 3 or Mode 4)
This is set by SetRotorPositionMode (id=21)
""" Gets rotor position data
Must be set to DISP_POS_MODE_ENCODER or DISP_POS_MODE_PID_POS (Mode 3 or
Mode 4). This is set by SetRotorPositionMode (id=21).
"""
id = 21

Expand Down
25 changes: 13 additions & 12 deletions pyvesc/messages/setters.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class SetDutyCycle(metaclass=VESCMessage):
""" Set the duty cycle.
:ivar duty_cycle: Value of duty cycle to be set.
:ivar duty_cycle: Value of duty cycle to be set (range [-1e5, 1e5]).
"""
id = 5
fields = [
Expand Down Expand Up @@ -45,24 +45,25 @@ class SetCurrentBrake(metaclass=VESCMessage):
]

class SetPosition(metaclass=VESCMessage):
"""
Set the rotor angle based off of an encoder or sensor
:ivar pos: Value to set the current position or angle to.
"""Set the rotor angle based off of an encoder or sensor
:ivar pos: Value to set the current position or angle to.
"""
id = 9
fields = [
('pos', 'i', 1000000)
]

class SetRotorPositionMode(metaclass=VESCMessage):
"""
Sets the rotor position feedback mode.
It is reccomended to use the defined modes as below
DISP_POS_OFF
DISP_POS_MODE_ENCODER
DISP_POS_MODE_PID_POS
DISP_POS_MODE_PID_POS_ERROR
:ivar pos_mode: Value of the mode
"""Sets the rotor position feedback mode.
It is reccomended to use the defined modes as below:
* DISP_POS_OFF
* DISP_POS_MODE_ENCODER
* DISP_POS_MODE_PID_POS
* DISP_POS_MODE_PID_POS_ERROR
:ivar pos_mode: Value of the mode
"""

DISP_POS_OFF = 0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

VERSION = '1.0.3'
VERSION = '1.0.4'

setup(
name = 'pyvesc',
Expand Down

0 comments on commit 6cd1255

Please sign in to comment.