Jump to content




[How to guide] GPS Global Position System


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

#21 KelticRaven

  • New Members
  • 3 posts
  • LocationRocky Mountains

Posted 20 November 2012 - 09:04 AM

Hey BigSHinyToys,

I am working on a way to allow an Airship to move via the Cartesian Coordinate system and it came to me that perhaps a Computer from Computer Craft would be able to talk to a GPS system to do so. IE: the computer asks for a target location via XYZ coordinates, then calculates it's current location and then slowly move (the only way you can move with Frame Motors) from point A to point B.

1) Do you think that is possible?
2) What would be the best way to implement said system?

I assume that we would need to set up at least 1 GPS system, if not more then one... say about 4. Each station with a full 4 rig setup and have them talk to each other via the RedNet system already in the world. With at least one full on HOST system setup in the GPS Ring. Looking at the above image of the overlapping GPS rings would show how a multiple GPS system would allow for longer distances to be reached/mapped.

I understand that it would take some time to program this... in fact I already have a working check list started on this very subject. I would welcome any input you could provide. Thank you in advance for your time & assistance on this matter.

KelticRaven

#22 BigSHinyToys

  • Members
  • 1,001 posts

Posted 20 November 2012 - 10:07 AM

@KelticRaven

in the case of an air ship it would probably be better to have a turtle in the ship flying it and that turtle storing its location in a file inside the turtle. Turtles return true if they have moved and false if they haven't this can be harnessed to make a turtle fly blind with out GPS cluster set up if you tell it its starting location. I would have one GPS cluster just as a point of reference if something goes wrong you will know where you are because of the cluster. as for making the ship go places if there is no obstacle then a simple move on Z then move on Y then Move on Z program should do it. If you want to avoid obstacle then a more complex program would be needed but I'm guessing you want to stay hight above the ground.

To summarize:
A turtle flying the ship storing its location and changing that every time it moves. the smart move API might be of assistance I haven't worked with it but it should have a tracking system for turtle movement. It would get its starting location from the GPS cluster but from then on would not require to be in range This would allow you to fly any ware you want and not worry about range to clusters.

#23 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 20 November 2012 - 02:58 PM

For the purposes of a tutorial, it would be better to use Minecraft's (significantly more sensible) coordinate system and axis assignments. Preventing confusing amongst the readers is more important in a tutorial setting than promulgating your own opinions on which axis should be what.

#24 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 20 November 2012 - 04:18 PM

You do realize that the picture is completely backwards, right?

#25 BigSHinyToys

  • Members
  • 1,001 posts

Posted 21 November 2012 - 12:50 AM

View PostLyqyd, on 20 November 2012 - 02:58 PM, said:

For the purposes of a tutorial, it would be better to use Minecraft's (significantly more sensible) coordinate system and axis assignments. Preventing confusing amongst the readers is more important in a tutorial setting than promulgating your own opinions on which axis should be what.
I can only respond to this by saying dan200 doesn't like people using the real coordinates. and using a debugging too s as a gps is a cheat / hack. that said if you pay the game and ignore that tool with will likely be removed at some point then using the real world system on coordinates would make more sense. If would would like to remove this tutorial and replace it will one you conciser correct I would ask you consult with dan200 or Cloudy first before doing so.


View Posttiin57, on 20 November 2012 - 04:18 PM, said:

You do realize that the picture is completely backwards, right?
what is backwards ??

#26 leftyisgod

  • New Members
  • 1 posts

Posted 13 December 2012 - 03:29 PM

I have a redpower mobile quarry with an attatched computer and modem. I also have a gps tower set up. I would like to make the computer send a pulse to a specified bundled cable color (diff color wire to a diff frequency to each motor moving the quarry) could someone give me an example on the ways/ codes to do this? i have done simple programs but not anything this big. Thank you for any help

#27 AngelMalus

  • Members
  • 17 posts
  • LocationTokyo, Jpn

Posted 29 December 2012 - 04:45 PM

