Jump to content




[How to guide] GPS Global Position System


  • You cannot reply to this topic
51 replies to this topic

#41 BigSHinyToys

  • Members
  • 1,001 posts

Posted 08 February 2013 - 12:08 AM

View PostNiederlenz, on 07 February 2013 - 11:50 PM, said:

How do I get the coords of my turtle like this?

There is a program that CC comes with called "gps" to Quote the help file from it

Quote

gps can be used to host a GPS server over rednet, or determine a position using trilateration.
Type "help gpsapi" for help using GPS functions in lua programs.

ex:
"gps locate" will connect to nearby GPS servers, and try to determine the position of the computer or turtle.
"gps host" will try to detemine the position, and host a GPS server if successful.
"gps host 10 20 30" will host a GPS server, using the manually entered position 10,20,30.

Take care when manually entering host positions. If the positions entered into multiple GPS host
are not consisent, the results of locate calls will be incorrect.

if you want to get that information from inside a program you can use the gps api to quote the help files.

Quote

Functions in the GPS API:
gps.locate( timeout )

The locate function will send a signal to nearby gps servers, and wait for responses before the timeout. If it receives enough responses to determine this computers position then x, y and z co-ordinates will be returned, otherwise it will return nil. If GPS hosts do not have their positions configured correctly, results will be inaccurate.


#42 MrFrostmaul

  • Members
  • 15 posts

Posted 23 February 2013 - 01:47 AM

Very helpful and easy guide to understand

#43 WAKU

  • Members
  • 3 posts

Posted 12 March 2013 - 04:26 AM

excellent!
That's what i need!

#44 Simtimzero

  • Members
  • 3 posts

Posted 21 March 2013 - 09:37 PM

Woot, thanks a lot for this tutorial. Never used the GPS feature before and its proving to be a huge help in my train station project =D.

#45 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 22 March 2013 - 02:40 AM

o.o train station?
a gps powered train station would be epic

#46 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 22 March 2013 - 02:41 AM

how would that even work?! o.O

#47 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 22 March 2013 - 03:06 AM

turtles find position, turtles send data to main host, turtles log whenever someone passes

#48 slango20

  • Members
  • 43 posts

Posted 31 March 2013 - 10:32 AM

what was the picture before you fixed it?

#49 aaa

  • Members
  • 53 posts

Posted 11 July 2013 - 06:47 PM

The position is computed with the distance to the computers. Take 3 of them, and draw the plane that contain them. If you try to locate a turtle which is in a certain position, then the symmetric point at the other side of the plane have the same distances to the computers. that's why we need 4 of them, not in a plane.

#50 RoD

  • Members
  • 313 posts

Posted 22 July 2013 - 11:19 AM

you have a typo at line 62 it says "mineing" i think you mean "mining" :P

#51 Anavrins

  • Members
  • 775 posts

Posted 25 November 2013 - 05:47 PM

Might be a good idea to mention to always use coordinates that are between parentheses, because the ones with decimals will error by one when there's negative coordinates.

#52 buzzy613

  • Members
  • 3 posts

Posted 10 December 2013 - 01:21 AM

View PostChunLing, on 03 August 2012 - 07:47 PM, said:

The GPS api itself doesn't do anything other than figure out positions based on existing positions, but your turtles can also act as GPS hosts themselves once they get their own positions. Because they can also transmit rednet wireless messages, it means that you could have all the turtle positions sent back to a central console from which you can see where they all are, and could even give them new orders on the fly (so to speak).
You could set up a monitor that shows the positions of all your turtles on a map of sorts.
would look awesome!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users