Hey 71Davess,
due to OpenCV didn’t fit on the 4gb card i bought from your page.
Did you try expanding rootfs?
Hey 71Davess,
due to OpenCV didn’t fit on the 4gb card i bought from your page.
Did you try expanding rootfs?
Yes i did, but it wasn’t enough. I bought an 32 gb micro Sd card and i have now installed OpenCV without problems.
Hello Everyone!! I’ve been working hard these two weeks!! And i have currently working openCV on my GoPiGo, but i have a little problem.
When i’m going to use your library “gopigo” and i’m going to import it in my code "from gopigo import * " in order to use the basic controlls as fwd(), stop(), etc. The compiler tells me the next:
(cv)pi@raspberrypi ~/Desktop $ python CircleDetector_MOVEMENT.py
"Traceback (most recent call last):
File “CircleDetector_MOVEMENT.py”, line 8, in <module>
from gopigo import *
ImportError: No module named gopigo"
so there is a problem i don’t understand. I use your examples and they all work, but when i’m going to import “*” from “gopigo” in other script, i get an error. I know that it’s a silly question, but i’m new in python and in all this world.
So, Could you please tell me how i could use your libraries to carry on with my project? I’ll be very grateful.
Any help is appreciated.
P.S.: As soon as i finished my project, i’ll share it with everyone, hoping you like it! And Here you are a pic of the error.
Hey,
You should run setup.py in the Software/Python folder or just run
-Karan
I have installed it, and now, the next is happening:
I run your test scripts and they work if i write on putty:
- sudo python basic_robot.py
but If i write just:
- python basic_robot.py
I get the error:
"from gopigo import *
ImportError: No module named gopigo"
But executing a script with the camera, if i do:
- sudo python myprogram.py
I get the error:
"Traceback (most recent call last):
File “myprogram.py”, line 2, in <module>
from picamera.array import PiRGBArray
ImportError: No module named picamera.array
And if i do:
-python myprogram.py
Works perfectly, but i get again the error:
“from gopigo import *
ImportError: No module named gopigo”
So i don’t know how to use both libraries in the same script. I can solve one problem, but then the another one appears. I am conscient that maybe is something related with the super user, or the folders i need to install the gopigo.
I have a folder with opencv installed, do i need to install the gopigo inside this folder?
Sorry for asking too much and these simple questions, but i’m a noob in that field, and are questions related with linux commands, users and directories, which i almost know nothing.
Any help is appreciated.
Thank you again and again and again!
Hey,
The GoPiGo does need I2C to communicate with the Raspberry Pi and I think that it needs super user access. You can try to copy paste the library in the same folder, but I’ll still recommend you to use sudo when running the code.
-Karan
I’ve done this, and i get one of the other errors :
sudo python CircleDetector_MOVEMENT.py
Traceback (most recent call last):
File “CircleDetector_MOVEMENT.py”, line 2, in <module>
from picamera.array import PiRGBArray
ImportError: No module named picamera.array
So what should i do now in order to avoid it?
Thanks a bunch, seriously!
I don’t want to hop over Karan on this, just throwing my two cents in here.
Is this a picamera problem? Could you reinstall the picamera module?
I can try it, but i’ve been testing things with the camera and i had no problem with it, though i needed to test everything with 5fps and a low resolution due to works really slow. I don’t know if this normal or if it can work faster.
And do i need to install the picam in a specific folder? or wherever i want ?
Thank you very much.
Hey,
I am not sure about the PiCam installation, but I think it won’t matter much where you install it because the libraries are installed system wide and should work.
Now with regard to the low frame rate, that would be a problem with the original Pi. But you can try reducing the video resolution which should increase the frame rate.
-Karan
Hey!
I have tried to install the PiCamera again and is still happening the same problem. I think it’s something related with the I2C you told me Karan. But i don’t know what’s happening, though i guess it’s something about the connection between the GoPiGo and the Raspberry.
Here i send you the file i’ve programmed(in txt, so please change the extension to .py if try). If you could run this program on a GoPiGo Robot with OpenCV installed, and know what to do in order to work, i’ll be very very very grateful to all of you.
So, any help is appreciated.
Thank you and thank you again.
Dave.
Hi again,
Well, i don’t know if it’s an achievement or not, but copying the folder Python from GoPiGo/Software/Python, installing there the “setup.py” and putting my programme on this location, i get the error showed on the picture above. If this is not a “next step” to solve the problem, please, let me know it and i’ll remove the Python folder from the opencv Folder.
Thanks a bunch and excuse for my insistence.
Hey,
You should go ahead and install the pySerial library: pip install pyserial
. Let us know if that helps.
-Karan
Hey! Thanks again Karan!
It’s seems it works, this error doesn’t appears anymore, but now i get troubles with the next “import”:
import smbus
ImportError:No module named smbus
So i did:
sudo apt-get install python-smbus
But the error is still appearing.
So i delete the sentence “import smbus” just to try what would happen, and it seems that i’m going to have problems with all the “import”'s inside gopigo.py.
Later i tried to run your basic_robot.py and i realize that i have the same problem i had with my file.py:
“from gopigo import *
ImportError: No module named gopigo”
So in order to use your “basic_robot.py”, i need to type:
sudo python basic_robot.py
Is there any way to execute this files.py without using sudo? I think it would solve the problem.
If not, is any way to use opencv with sudo? I say that due to when i use sudo python myfile.py insted of python myfile.py, if i import in the script: “import cv2”, which is opencv, i get this other error:
ImportError: No module named cv2
So something related with permissions is happening here.
Again, any help is appreciated.
Thank you!
Hey,
I don;t think that you would be able to rung the GoPiGo without sudo. GoPiGo needs access to the I2C bus which is only given to a root user.
I think it might be better to get the OpenCV code working alone without the GoPiGo and when it starts working, then you should look at ways to integrate it.
-Karan
Okay, i’ll look for information about it.
And, Would it be possible to use Matlab with the GoPiGo and Raspberry ?
Hey,
I am not sure if matlab would work or not, but there is an open source software called Scilab which should work with the Pi.
-Karan
Thanks a bunch karan!!
I finally solved the problem.
I access to the raspberry via Putty(due to i use windows). Once i’m inside raspberry, with the command “lxsession” i acces to the desktop of the raspberry, and there i run everythin from the root Terminal and i have no problem !!
Thanks again for everything!
Hey,
Glad to hear that it is working for you.
Do share your project with us when it’s ready.
-Karan
@71davess,
Looking at your posts 3 years later looking to do something similar. Were you successful? Do you have a web page or github (or your thesis?) that shows how you did it?
Thanks!
Jim P