Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Indigo camera update required #42

Open
stonier opened this issue Feb 23, 2015 · 9 comments
Open

Indigo camera update required #42

stonier opened this issue Feb 23, 2015 · 9 comments
Labels
Milestone

Comments

@stonier
Copy link
Contributor

stonier commented Feb 23, 2015

Most of the apps utilised the old Camera class which got updated for indigo. This stops map_nav, make_a_map, map_manager from compiling.

  • Camera -> XYOthographicCamera.
  • camera.toMetricCoordinates() -> camera.toCameraFrame()
  • FrameName->GraphName
  • draw(gl) -> draw(view, gl)
  • onStart(node, handler, frametree, camera) -> onStart(view, node)
  • camera -> view.getCamera()
  • frameTransformTree -> view.getFrameTransformTree()
  • view.addLayer() -> view.onCreate(Lists.<Layer>newArrayList(layer_a, layer_b));
  • handler.post() -> view.pose()
@stonier stonier changed the title indigo camera update required Indigo camera update required Feb 23, 2015
@stonier stonier added the bug label Feb 23, 2015
@stonier stonier added this to the Igloo milestone Feb 23, 2015
stonier added a commit that referenced this issue Feb 23, 2015
This updates the api for indigo with the changes discussed in #42.
@stonier stonier self-assigned this Feb 23, 2015
stonier added a commit that referenced this issue Feb 23, 2015
This updates the api for indigo with the changes discussed in #42.
@stonier
Copy link
Contributor Author

stonier commented Feb 23, 2015

Disabled temporarily the map manager addLayer, hideLayer since that api got deprecated and there is no replacements for them. Fix when we test them. The api changes are in rosjava/android_core@5505432

stonier added a commit that referenced this issue Feb 23, 2015
… layers.

This updates the api for indigo with the changes discussed in #42. It couldn't
replace the add/hide layers (that toggle the occupancy grid map) though. Fix
this when we have a turtlebot to test with.
@HelloEgg
Copy link

I cloned "android_apps" repository
and changed "mapview.addLayer" to
mapView.onCreate(Lists.newArrayList(viewControlLayer,occupancyGridLayer,laserScanLayer,pathLayer,mapPosePublisherLayer,initialPoseSubscriberLayer));
However, error occured when I connected to my robot saying:

Process: com.github.rosjava.android_apps.map_manager.indigo, PID: 21230
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.IllegalStateException: setRenderer has already been called for this instance.
at android.opengl.GLSurfaceView.checkRenderThreadState(GLSurfaceView.java:1935)
at android.opengl.GLSurfaceView.setEGLConfigChooser(GLSurfaceView.java:470)
at android.opengl.GLSurfaceView.setEGLConfigChooser(GLSurfaceView.java:539)
at org.ros.android.view.visualization.VisualizationView.onCreate(VisualizationView.java:81)
at com.github.rosjava.android_apps.map_manager.MainActivity.init(MainActivity.java:225)
at org.ros.android.RosActivity$2.doInBackground(RosActivity.java:204)
at org.ros.android.RosActivity$2.doInBackground(RosActivity.java:201)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

Do you have any suggestion what I should do?

@adamantivm
Copy link
Contributor

@HelloEgg can you share a bit more information on what you did in order to get to this point?

For example:

  • Did you change anything in the build configuration, like the version of Gradle?
  • What version of Android Studio are you using?
  • On what Android device (and which version of Android) are you running?

Any other relevant environment information that you can share would be helpful. Thanks!

@HelloEgg
Copy link

Well I havent change Gradle version..
I use the newest version of android studio
And I use Galaxy s6 Marshmellow(api23)
Do you happen to have a project file that has successfully ran on android device?
Thank you very much for your help... I am dire for solution as I have been pulling my hears off for past few days figuring out possible way to run "map_nav" and other apps in "android_apps" repository...

I changed the

@adamantivm
Copy link
Contributor

@HelloEgg my impression is that perhaps some instance of addLayer replacement was missed. I am trying myself and I see that the errors pointed at by the exception are places where I forgot to change the API as suggested on #51.
Perhaps may I suggest that you create a PR to indigo with your code changes? That will allow myself (and others) to see exactly how are you doing what is suggested in #51 to give better advice and, when it works, we can merge it as a temporary workaround so that life will be easier for the next one.

@HelloEgg
Copy link

HelloEgg commented Jan 12, 2017

Sure thank you very much!
You suggest that I should make a seperate tree?
(Sorry I relatively newb to git)
I tried the "MainActivity" code suggested by stonier as shown in the source code..
The original error(doInbackground) is fixed however new error came up though...
It says:
Process: com.github.rosjava.android_apps.map_nav.indigo, PID: 25063
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.opengl.GLSurfaceView$GLThread.surfaceCreated()' on a null object reference
at android.opengl.GLSurfaceView.surfaceCreated(GLSurfaceView.java:629)
at android.view.SurfaceView.updateWindow(SurfaceView.java:712)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:209)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1014)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2560)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1487)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7450)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
at android.view.Choreographer.doCallbacks(Choreographer.java:695)
at android.view.Choreographer.doFrame(Choreographer.java:631)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Seems like android studio cannot catch "surface created"
as it says 'null pointer error'..

The "MainActivity"code is exactly same with what stonier fixed (9e780b4)
What do you think to be a problem??
Thank you very much for your help guys..

@adamantivm
Copy link
Contributor

@HelloEgg I think I know what the problem is: you're probably using the master branch? That one is currently obsolete. You should try using the indigo or kinetic branch instead, which already has this change applied to it.

@HelloEgg
Copy link

I tried both indigo and kinetic branch

I noticed that the "addlayer" part was still not fixed..

Should you know any repository that fixed right..
Please tell me

@adamantivm
Copy link
Contributor

I tried a few things and I agree with you that even with the addLayer fixes (they were added again afterwards) map_nav still crashes.
I am not sure what to suggest next, it needs more profound debugging to be fixed, it is currently broken.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants