Start a new topic

SimpleARBrowser crashes when radar added

SimpleARBrowser crashes when radar added


Sorry for late reply.

Wikitude SDK 2.1 became Version 3.0 and is available for download from June 16th onwards.

Have a look at the download page.

Kind regards,
Andreas

Hi,

 

When I can expect the RADAR to work? when are you releasing the 2.1?

 

Thank you,

Narendra

Hi Bertand,

Unfortunately there is no quick workaround for this. We will provide fix for that in upcoming update.
Maybe you can use direction indicators in your first release and add the radar component as soon as SDK 2.1 is available.

Kind regards,
Andreas

Hi Andreas,

Do you have any  workaround to fix this issue ?

We are looking for buying wikitude for 2 of our applications and this is the very last point that we need to fix.

Thank you so much for the hint, I was now able to reproduce this issue.
We'll fix it in upcoming update.

Kind regards

Hi again,

When phone locks screen, activity's onStop is called wich is not implemented in ArchitectView's lifecycle. Maybe there should be ArchitectWebView.removeAllViews() in ArchitectView's onDestroy, since that hepled me before when my custom webview caused similar problem?

Hi Andreas

All tests worked fine, but the issue remained on tests tc3 - tc6. When i lock my phone in the middle of these tests , and then try to return to app, it crashes with tihs message 04-23 19:44:05.046: A/libc(11767): Fatal signal 11 (SIGSEGV) at 0x00000004 (code=1), thread 11985 (Thread-34618)

I believe it has something to do with radar in combination with pois. When there are no pois (tc1 , tv2 or end of tests), locking is working just fine. 

 

 

Hi Marko!

Unfortunately I was not able to reproduce this issue.
Could you please run a quick test on the radar component on your device by launching the following url using

architectView.load("http://goo.gl/V0APf");

These testcases create a radar as in the attached sample-snippet

 

Hi, I'm having trouble adding radar component to SimpleARBrowser example

 

When i frist run the activity, evrything seems ok, the radar is shown with pois on it. When I minimize the app (or lock the screen( and then try to return to it,  app crashes with the following message.

 

04-21 19:40:12.109: A/libc(14459): Fatal signal 11 (SIGSEGV) at 0x00000004 (code=1), thread 14484 (Thread-9810)

 

Im developing on 4.1.2. 

 

Code for html :

 


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!-- saved from url=(0061)http://www.wikitude.com/doc/architect_tutorial/tutorial5.html -->

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

 

<title>My ARchitect World</title>

 

<!-- CSS Styles -->

<style type="text/css">

* {

margin: 0;

}

 

html,body {

height: 100%;

}

 

#footer {

height: 4em;

background-color: rgba(255, 255, 255, 0.5);

padding: 5px 10px;

display: none;

position: absolute;

bottom: 0px;

left: 0px;

right: 0px;

moz-border-radius: 10px;

-webkit-border-radius: 10px;

-khtml-border-radius: 10px;

border-radius: 10px;

}

 

/* CSS Style for status message at the top of the HUD */

.status {

border-radius: 2em;

border: solid 2px #6d6d6d;

background-color: rgba(256, 193, 0, 0.7);

color: black;

text-align: center;

font-weight: bold;

position: absolute;

width: 90%;

height: 5%;

left: 5%;

top: 1%;

}

}

</style>

 

<!-- Include the ARchitect library -->

<script src="architect://architect.js"></script>

 

 

</head>

 

<body>

<script>

// Tutorial code using the ARchitect Javascript library

 

// Create new images, which will be loaded right away

firstImage = new AR.ImageResource("marker1.png", {

onError : errorLoadingImage

});

secondImage = new AR.ImageResource("marker2.png", {

onError : errorLoadingImage

});

thirdImage = new AR.ImageResource("marker3.png", {

onError : errorLoadingImage

});

 

AR.radar.background = new AR.ImageResource("radar_bg.png");

AR.radar.positionX = 0.01;

AR.radar.positionY = 0.01;

AR.radar.width = 0.4;

AR.radar.centerX = 0.5;

AR.radar.centerY = 0.5;

AR.radar.radius = 0.4;

 

AR.radar.northIndicator.image = new AR.ImageResource("radar_north.png");

AR.radar.northIndicator.radius = 0.0;

 

AR.radar.enabled = true;

 

// current selected object

var selectedObject = null;

 

//variable that keeps the jsonData received from the native app

var jsonObject;

 

//function that gets called when the displayed poi bubble is clicked

//sends the id of the selected poi to the native app

function generateOnPoiBubbleClickFunc(id, name, description) {

return function() {

document.location = "architectsdk://opendetailpage?id=" + id

+ "&name=" + encode(name) + "&description="

+ encode(description);

}

}

 

// creates a property animation

