4 posts / 0 new
Last post
Offline
Last seen: 10 months 2 weeks ago
Joined: April 10, 2017
Help with NAO choregraphe

Hi all,
I have a project to run NAO in a simulated environment using choregraphe. I have included a python script in one of the boxes. However, there are errors of "no module called cv2/numpy".

I found out that choregraphe has its own python interpreter. How do I install cv2 and numpy into choregraphe for it to recognize them?

Offline
Last seen: 1 day 27 min ago
Joined: October 3, 2016

Hi there, you need to place the numpy/cv2 module in your Choregraphe project and import it.
Do yourself a favor and test the cv2 example in another IDE, or just IDLE, before implementing in the robot (that will be much faster). Follow this guide:
https://www.youtube.com/watch?v=iAeis7j5LmE
Try this:
Find the location of the cv2 side-package in your Python 2.7 directory, Copy the cv2 folder to your Choregraphe directory. Create a new python box and paste this code:

class MyClass(GeneratedClass):
def __init__(self):
GeneratedClass.__init__(self)
self.behaviorPath = ALFrameManager.getBehaviorPath(self.behaviorId)
sys.path.append(self.behaviorPath)
k = self.behaviorPath.rfind("/")
packagePath = self.behaviorPath[:k]
sys.path.append(packagePath)
import cv2
self.cv2 = cv2.someMethodname()

Offline
Last seen: 10 months 2 weeks ago
Joined: April 10, 2017

Hi Anders, I did following steps:
"pip install numpy" using an external python (not the one in choregraphe)
created a folder named "lib" and placed it in the folder where my choregraphe project is.
placed all the numpy folders into "lib"
deleted the external python
start choregraphe and run my project, but i am still getting the error "No module named numpy" from the box that have "import numpy".

why is it still not working now that I have the numpy module in my choregraphe project?

Offline
Last seen: 3 hours 20 min ago
Joined: March 5, 2017

If you do it that way you may just need to change your PATH.
See:
https://docs.scipy.org/doc/numpy-dev/dev/development_environment.html