Start a new topic

Problem with architectView.setLocation

Problem with architectView.setLocation

I think I found the problem, this "altitude": 100.0 give the problem


sample code

if (!World.initiallyLoadedData) {

            /* Creates a poi object with a random location near the user's location. */

            var poiData = {

                "id": 1,

                "longitude": (lon + (Math.random() / 5 - 0.1)),

                "latitude": (lat + (Math.random() / 5 - 0.1)),

                "altitude": 100.0

            };


My modification, problem, "altitude": alt also got a problem

if (!World.initiallyLoadedData) {
/* Creates a poi object with a random location near the user's location. */
var poiData = {
"id": 1,
/*"longitude": (lon + (Math.random() / 5 - 0.1)),
"latitude": (lat + (Math.random() / 5 - 0.1)),*/
"longitude": lon,
"latitude": lat,
"altitude": (0.0 + alt)
};

what should be the correct way of passing parameters and the Geo object to user relationship, especially the altitude?


architectView.setLocation(location.getLatitude(), location.getLongitude(), location.getAltitude(), accuracy);


I send in by 5.0 + location.getAltitude() also not working correctly.

the 
document and example are not very clear too.

by the way, I also like to know how to set the altitude for the Geo Object (yellow cyclinder) for the example below, let us said.

LAT1 = 1.3250652, LOG1=103.8908282 Altitude = 20.8099365234375 (phone info)

LAT2 = 1.3250684, LOG1=103.89083 Altitude = 25.809937


image


Hi,


As the documentation says, the altitude should be the current altitude of the device in meters. In case you don't know the exact value, I would suggest you to put the altitude to AR.CONST.UNKNOWN_ALTITUDE, which will put the poiData on the user-level -> our Selecting Pois sample should show the behaviour of this value. Nevertheless, I see that our implementation may cause some confusion and I'll review it to see how can we improve it.


Regards,


Aitor.

version 9.6.0, "altitude": AR.CONST.UNKNOWN_ALTITUDE will have the same result where the geo object is missing and the indicator is pointing, like "altitude": (0.0 + alt) behaviour.

Hi,


Did you try our sample app to check if that implementation is working on your device? It could give you a clue of what's going on. Another question I would have is, do you know if the POI is properly loaded? With this I'm asking if the AR.GeoObject drawable is successfully created with your implementation.


Regards,


Aitor.

Hi Aitor


Kindly try the following implementations (1,2,3) on Wikitude 9.6.0 examples 08_PointOfInterest_4_SelectingPois to see the AR engine problem.


1. "altitude": (2.0 + alti),

2. //"altitude": alti,

3. //"altitude": AR.CONST.UNKNOWN_ALTITUDE,

js
js
(13.8 KB)
java

Hi,


I did try by downloading our sample app from scratch and the POIs were always shown in my case. What I could see as an issue is that I set the altitude to 100 and the position was the same than AR.CONST.UNKNOWN_ALTITUDE. Nevertheless, I couldn't reproduce your issue where the POIs are not shown at all. Do you have a chance to test this with a second device?


Regards,


Aitor.

Hi Aitor


What is your distance between the Geo Object and the test device?

Have you tried to replace the original sample with my 3 sample files?

Have you tried these values?

1. "altitude": (2.0 + alti),

2. //"altitude": alti,

3. //"altitude": AR.CONST.UNKNOWN_ALTITUDE,


08_PointOfInterest_1_PoiAtLocation sample is 100. when you change to ALT send from SimpleGeoArActivity.java see what happen.

Hello Jai Gay,


I see that this thread covers a lot of instructions and details provided by Aitor and I’d like to add details to our support process in general to manage your expectations. 


For questions such as the one we’re dealing in this thread, our approach is to give instructions and ideas on how to solve the problem, links to the Wikitude documentation and samples. We’re not providing 3rd party development and therefore can’t implement any code or samples. As the support is done by our core team to ensure a high quality support process, I hope you can understand that we need to work efficiently.


Ideally you make sure that you fully understand the sample app and work together with the documentation. 


Again we want to thank you for your understanding.

Wikitude Support Team

Hi Wikitude Support Team


fine, but before I can justify to my management on purchasing a license.


In the document, it did not mention a range a user can input to the altitude parameter.

I like to know what is the range?

altitude (defaults to AR.CONST.UNKNOWN_ALTITUDE) Number optional

The altitude of the location, in meters.


By the way, the 3 files I had attached are NOT from 3rd party but a modification to Wikitude sample files.

close, the document is not well documented to explain the relationship between the user and AR object location, how the API/Engine works in the background. Realize the problem after using the distanceToUser and search in the forum then I know where the implementation is coded wrongly.

Is a very bad implementation approach when a user calls the setLocation API, in the background the Lat, Lot was the user location parameter, and in the example, it then set up an object location in Javascript.


It should have setUserLocation and setObjectLocation java APIs where developers may want to compute and the location of user and object at Java or Kotlin level.

Login or Signup to post a comment