I just downloaded MyRobotLab to my Mac which is running Mountain Lion and I can't seem to get it running.  The GUI opens and I have Welcome, MRL6890, gui, and python tabs.  When I try to install or upgrade OpenCV, I get a bunch of errors to the log:

 
140700 [MRL6890] ERROR org.myrobotlab.framework.Ivy2  - unresolved dependency: org.apache.log4j#log4j;latest.integration: configuration not found in org.apache.log4j#log4j;1.2.14: 'x86_64.64.mac'. It was required from org.apache.log4j#log4j-caller;working default
140704 [MRL6890] INFO  org.myrobotlab.framework.Ivy2  - ivy.retrieve returned 0
140704 [MRL6890] ERROR class org.myrobotlab.framework.ServiceInfo  - Ivy resolve error
 
I'll spare you from the rest but it keeps complaining about 'x86_64.64.mac'.  I found this on the server:
 
 
Which contains these settings:
 
<?xml version="1.0" encoding="ISO-8859-1"?>
<ivy-module version="1.0">
    <info organisation="com.googlecode.javacv" module="javacv" status="release" revision="0.2">
    </info>
    <configurations>
    </configurations>
    <publications>
        <artifact name="javacv" type="jar"/>
        <artifact name="javacpp" type="jar"/>
        <artifact name="javacv-android-arm" type="jar" conf="arm.32.linux"/>
        <artifact name="javacv-windows-x86" type="jar" conf="x86.32.windows"/>
        <artifact name="javacv-windows-x86_64" type="jar" conf="x86.64.windows"/>
        <artifact name="javacv-linux-x86" type="jar" conf="x86.32.linux"/>
        <artifact name="javacv-linux-x86_64" type="jar" conf="x86.64.linux"/>
    </publications>
</ivy-module> 
 
But there is no 'x86_64.64.mac' in the list above.
 
Here is my java version from the console:
 
superdog@Mac15:~/downloads/myrobotlab$ java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)
 
Output from log:
 
31643 [MRL6890] ERROR class org.myrobotlab.framework.Service  - ------
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.myrobotlab.service.Runtime.createService(Unknown Source)
at org.myrobotlab.service.Runtime.create(Unknown Source)
at org.myrobotlab.service.Runtime.create(Unknown Source)
at org.myrobotlab.service.Runtime.createAndStart(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.myrobotlab.framework.Service.invoke(Unknown Source)
at org.myrobotlab.framework.Service.invoke(Unknown Source)
at org.myrobotlab.framework.Service.invoke(Unknown Source)
at org.myrobotlab.framework.Service.run(Unknown Source)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.NoClassDefFoundError: com/googlecode/javacv/cpp/opencv_core$CvPoint
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at org.myrobotlab.framework.Service.registerServices(Unknown Source)
at org.myrobotlab.framework.Service.<init>(Unknown Source)
at org.myrobotlab.framework.Service.<init>(Unknown Source)
at org.myrobotlab.service.OpenCV.<init>(Unknown Source)
... 17 more
Caused by: java.lang.ClassNotFoundException: com.googlecode.javacv.cpp.opencv_core$CvPoint
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 24 more
------
 
31643 [MRL6890] ERROR org.myrobotlab.service.Runtime  - cannot start service OpenCV
 
 
I do have OpenCV installed and it does run when I run my own python scripts.

GroG

9 years 11 months ago

I'm impressed with your diagnostic capabilities. I can also tell by the information you/ve provided that your system "SHOULD" report as x86.64.mac ..   Somewhere in the platform identification x86_64 is coming back and not being normalized.

I'll look into it now.

I'll post when the root cause has been found and fixed.

Thanks for the interest..

GroG

9 years 11 months ago

I believe I fixed the platform identification issue.  The continuous integration server will pick up the change and post a new version on google in about 5 minutes. The next issue which you pointed out is - missing dependencies for opencv - You say that you have a working set of binaries for OpenCV ?  Would you mind telling me what version it is .. 2.4.2  64 bit perhaps?  I have very limited access to Macs (no access to 64 bit macs)

Heh,
I'm guessing you weren't expecting me to ask for you help :)

Superdog

9 years 11 months ago

Thanks for looking at this.  I just downloaded v1006.  I can see you updated the platform ID but it's still complaining.  I am running OpenCV-2.4.3.  

 

606280 [MRL88115] ERROR org.myrobotlab.framework.Ivy2  - Ivy resolve error
606280 [MRL88115] ERROR org.myrobotlab.framework.Ivy2  - unresolved dependency: org.apache.log4j#log4j;latest.integration: configuration not found in org.apache.log4j#log4j;1.2.14: 'x86.64.mac'. It was required from org.apache.log4j#log4j-caller;working default
606281 [MRL88115] INFO  org.myrobotlab.framework.Ivy2  - ivy.retrieve returned 0
606281 [MRL88115] ERROR class org.myrobotlab.framework.ServiceInfo  - Ivy resolve error
606281 [MRL88115] WARN  class org.myrobotlab.framework.Service  - org.myrobotlab.service.Runtime#resolveError NoSuchMethodException - attempting upcasting
606281 [MRL88115] WARN  class org.myrobotlab.framework.Service  - ouch! need to search through 186 methods
606282 [MRL88115] ERROR class org.myrobotlab.framework.ServiceInfo  - unresolved dependency: org.apache.log4j#log4j;latest.integration: configuration not found in org.apache.log4j#log4j;1.2.14: 'x86.64.mac'. It was required from org.apache.log4j#log4j-caller;working default
606282 [MRL88115] INFO  class org.myrobotlab.framework.ServiceInfo  - Ivy2.run -cache .ivy -retrieve libraries/[type]/[artifact].[ext] -settings ivychain.xml -dependency org.simpleframework.xml xml latest.integration -confs runtime,x86.64.mac 
606282 [gui] WARN  class org.myrobotlab.framework.Service  - org.myrobotlab.control.RuntimeGUI#resolveError NoSuchMethodException - attempting upcasting
 

