cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

How to simulate position tracking in Thingworx?

tyadav
1-Newbie

How to simulate position tracking in Thingworx?

Hi,

I have been a doing a project in Thingworx and I need to simulate the position tracking for my things. For eg: If I have a car as a Thing, and it has two modes moving and stopped. I need to simulate the changing latitude and longitude for the car when it is in 'moving' state and store the generated coordinates so that they can be later displayed on the Google map widget in the mashup. Similarly, if the car is stopped then it should display the location where it was last stopped. I have the following questions:

1. How do I achieve this? As in, should I create and use a service or a subscription (with speed values as the trigger)?

2. What sort of code snippet will be required for such a functionality?

3. Should I employ the Google api?

Thanks!

3 REPLIES 3
PaiChung
22-Sapphire I
(To:tyadav)

at one point in time i created something that was a simulator for this.

Basically I created:

1. a geofence

2. 'cars'

3. a Timer

4. each time the timer finished, i would increment lat/long randomly by like .001 or something

then based on some other rules i would either turn them on or off and keep them within the geofence

Hey Pai,

Thanks for your reply and I was thinking along the same lines but how did you make sure that the cars were reasonable moving in the coordinates of a particular road or something like that while you were incrementing the lat/long?As in, it didn't show the car moving in a jungle or a water body? I understand that while simulating we always take rough estimate but the water and jungle thing etc. could affect the data.

Also for eg: if my output variable for location is me.Location and the datatype is location then what exactly should be the syntax to provide this variable with the values of Lat/long so that it shows up on map and datatables in the correct format?

Thanks!

PaiChung
22-Sapphire I
(To:tyadav)

What i did wasn't perfect, ie you could be moving through buildings etc. but I first created a geofence and did a verification that the vehicle didn't move outside of the geofence.

Top Tags