Jump to content




[WIP] GPS to the MAX

wireless turtle networking

10 replies to this topic

#1 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

Posted 12 October 2012 - 09:13 AM

SO.. ive been working on something i havent yet seen before on here, a GPS tower builder in two forms, the very first GPS tower you build and another program that finds the Position of the turtle and builds a tower off another towers GPS locate function

Current Version: First GPS Tower 0.2 | GPS Tower 0.1


FEATURES:
  • Calculates estimated fuel consumption
  • nice little gui interface on startup of program
  • builds towers all the way at 250 no matter where you are in the world (as long as you input the right Y Coordinates)
  • Orientation system
TODO:
  • rednet application to check when turtle is out of range of towers
  • rednet application to send turtle to build a tower in blind areas (expand the horizons)
  • smart movement to wait or go around any entity so the turtle stays on track
  • if invalid entry attempt from user to place in correct entry
  • check if numbers are numbers and strings are strings
CONS:
  • turtle sets up tower at Coordinates in front of him not where he is at
  • if not the correct vars are set it quits the program
i would love to hear some input on maybe some ideas to add to this little system i have made :)/>

file on disk named startup:

print("Starting up!")
fs.copy("/disk/startup2", "startup")



First GPS Tower (without GPS tracking)
http://pastebin.com/SUp30FTj

GPS Tower (with GPS tracking)
http://pastebin.com/uhFFB9is

My Pastebin
http://pastebin.com/u/cozzimoto



#2 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 12 October 2012 - 09:30 AM

View PostCozzimoto, on 12 October 2012 - 09:13 AM, said:

SO.. ive been working on something i havent yet seen before on here,
Did you look in the thread 5 below this one? http://www.computerc...telite-builder/

It might be another way of orienting the turtle around and I don't even know about fuel and a gui in the other one, but the result is kinda the same I guess.

#3 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

Posted 12 October 2012 - 09:34 AM

that other one only limits the turtle to go to 100
and the other one doesnt calculate the fuel it needs for the job, since mine can go up anywhere to 250 it calculates how much fuel it would need before it starts, and i just made this today and i plan on expanding on it more

#4 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 12 October 2012 - 09:36 AM

View PostCozzimoto, on 12 October 2012 - 09:34 AM, said:

that other one only limits the turtle to go to 100
and the other one doesnt calculate the fuel it needs for the job, since mine can go up anywhere to 250 it calculates how much fuel it would need before it starts, and i just made this today and i plan on expanding on it more

Cool. : ) I just wanted you te be aware of that one. :)/> I'll give yours a try later today.

#5 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

Posted 12 October 2012 - 09:39 AM

yea i saw that one before, and i didnt want to copy it. so i created my own with a few more features

#6 ChunLing

  • Members
  • 2,027 posts

Posted 12 October 2012 - 02:18 PM

The satellite launcher has been updated to go to the max height, and I made a version that checks for an existing GPS and coordinates the new array with the existing system (as well as testing for fuel level), it's included in the basic utility function I posted.

#7 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

Posted 12 October 2012 - 08:04 PM

oh i see, i didnt read that but ill check it out and see how it works compared to mine

#8 lokilotus

  • Members
  • 13 posts

Posted 26 October 2012 - 12:50 AM

Me being a bit of an idiot here, but what do you put on the disk, or is it a blank disk that it writes to? Because on my computers I have set up using firstGPStower, I'm not getting a "serving GPS Requests" line or anything else, as opposed to when I set the positions manually on the computers. Building the thing worked fine though.

Thanks in advance,

-Loki

#9 ChunLing

  • Members
  • 2,027 posts

Posted 26 October 2012 - 01:07 AM

Ah,

View PostCozzimoto, on 12 October 2012 - 09:13 AM, said:

file on disk named startup:

print("Starting up!")
fs.copy("/disk/startup2", "startup")
That should be it. I can't verify that this actually works, cause I don't know what is on startup2.



#10 Cozzimoto

  • Members
  • 221 posts
  • LocationDallas, Tx

Posted 26 October 2012 - 02:43 AM

startup2 is created by the program to put in the vars it needs and when it restarts the computer it makes sure it doesnt run that just yet so it saves it to startup then reboots the computer and runs the GPS according to the turtles position

#11 ChunLing

  • Members
  • 2,027 posts

Posted 26 October 2012 - 04:30 AM

Aha...I use a basic
	local cntntstng = [[fs.copy("disk/rnhst","rnhst") shell.run("rnhst","host",]]
	if fs.exists("rom/programs/rnhst") then  cntntstng = [[shell.run("rnhst","host",]]
	elseif not fs.exists("rnhst") then print("Must have available rnhst program to execute")
	return false end
And
   	 if fs.exists("rnhst") and not fs.exists("disk/rnhst") then fs.copy("rnhst","disk/rnhst") end
		local strtfl = fs.open("disk/startup","w")
		strtfl.writeLine(cntntstng..xPos..","..yPos..","..zPos..","..dmn..")")
		strtfl.close()
Type of thing to make sure that the turtle has a copy of the file I want to run in place of GPS, and that it runs the host with the appropriate gps coordinates. You could adapt it to be like:
local cntntstng = [[fs.copy("disk/startup2","startup") shell.run("gps","host",]]
local cntntstng2 = [[shell.run("gps","host",]]
and
	   local strtfl = fs.open("disk/startup","w")
		strtfl.writeLine(cntntstng..xPos..","..yPos..","..zPos..")")
		strtfl.close()
		strtfl = fs.open("disk/startup2","w")
		strtfl.writeLine(cntntstng2..xPos..","..yPos..","..zPos..")")
		strtfl.close()
That way you don't need to have a specific file on the disk, you just create the files you need.

Haha, whoops, normal gps program doesn't have that fourth parameter.

Edited by ChunLing, 26 October 2012 - 04:38 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users