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

Commit b3decf8

Browse files
committed
[map_manager] updated and compiling for indigo, but disabled add/hide 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.
1 parent 28121fe commit b3decf8

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

map_manager/src/main/java/com/github/rosjava/android_apps/map_manager/MainActivity.java

+29-16
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@
4141
import android.widget.ListView;
4242

4343
import com.github.rosjava.android_remocons.common_tools.apps.RosAppActivity;
44+
import com.google.common.collect.Lists;
4445

46+
import org.ros.android.view.visualization.layer.Layer;
4547
import org.ros.namespace.NameResolver;
4648
import org.ros.node.NodeConfiguration;
4749
import org.ros.node.NodeMainExecutor;
@@ -200,27 +202,32 @@ protected void init(NodeMainExecutor nodeMainExecutor) {
200202
nodeConfiguration = NodeConfiguration.newPublic(InetAddressFactory
201203
.newNonLoopback().getHostAddress(), getMasterUri());
202204

203-
CameraControlLayer cameraControlLayer = new CameraControlLayer(this,
204-
nodeMainExecutor.getScheduledExecutorService());
205+
CameraControlLayer cameraControlLayer = new CameraControlLayer();
205206
cameraControlLayer.addListener(new CameraControlListener() {
206207
@Override
207-
public void onZoom(double focusX, double focusY, double factor) {
208-
}
208+
public void onZoom(float focusX, float focusY, float factor) {}
209+
210+
@Override
211+
public void onDoubleTap(float x, float y) {}
209212

210213
@Override
211-
public void onTranslate(float distanceX, float distanceY) {
212-
}
214+
public void onTranslate(float distanceX, float distanceY) {}
213215

214216
@Override
215-
public void onRotate(double focusX, double focusY, double deltaAngle) {
216-
}
217+
public void onRotate(float focusX, float focusY, double deltaAngle) {}
217218

218219
});
219-
mapView.addLayer(cameraControlLayer);
220220
NameResolver appNameSpace = getMasterNameSpace();
221221
String mapTopic = remaps.get(getString(R.string.map_topic));
222222
occupancyGridLayer = new OccupancyGridLayer(appNameSpace.resolve(mapTopic).toString());
223-
mapView.addLayer(occupancyGridLayer);
223+
224+
mapView.onCreate(
225+
Lists.<Layer>newArrayList(
226+
cameraControlLayer,
227+
occupancyGridLayer
228+
)
229+
);
230+
224231
nodeMainExecutor.execute(mapView, nodeConfiguration.setNodeName("android/map_view"));
225232

226233
updateMapList();
@@ -249,10 +256,13 @@ public void onFailure(RemoteException e) {
249256
@Override
250257
public void onSuccess(PublishMapResponse message) {
251258
safeDismissWaitingDialog();
252-
if (!visibleMapView) {
253-
mapView.addLayer(occupancyGridLayer);
254-
visibleMapView = true;
255-
}
259+
// disabling temporarily until testing
260+
// this api got deprecated
261+
// see https://github.com/rosjava/android_apps/issues/42
262+
// if (!visibleMapView) {
263+
// mapView.addLayer(occupancyGridLayer);
264+
// visibleMapView = true;
265+
// }
256266
}
257267
});
258268

@@ -381,8 +391,11 @@ public void onSuccess(DeleteMapResponse arg0) {
381391
}
382392
switch (radioFocusRelation) {
383393
case 0:
384-
mapView.hideLayer(occupancyGridLayer);
385-
visibleMapView = false;
394+
// disabling temporarily until testing
395+
// this api got deprecated
396+
// see https://github.com/rosjava/android_apps/issues/42
397+
//mapView.hideLayer(occupancyGridLayer);
398+
//visibleMapView = false;
386399
radioFocus = -1;
387400
break;
388401
case 1:

settings.gradle

-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,4 @@
1717
include 'teleop'
1818
include 'map_nav'
1919
include 'make_a_map'
20-
/*
2120
include 'map_manager'
22-
*/

0 commit comments

Comments
 (0)