I have done this on my AirShip. At first I used a RedPower computer, because they don't loose their texture when moved by frames, but then I upgraded to tekkit 3.1.3 and I can move ComputerCraft computers on the ship.
My computer controls several transmiters that control the engine of the ship. 6 for the 6 axis movement.
It uses a bundleded cable output to acheive this.
As for the GPS system, I must warn you, it can go out of range pretty quick, so you will need to scatter GPS towers around where you want to travel.
Also make sure to have a world anchor on your ship so it will not have problems on unloaded chunks.
(horrible things can happen to your ship if you don't have that, I found my ship slashed in 2 and separated by 8 blocks)
I have several ways to control the ship. with multiple remote controls, from docking stations (airports), from on board.

So to answer your questions:

1) Do you think that is possible?
Yes is possible

2) What would be the best way to implement said system?
I used a computer (not a turtle as suggested earlier), using bundled cables, controlling transmitters.
As for the GOTO program. I have a GoToXZ function where I provide the final destination, and it will start looping pulses to the engine until it reaches the destination. A normal computer can read its own location using gps.locate() same as the turtles.

The fun part is to make everything stick into panels.

#28 FalloutBe

  • Members
  • 21 posts

Posted 30 December 2012 - 02:48 AM

View Postleftyisgod, on 13 December 2012 - 03:29 PM, said:

I have a redpower mobile quarry with an attatched computer and modem. I also have a gps tower set up. I would like to make the computer send a pulse to a specified bundled cable color (diff color wire to a diff frequency to each motor moving the quarry) could someone give me an example on the ways/ codes to do this? i have done simple programs but not anything this big. Thank you for any help
It seems I am trying to do exactly the same thing.
I've set up 4 computer modems for the GPS signal. There is a computer on the quarry with also a modem attached.
My code is not yet finished, but I'm able to do 'goto x y z' and then it requests it current position, substracts that from the destination coordinates, and the result of that is how many blocks it needs to move.
So that result, is the count for the for loop.
Here is the (simple, not yet finished) code:

Spoiler


#29 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

Posted 30 December 2012 - 05:42 AM

just an fyi to the OP the gps prgram does not use Triangulation because Triangulation uses angles to find its distance to whatever you are using. computers cant get the angles from point a to b and Triangulation requires 3 nodes. the GPS program that is in computercraft uses Trilateration which uses 4 nodes and does not require angles at all but uses math to find a position using straight distance from one point to another.

http://en.wikipedia....i/Trilateration

#30 Hawkertech

  • Members
  • 9 posts

Posted 01 January 2013 - 09:45 PM

View PostBigSHinyToys, on 29 August 2012 - 11:50 AM, said:

This is a Experimental and possibly bug riddled code

GPS builder turtle program.

This program sends a turtle up as far as it can go then builds a GPS cluster


Instructions < Reed

[WARNING] This is experimental code there are probably bugs and errors in it you may loose items when using this. I give no Warner to this code. use at your own risk

if you already have working GPS in your world DON'T USE THIS it will cause you a Big problems

I would recommended tying this out in a New creative world before using it in a real survival world so you know what is does.

place a turtle can be mining or normal WIFI not required.


place turtle with a clear path to the sky (no trees or obstacle above it)

add 600 fuel (one bucket of lava is 1200)
add 4 computers to slot 1
add 4 wifi modems to slot 2
If you are using a Mining turtle then you only need one disk drive in slot 3 and you will get it back. if you are not using a mining turtle then you will need four disk drives in slot 3
place a BLANK disk in slot 4


RUN this program.
Spoiler

press Enter when you have it set up correctly and it will fly up into the sky place Computers turn them on and comeback down.

There is no back door into the computers so ounce they are up there they are staying there you can edit there code after this.

all going well your turtle returns with the disk to ground level. Report bugs here and I will hunt them down.
I just tested this in my ssp, it isn't rebooting the computers.

#31 BigSHinyToys

  • Members
  • 1,001 posts

Posted 02 January 2013 - 12:59 AM

