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

Work in Progress: Big cleanup #820

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
*.DS_Store
*.pyc
*.bak
*.ini
*ENV
log.txt
groundcontrol.egg-info
log.txt
113 changes: 113 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,119 @@ For Windows and OS X binaries, see the [releases](https://github.com/MaslowCNC/G

For help installing binaries, see the [installation guides](https://github.com/MaslowCNC/GroundControl/wiki#gc-installation-guides).


### MacOS

Install homebrew and poetry.

Install python 3.7

```bash
brew install [email protected]
```

Install Kivy dependencies following "Using Homebrew with pip" [instructions](https://kivy.org/doc/stable/installation/installation-osx.html).

```bash
brew install pkg-config sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer
```

Depending on your poetry installation, you might want to set which python you want to use

```bash
poetry env use /path/to/[email protected]/bin/python3.7
```

Install GroundControl using poetry

```bash
poetry install
```

Run GroundControl

```bash
poetry run groundcontrol
```

## Raspberry Pi 3B+ (Version 4 currently has problems with kivy)

Flash an SD card with Raspberry Pi OS Lite

Do updata/upgrade

```bash
sudo apt-get update
sudo apt-get upgrade
```

Install Kivy dependencies

```bash
sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev \
pkg-config libgl1-mesa-dev libgles2-mesa-dev \
python-setuptools libgstreamer1.0-dev git-core \
gstreamer1.0-plugins-{bad,base,good,ugly} \
gstreamer1.0-{omx,alsa} python-dev libmtdev-dev \
xclip xsel libjpeg-dev
```

Make sure you have python3.7 and installed and python is pointing to 3.7

```bash
sudo apt-get install python3.7 python3-distutils python3-venv python3-pip
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python3.7 /usr/bin/python
```

Install poetry

```bash
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
```

Downgrade poetry to 1.0.0 (later versions might not work well on Raspberry)

```bash
source $HOME/.poetry/env
poetry self update 1.0.0
```

Install git and clone repository

```bash
sudo apt-get install git
git clone https://github.com/mdelmans/GroundControl.git -b feature/cleanup
```

Install GroundControl

```bash
cd GroundControll
poetry install
```

Run GroundControl

```bash
poetry run groundcontrol
```

If you are using Official Raspberry Pi Screen, add the following to `~/.kivy/config.ini` [input] section

```bash
mouse = mouse
mtdev_%(name)s = probesysfs,provider=mtdev
hid_%(name)s = probesysfs,provider=hidinput
```
And increase gpu memory to 128MB in raspi-config [Perfomance] -> [GPU Memory]

```bash
sudo raspi-config
```



## Documentation

Ground control documentation is available on the [project wiki](https://github.com/MaslowCNC/GroundControl/wiki).
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from UIElements.touchNumberInput import TouchNumberInput
from kivy.uix.popup import Popup
from UIElements.zAxisPopupContent import ZAxisPopupContent
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from kivy.uix.popup import Popup
from groundcontrol.ui_elements.zAxisPopupContent import ZAxisPopupContent
from kivy.app import App

class AdjustZCalibrationDepth(GridLayout):
'''

Provides a standard interface for setting up the Z axis

'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
'''
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from kivy.properties import StringProperty
from kivy.uix.popup import Popup
from CalibrationWidgets.setSprocketsVertical import SetSprocketsVertical
from CalibrationWidgets.measureOutChains import MeasureOutChains

class CalibrateLengthsPopup(GridLayout):
done = ObjectProperty(None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@
state regardless of the machine's state when the widget begins.

'''
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from CalibrationWidgets.intro import Intro
from CalibrationWidgets.chooseKinematicsType import ChooseKinematicsType
from CalibrationWidgets.chooseChainOverSprocketDirection import ChooseChainOverSprocketDirection
from CalibrationWidgets.computeCalibrationSteps import ComputeCalibrationSteps
from CalibrationWidgets.setSprocketsVertical import SetSprocketsVertical
from CalibrationWidgets.measureDistBetweenMotors import MeasureDistBetweenMotors
from CalibrationWidgets.vertDistToMotorsGuess import VertDistToMotorsGuess
from CalibrationWidgets.measureOutChains import MeasureOutChains
from CalibrationWidgets.removeChains import RemoveChains
from CalibrationWidgets.adjustZCalibrationDepth import AdjustZCalibrationDepth
from CalibrationWidgets.rotationRadiusGuess import RotationRadiusGuess
from CalibrationWidgets.triangularCalibration import TriangularCalibration
from CalibrationWidgets.distBetweenChainBrackets import DistBetweenChainBrackets
from CalibrationWidgets.reviewMeasurements import ReviewMeasurements
from CalibrationWidgets.quadTestCut import QuadTestCut
from CalibrationWidgets.finish import Finish
from CalibrationWidgets.finishSetChainLengths import FinishSetChainLengths
from CalibrationWidgets.manualCalibration import ManualCalibration
from CalibrationWidgets.enterDistanceBetweenMotors import EnterDistanceBetweenMotors
from CalibrationWidgets.measureOneChain import MeasureOneChain
from CalibrationWidgets.computeChainCorrectionFactors import ComputeChainCorrectionFactors
from CalibrationWidgets.wipeOldCorrectionValues import WipeOldCorrectionValues
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from groundcontrol.calibration_widgets.intro import Intro
from groundcontrol.calibration_widgets.chooseKinematicsType import ChooseKinematicsType
from groundcontrol.calibration_widgets.chooseChainOverSprocketDirection import ChooseChainOverSprocketDirection
from groundcontrol.calibration_widgets.computeCalibrationSteps import ComputeCalibrationSteps
from groundcontrol.calibration_widgets.setSprocketsVertical import SetSprocketsVertical
from groundcontrol.calibration_widgets.measureDistBetweenMotors import MeasureDistBetweenMotors
from groundcontrol.calibration_widgets.vertDistToMotorsGuess import VertDistToMotorsGuess
from groundcontrol.calibration_widgets.measureOutChains import MeasureOutChains
from groundcontrol.calibration_widgets.removeChains import RemoveChains
from groundcontrol.calibration_widgets.adjustZCalibrationDepth import AdjustZCalibrationDepth
from groundcontrol.calibration_widgets.rotationRadiusGuess import RotationRadiusGuess
from groundcontrol.calibration_widgets.triangularCalibration import TriangularCalibration
from groundcontrol.calibration_widgets.distBetweenChainBrackets import DistBetweenChainBrackets
from groundcontrol.calibration_widgets.reviewMeasurements import ReviewMeasurements
from groundcontrol.calibration_widgets.quadTestCut import QuadTestCut
from groundcontrol.calibration_widgets.finish import Finish
from groundcontrol.calibration_widgets.finishSetChainLengths import FinishSetChainLengths
from groundcontrol.calibration_widgets.manualCalibration import ManualCalibration
from groundcontrol.calibration_widgets.enterDistanceBetweenMotors import EnterDistanceBetweenMotors
from groundcontrol.calibration_widgets.measureOneChain import MeasureOneChain
from groundcontrol.calibration_widgets.computeChainCorrectionFactors import ComputeChainCorrectionFactors
from groundcontrol.calibration_widgets.wipeOldCorrectionValues import WipeOldCorrectionValues
from kivy.app import App


class CalibrationFrameWidget(GridLayout):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def on_Enter(self):
This function runs when the step is entered

'''
print "choose sprocket direction on enter ran"
print("choose sprocket direction on enter ran")

def setChainToTop(self):
'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
'''
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from kivy.app import App
from kivy.clock import Clock

class ComputeCalibrationSteps(GridLayout):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from kivy.properties import StringProperty
from UIElements.touchNumberInput import TouchNumberInput
from kivy.uix.popup import Popup
from kivy.app import App
import global_variables

class ComputeChainCorrectionFactors(GridLayout):
'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
'''
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from UIElements.touchNumberInput import TouchNumberInput
from groundcontrol.ui_elements.touchNumberInput import TouchNumberInput
from kivy.uix.popup import Popup
from kivy.app import App
import global_variables
import groundcontrol.global_variables as global_variables

class DistBetweenChainBrackets(GridLayout):
readyToMoveOn = ObjectProperty(None)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from kivy.properties import StringProperty
from UIElements.touchNumberInput import TouchNumberInput
from kivy.uix.popup import Popup
from kivy.app import App
import global_variables

class EnterDistanceBetweenMotors(GridLayout):
'''
Expand Down Expand Up @@ -51,7 +47,7 @@ def enterValues(self):
self.loadNextStep()

except Exception as e:
print e
print(e)

def loadNextStep(self):
self.readyToMoveOn()
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from kivy.properties import StringProperty
from UIElements.touchNumberInput import TouchNumberInput
from kivy.uix.popup import Popup
from kivy.app import App
import global_variables

class ManualCalibration(GridLayout):
'''
Expand Down Expand Up @@ -62,7 +58,7 @@ def enterValues(self):
self.loadNextStep()

except Exception as e:
print e
print(e)

def loadNextStep(self):
self.readyToMoveOn()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from UIElements.touchNumberInput import TouchNumberInput
from groundcontrol.ui_elements.touchNumberInput import TouchNumberInput
from kivy.uix.popup import Popup
from kivy.app import App
import global_variables
import groundcontrol.global_variables as global_variables

class MeasureDistBetweenMotors(GridLayout):
'''
Expand Down Expand Up @@ -93,7 +93,7 @@ def measureLeft(self):
def readMotorSpacing(self, dist):
dist = dist - 2*6.35 #subtract off the extra two links

print "Read motor spacing: " + str(dist)
print("Read motor spacing: " + str(dist))
self.data.config.set('Maslow Settings', 'motorSpacingX', str(dist))

#put some slack in the chain
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from UIElements.touchNumberInput import TouchNumberInput
from kivy.uix.popup import Popup
from kivy.app import App
import global_variables

class MeasureOneChain(GridLayout):
'''
Expand Down Expand Up @@ -44,7 +41,7 @@ def measure(self):
def readMotorSpacing(self, dist):
dist = dist - 2*6.35 #subtract off the extra two links

print "Read motor spacing: " + str(dist)
print("Read motor spacing: " + str(dist))

#put some slack in the chain
self.data.gcode_queue.put("G91 ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from kivy.clock import Clock
from kivy.app import App

from groundcontrol.util import get_asset

class MeasureOutChains(GridLayout):
'''

Expand All @@ -23,13 +25,13 @@ def on_Enter(self):
self.text = "If your chains are already in place they may retract to the target length.\n\nIf your left chain is still attached to the right motor from the length measurement motor-to-motor, remove it from the RIGHT motor without changing the position it has on the left motor.\nFor chains that are not attached to a motor (typical calibration = right chain) place the first link of the chain on the vertical sprocket tooth.\n\nThe correct length of first the left and then the right chain will be measured out\n\nOnce both chains are finished attach the sled, then press Next\n\nThe Move to Center button will move the sled to the center.\n\nBe sure to keep an eye on the chains during this process to ensure that they do not become tangled\naround the sprocket. The motors are very powerful and the machine can damage itself this way"

#select the right image for a given setup
print "measure out chains on enter"
print("measure out chains on enter")
if App.get_running_app().data.config.get('Advanced Settings', 'chainOverSprocket') == 'Top':
print "top feeding detected"
self.leftImg.source = "./Documentation/Calibrate Machine Dimensions/topfeeding/Ready To Calibrate.jpg"
print("top feeding detected")
self.leftImg.source = get_asset("documentation/Calibrate Machine Dimensions/topfeeding/Ready To Calibrate.jpg")
else :
print "bottom feeding detected"
self.leftImg.source = "./Documentation/Calibrate Machine Dimensions/bottomfeeding/Ready To Calibrate.jpg"
print("bottom feeding detected")
self.leftImg.source = get_asset("documentation/Calibrate Machine Dimensions/bottomfeeding/Ready To Calibrate.jpg")

def stop(self):
self.data.quick_queue.put("!")
Expand All @@ -44,7 +46,7 @@ def moveToCenter(self):
'''
self.data.gcode_queue.put("B15 ")

def next(self):
def __next__(self):

self.readyToMoveOn()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def enterTestPaternValues(self):
else:
amtToChange = .9*dif
newSledSpacing = float(self.data.config.get('Maslow Settings', 'sledWidth')) + amtToChange
print "Now trying spacing: " + str(newSledSpacing)
print("Now trying spacing: " + str(newSledSpacing))
self.data.config.set('Maslow Settings', 'sledWidth', str(newSledSpacing))
self.cutBtn.disabled = False

Expand Down
Loading