It's progress - the identification has changed -> it's now x86.64.mac..

next changes are to the repo - doing that now..

Did you build 2.4.3 yourself ?  I'll be updating shortly from 2.4.2 to 2.4.3

FYI - The change set number is 1000 - its at the beginning - you're look ing at part of the timestamp - was 10:06 when it was built..

Change your Avatar picture .. you're certainly not a scared gopher ! :)

GroG

9 years 11 months ago

Checked in the x86.64.mac definition into the repo - you should get stuff to install, but it will choke on OpenCV as I do not currently have a OpenCV 2.4.2 version for mac 64

Current options are :

  • wait till I upgrade to 2.4.3
  • if you can build and send me the binaries for 2.4.2 - I dont have access to a mac 64

Got it.. Thanks !

The output looks like Linux.. I removed the symbolic links since they will be meaningless by the time they are requested from the mrl repo.

Threre are two files which are different - a cv2.so (I thought all dynamic libraries on mac were always .dylib extention? no? & libopencv_haartraining_engine.a - which looks a little bit like a static library (at least in Linux extentions)  The name of the file sounds exciting...  haartraining in the past was always a PITA in opencv.

Theoretically, (If I did it right) you shouldn't get errors on the "install / download" from the repo - and you should get the contents of what is currently checked in (the stuff you just built) - from here - http://code.google.com/p/myrobotlab/source/browse/#svn%2Ftrunk%2Fmyrobotlab%2FthirdParty%2Frepo%2Fnet.sourceforge.opencv%2Fopencv%2F2.4.2%2Fx86.64.mac 

I had to change the filenames slightly because of JavaCV's JNI interface expects them without the service pack number.

They should theoretically, be downloaded into wherever you installed myrobotlab  myrobotlab/libraries/native/x86.64.mac

I added :./libraries/native/x86.64.mac to the myrobotlab.sh - so the java.library.path should be ok.

The updated bash script is in change set 1005 - uploading now.

I don't think mac requires a LD_LIBRARY_PATH environment variable - (although could be dreadfully wrong) 

Hopefully this will get you pretty close - although I have enough experience to say, things don't work out perfectly the first time :)

Good luck !

Superdog

9 years 11 months ago

The GUI opens now so that's good progress but I get a java linker error.

createServices service count 2

Exception in thread "OpenCV_videoProcessor" java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1758)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1045)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:444)
at com.googlecode.javacpp.Loader.load(Loader.java:368)
at com.googlecode.javacpp.Loader.load(Loader.java:315)
at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:131)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.googlecode.javacpp.Loader.load(Loader.java:334)
at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:96)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.googlecode.javacpp.Loader.load(Loader.java:334)
at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
at com.googlecode.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:170)
at org.myrobotlab.service.OpenCV$VideoProcess.run(Unknown Source)
at java.lang.Thread.run(Thread.java:680)
 

GroG

9 years 11 months ago

Great,

I looked on the intertoobs - and it looks like mac doesnt use LD_LIBRARY_PATH like Linux.

Windows will load dynamic libraries off of PATH 
Linux uses LD_LIBRARY_PATH
Mac uses DYLD_LIBRARY_PATH ?

I added the following to the myrobotlab.sh shell script :

 

 
DYLD_LIBRARY_PATH=`pwd`/libraries/native/x86.32.mac:`pwd`/libraries/native/x86.64.mac:${DYLD_LIBRARY_PATH}
export DYLD_LIBRARY_PATH
 
...
 
You'll need to download build 1006, which is currently baking on the continuous integration server - should be done in 30 minutes..
 
Fingers crossed ..

 

 

Superdog

9 years 11 months ago

Gets the same error. I also found 100 people with the same issue and I had already tried adding the export to my bash profile.  Always a linker error with java and C.    Let me know if you think of anything else.

GroG

9 years 11 months ago

Bummer...

I have limited access to a x86.32.mac so it will take me a while to do any meaningful diagnostics...

Superdog

9 years 11 months ago

I downloaded the source and was able to get it compiled and working under NetBeans.  It doesn't run from the IDE though, I'll figure that out next.  I had to copy over the hidden .ivy folder to the dist folder that was created when I built the project.  

My mac has an HD camera which scrolls way off the screen when it turns on and I can't access the filters and sliders on the right on the openCV screen.  I'll look at that too.  

Thanks for your help and work on this project.    

GroG

9 years 11 months ago

Yay !

The .ivy folder is built when a service is installed - it is a local cache of the repo and built during runtime.

So if a complete package downloaded now from google does not work, how is it you got the shell script to work now?  What is the magic part I was missing?

You can put in a PyramidDown filter in Python while the camera is capturing.

You should be able to copy paste the following in the python tab and have it work for you.

 

 

opencv = runtime.createAndStart("opencv","OpenCV")
 
# scale the view down - faster since updating the screen is 
# relatively slow
opencv.addFilter("pyramidDown1","PyramidDown")
 
# begin capturing
opencv.capture()
 
# set focus on the lkOpticalTrack filter
opencv.setDisplayFilter("pyramidDown1")
 
Glad to hear we're making progress...