Hi @williamfblock,
Here’s what you have to do to use the package within a virtual environment.
So let’s create the virtual environment and activate it:
virtualenv .venv2 -p python && source .venv2/bin/activate
Then let’s install some dependencies for GoPiGo3/DI-Sensors with RFR_Tools while being in the virtual environment. RFR_Tools has a package necessary for all interfaces between the robot/sensor and the RaspberryPi.
curl -kL dexterindustries.com/update_rfrtools | bash -s -- --bypass-gui-installation --env-local --install-python-package
Next, let’s curl the installers for the GoPiGo3 and DI-Sensors and modify a parameter inside both scripts.
curl -kL dexterindustries.com/update_gopigo3 > update_gopigo3.sh
curl -kL dexterindustries.com/update_sensors > update_sensors.sh
Go and edit both files here and here and change the assigned value from true
to false
.
Now let’s run both of them this way:
bash update_gopigo3.sh --bypass-rfrtools --env-local
bash update_sensors.sh --bypass-rfrtools --env-local
And finally, we need to install the following packages with pip:
pip install future RPi.GPIO numpy
At the end of all these, pip list
should give you these installed packages:
Package Version
---------------------------------- -------
Package Version
---------------------------------- -------
cffi 1.11.5
Dexter-AutoDetection-and-I2C-Mutex 0.0.0
DI-Sensors 1.0.0
future 0.17.1
gopigo3 1.2.0
Line-Follower 1.0.0
numpy 1.15.4
pip 18.1
pycparser 2.19
pyserial 3.4
python-periphery 1.1.1
RPi.GPIO 0.6.5
setuptools 40.6.2
smbus-cffi 0.5.1
spidev 3.2
wheel 0.32.3
At the end of this, importing, instantiating and playing with the line follower sensor will work. One thing to remember is that line follower is not part of the GoPiGo3 package, but part of DI-Sensors. That’s why DI-Sensors also has to get installed. We are not that clear in our documentation here, but at least we’ve got a warning about the missing library in the GoPiGo3 - we should make it more clear in one of our next releases.
And finally, you might be interested in going through the documentation of these libraries (GoPiGo3 and DI-Sensors):
https://gopigo3.readthedocs.io
https://di-sensors.readthedocs.io
Please let me know if this did it for you.
Thank you!