function createOnClickAnimation(imageDrawable) {

var anim = new AR.PropertyAnimation(imageDrawable, 'scaling', 1.0,

1.2, 750, new AR.EasingCurve(

AR.CONST.EASING_CURVE_TYPE.EASE_OUT_ELASTIC, {

amplitude : 2.0

}));

return anim;

}

 

// creates a function for assigning to label's and imageDrawable's onClickTrigger

function createClickTrigger(id, name, description) {

return function() {

// hide the bubble

document.getElementById("footer").style.display = 'block';

document.getElementById("poiName").innerHTML = jsonObject.name;

document.getElementById("poiDesc").innerHTML = jsonObject.description

.substring(0, 25);

document.getElementById("footer").onclick = generateOnPoiBubbleClickFunc(

id, name, description);

 

// reset the previous selected poi

if (selectedObject != null) {

// reset the property animation

if (selectedObject.animation) {

selectedObject.animation.stop();

}

 

selectedObject.arLabel.style.backgroundColor = '#FFFFFF80';

selectedObject.drawable.scaling = 1.0;

selectedObject.poiObj.renderingOrder = 0;

}

 

// set a new select status for the current selected poi

selectedObject = jsonObject;

selectedObject.arLabel.style.backgroundColor = '#FFFFFFFF';

selectedObject.poiObj.renderingOrder = 1;

 

// start the assigned animation

if (selectedObject.animation) {

selectedObject.animation.start();

}

 

return true;

}

}

 

//function called from the native app fia callJavascript method

//receives json-data as string and processes the contained information

function newData(jsonData) {

jsonObject = jsonData;

document.getElementById("statusElement").innerHTML = 'Loading JSON objects';

var radarCircle = new AR.Circle(0.05, {

style : {

fillColor : '#83ff7b'

}

});

 

for ( var i = 0; i < jsonObject.length; i++) {

var poidrawables = new Array();

 

var drawable;

var label;

 

if (jsonObject.type < 4) {

label = new AR.Label(jsonObject.name, 1.0, {

offsetY : -1.5,

triggers : {

onClick : createClickTrigger(jsonObject.id)

},

style : {

textColor : '#FFC100',

backgroundColor : '#FFFFFF80'

}

});

 

var poiImage;

if (jsonObject.type == 1) {

poiImage = firstImage;

} else if (jsonObject.type == 2) {

poiImage = secondImage;

} else {

poiImage = thirdImage;

}

 

drawable = new AR.ImageDrawable(poiImage, 2.0, {

triggers : {

onClick : createClickTrigger(jsonObject.id,

jsonObject.name,

jsonObject.description)

}

});

jsonObject.animation = createOnClickAnimation(drawable);

} else {

label = new AR.Label(jsonObject.name, 1.0, {

offsetY : -1.5,

style : {

textColor : '#00C100',

backgroundColor : '#FFFFFF80'

}

});

drawable = new AR.Model("Build11.wt3");

}

 

jsonObject.arLabel = label;

jsonObject.drawable = drawable;

 

poidrawables.push(label);

poidrawables.push(drawable);

geoLoc = new AR.GeoLocation(jsonObject.Point.latitude,

jsonObject.Point.longitude,

jsonObject.Point.altitude);

jsonObject.poiObj = new AR.GeoObject(geoLoc, {

drawables : {

cam : poidrawables,

radar : radarCircle

}

});

}

 

document.getElementById("statusElement").innerHTML = 'JSON objects loaded';

 

}

 

// Called if loading of the image fails.

function errorLoadingImage() {

// set error message on HUD

document.getElementById("statusElement").innerHTML = "Unable to load image!";

}

 

// hide bubble and reset the selected poi if nothing was hit by a display click

AR.context.onScreenClick = function() {

// hide the bubble

document.getElementById("footer").style.display = 'none';

 

// and reset the current selected poi

if (selectedObject != null) {

// reset the property animation

if (selectedObject.animation) {

selectedObject.animation.stop();

}

 

selectedObject.arLabel.style.backgroundColor = '#FFFFFF80';

selectedObject.drawable.scaling = 1.0;

selectedObject.poiObj.renderingOrder = 0;

selectedObject = null;

}

}

 

function encode(str) {

var result = "";

 

for (i = 0; i < str.length; i++) {

if (str.charAt(i) == " ")

result += "+";

else

result += str.charAt(i);

}

 

return escape(result);

}

 

function decode(str) {

var result = str.replace(/+/g, " ");

return unescape(result);

}

 

function poiMarker(_imageResource, poiRepresentation, _geoLoc,

_geoObject, _animationOffse) {

 

}

</script>

 

 

<!-- Status element at the top of the HUD -->

<div id="statusElement" class="status"></div>

<br />

<br />

<br />

<div id="footer">

<h3>

<span id="poiName"></span>

</h3>

Description: <span id="poiDesc"></span><br />

<p style="text-align: center;">click for more...</p>

</div>

</body>

</html>


 
Login or Signup to post a comment