rosjava / android_apps

Applications built on top of the rosjava android libraries.
132 stars 112 forks source link

Map_Nav add layer error.. cannot draw map and set pose, lase and etc at same time #57

Open HelloEgg opened 7 years ago

HelloEgg commented 7 years ago

While I was trying to build map_nav, I noticed that add layer part has several errors.

As I touched mini view at upper right side (the occupancy layer preview), the map just disappears

and only arrows and paths appears.

I tried to fix this problem by loading separate "main activity" and two layouts.

Initially, the map appears in large scale and camera view appears in small scale (first layout, swaped view in xml file).

If I touch the camera preview at upper right side, MainActivity is loaded again with different layout (the one that is in git hub, camera view in larger scale and map in smaller scale).

This method succeeded in loading map, however, the arrow and paths did not appear.

If I press the map for a long time, arrows and paths appears and simultaneously, another arrow appears at the position I long pressed but map still disappears.

So far, I figured out that I cannot call "occupancylayout" class and "lase", "path", " initial pose" classes at the same time. In another words, if the GLsurfaceview draws laser, path and initial pose, occupancy class is not called.

However, occasionally, highly rarely, occupancylayer class is called and map is shown in a short amount of time.

Does anyone have solution to original problem or to my solution? mapView.addLayer(occupancyGridLayer); mapView.addLayer(laserScanLayer); mapView.addLayer(pathLayer); mapView.addLayer(mapPosePublisherLayer); mapView.addLayer(initialPoseSubscriberLayer); mapView.addLayer(viewControlLayer)

Thank you.

ZhuJingquan commented 7 years ago

Hi, @HelloEgg , in the make_a_map project I just using method mapView.addLayer() as follow: mapView.addLayer(viewControlLayer); mapView.addLayer(occupancyGridLayer); mapView.addLayer(laserScanLayer); mapView.addLayer(robotLayer); mapView.addLayer(robotPose); mapView.addLayer(robotPath); mapView.addLayer(viewControlLayer); but when I open the app ,I could only see the map layer, Is the problem same to your's? Have you solved the problem? Thank U~

DavidHan008 commented 7 years ago

@ZhuJingquan hi how I can use the app make_a_map. why my android do not have map?

hsiaray commented 6 years ago

same question, in the real environment, only map or laser is shown. but i can see them both when using gazebo...using the same app

xiayouli0122 commented 4 years ago

same question, when i swap views, only map or laser can show, how can i show them both? help~