Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beam tilt correction #778

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions Settings/maslowSettings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'''

This file provides a single dict which contains all of the details about the
various settings. It also has a number of helper functions for interacting
This file provides a single dict which contains all of the details about the
various settings. It also has a number of helper functions for interacting
and using the data in this dict.

'''
Expand All @@ -21,7 +21,7 @@
"desc": "A description of the setting",
"key": "keyName", //this has to be a valid keyname
"default": "default value",
"firmwareKey": 12 // if this is a setting in the firmware, this
"firmwareKey": 12 // if this is a setting in the firmware, this
// is the integer value of that setting
},
{...}
Expand Down Expand Up @@ -317,6 +317,14 @@
"default": 0,
"firmwareKey": 37
},
{
"type": "string",
"title": "Top Beam Tilt (Experimental)",
"desc": "Experimental adjustment for top beam tilt in degrees\\ndefault setting: %s",
"key": "topBeamTilt",
"default": 0,
"firmwareKey": 43
},
{
"type": "bool",
"title": "Enable Custom Positional PID Values",
Expand Down Expand Up @@ -608,7 +616,7 @@

def getJSONSettingSection(section):
'''
This generates a JSON string which is used to construct the Kivy config
This generates a JSON string which is used to construct the Kivy config
panel
'''
options = []
Expand All @@ -623,7 +631,7 @@ def getJSONSettingSection(section):

def getDefaultValueSection(section):
'''
Returns a dict with the settings keys as the key and the default value
Returns a dict with the settings keys as the key and the default value
of that setting as the value for the section specified
'''
ret = {}
Expand Down Expand Up @@ -676,10 +684,9 @@ def syncFirmwareKey(firmwareKey, value, data):

def isClose(a, b, rel_tol=1e-06):
'''
Takes two values and returns true if values are close enough in value
such that the difference between them is less than the significant
Takes two values and returns true if values are close enough in value
such that the difference between them is less than the significant
figure specified by rel_tol. Useful for comparing float values on
arduino adapted from https://stackoverflow.com/a/33024979
'''
return abs(a-b) <= rel_tol * max(abs(a), abs(b))