A limit was placed on how fast a computer could reboot its self this is because having a lot of computers constantly rebooting can cause a lot og lag on servers I have adapted the code to cope with this.
http://pastebin.com/gLTwfr8V

#32 geech

  • Members
  • 19 posts

Posted 03 January 2013 - 07:40 AM

Um, I think I found an error, (feel free to troll me if i'm wrong).

But isn't the Y coordinate the vertical coordinate?
Then this would make Z north to south...

#33 usmc3891

  • Members
  • 5 posts

Posted 04 January 2013 - 12:41 PM

I've changed your code a little bit to allow for the minecraft coord system. Because of my very limited coding experience the turtle has to be facing west for the coords to be correct. It will prompt you for the x and z coords first before launching, Tell me what you think :)

http://pastebin.com/kiSuDf0Z

#34 bruteman

  • New Members
  • 8 posts

Posted 05 January 2013 - 04:20 PM

View Postusmc3891, on 04 January 2013 - 12:41 PM, said:

I've changed your code a little bit to allow for the minecraft coord system. Because of my very limited coding experience the turtle has to be facing west for the coords to be correct. It will prompt you for the x and z coords first before launching, Tell me what you think :)

http://pastebin.com/kiSuDf0Z

just tried this Pastebin I am not sure where its going wrong it starts to launch after fuel filling it up etc it just moved 2 blocks forward and places a computer and then backs up places a modem on the grass and then sits there.

i am in a mystcraft age if this matters or not?

Edit: himm must have been because it was raining i re-ran this a 3rd time in sunshine daytime and it worked.

#35 usmc3891

  • Members
  • 5 posts

Posted 05 January 2013 - 05:50 PM

I found that the only time it did that to me is when i was standing on top of the turtle. I tried to ride it up lol.

#36 Someguy123

  • New Members
  • 12 posts

Posted 06 January 2013 - 02:20 AM

I had some issues with this set up with one of my turtles, it kept complaining of an ambiguous position, I fixed it simply by placing another computer on a nearby hill and had that run a GPS server too.
Great guide though, it's very easy to follow and I got my GPS system up and running quickly.

#37 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 06 January 2013 - 08:04 PM

most of the time the abuguous position contains a decimal point wich you can simply filter out giving you one definate position
ill post a suggestion to fix it later

#38 DrCeph

  • Members
  • 11 posts

Posted 07 January 2013 - 08:13 PM

BSH, thanks for this tutorial mate, really helped clear things up for me!

One observation with the GPS program, I think there may be an offset error with z (vertical):

I launched the turtle from a level where my feet position (y) shows as level 64. However once I've seeded the gps and place a computer/turtle at the same place I launched from, I get a z-coord of 65. If I go down to the lowest bedrock level (i.e only one bedrock block between me and void) feet loc shows as 1 whereas GPS z shows as 2.

Either this is an offset error, or the feet pos in the minecraft debug gives the coord of the block below the feet.

#39 BigSHinyToys

  • Members
  • 1,001 posts

Posted 07 January 2013 - 10:35 PM

View PostDrCeph, on 07 January 2013 - 08:13 PM, said:

BSH, thanks for this tutorial mate, really helped clear things up for me!

One observation with the GPS program, I think there may be an offset error with z (vertical):

I launched the turtle from a level where my feet position (y) shows as level 64. However once I've seeded the gps and place a computer/turtle at the same place I launched from, I get a z-coord of 65. If I go down to the lowest bedrock level (i.e only one bedrock block between me and void) feet loc shows as 1 whereas GPS z shows as 2.

Either this is an offset error, or the feet pos in the minecraft debug gives the coord of the block below the feet.
looks like turtles can go to the highs block location or the lowest for some reason correction made to code thanks for pointing that out.

GPS Builder ALPHA v0.2 http://pastebin.com/gLTwfr8V

#40 Niederlenz

  • New Members
  • 1 posts

Posted 07 February 2013 - 11:50 PM

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users