This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
BigSHinyToys's profile picture

[Peripheral][LIDAR] Laser Detection and Ranging

Started by BigSHinyToys, 02 May 2012 - 01:25 AM
BigSHinyToys #1
Posted 02 May 2012 - 03:25 AM
[LIDAR] Laser Detection and Ranging

is a system that uses lasers to measure an objects distance.basically it does this by sending a pulse of light to the object and measuring how long it takes to return.

In computer craft currently turtles are only capable of detecting objects that they directly are touching. What I am proposing is a LIDAR Peripheral device capable of accurate measurements over much larger distances.

How It would work

The LIDAR Peripheral would be placed on a computer or built into a turtle in a crafting grid. It would be called similar to how monitors work. ounce activated the LIDAR would respond to these commands.

lidar.move(deg,deg) this would change the angels that the laser is pointing at.
lidar.range() this would return 1) the distance to object along the current heading set by lidar.move
and 2) if the object was moving with a true false. the second would be true if any mob or player is in the way of the beam but would be false for all blocks. turtle .compare would not work over these distances (to keep is some what balanced.) lidar.range() would return nil if pointed at something out side its range or pointed at the top or bottom void as well as unloaded chunks

This combined with the GPS system would allow players to write programs that scan and record the landscape around them. they would also be able to be used as a mob detection when placed on a Computer.

Pictures to illustrate idea.
Spoiler


For more info on LIDAR see

http://en.wikipedia.org/wiki/LIDAR
Zalerinian #2
Posted 02 May 2012 - 04:21 AM
Thats a very interesting and complex concept. If you could manage to code it, by all means go ahead. I'm sure it could have multiple uses, such as a gateway for combat enabled turtles(dropping bombs or gravel/sand, or even triggering traps).
BigSHinyToys #3
Posted 02 May 2012 - 04:55 AM
I don't know java so I cant make this. That said I think that a basic vector line collision test triggered by the above mentioned functions would do the trick. (I'm probably way off though)
Zalerinian #4
Posted 02 May 2012 - 04:59 AM
unfortunately, i am only 15, so I barely have a clue what you just said, sorry :x
BigSHinyToys #5
Posted 02 May 2012 - 05:07 AM
Spoilervector is basically a line from one co-ord to another co-ord. example a line running from 1,1 to 2,2
in the case of the LIDAR it would be a line running from the turtle along the given angles to the maximum distance it can scan

collation test means check whether this line collides (hits) any objects (mobs or blocks)
so we would test for the first thing to be in the way of the line.

(Like i said I'm no programmer so I don't know if this is the best way to do it or even if it is possible.)ED
[EDIT]
tomass1996 description bellow is more accurate than mine.
Xtansia #6
Posted 02 May 2012 - 07:15 AM
Technically a vector is something with a magnitude and direction,
which can be represented by a line such as a line 10 long and a direction of 037 degrees,
Collision testing being just to see if the 'lines' intercept each other.
sk_2013 #7
Posted 04 May 2012 - 05:23 AM
I guess the question is one of "Do we want to employ this as designed?"
I mean, it's possible to do this in java, not even really difficult, if a little time-consuming. More importantly, I could write a similar script that merely detects what is around it. I'm not sure how much modeling a LIDAR array (you typically need two for a proper array) would lag a client, but if it goes to SMP it will have to be entirely client based, with the server side just checking for hacking.

For those of you who skipped the above paragraph:
How important is it that we accurately model LIDAR?

Frankly, the biggest use that I see for this is either automated defenses (a reason to use the main design: going from testing a vector to firing arrows is a minor change) or distance based controls for a turtle (i.e. stop when 10 blocks away from the next block in front of you, Warning: Cliff, or check nearest block (if for some reason you're trying to stay away from walls).
Edited on 04 May 2012 - 03:25 AM
BigSHinyToys #8
Posted 04 May 2012 - 10:26 AM
I have found LIDAR as a sort of realistic way to telling distances as such it is not that important this model be followed exactly.I had a suspicion it would be easy to implement it is good to here that more or less confirmed. the main thing from my perspective is making the turtles more autonomous and a more accurate map of there surroundings would be a very good start. the second reason is when remotely driving a turtle you would be able to see a map of the surrounding area and make choices to avoid objects objects or recognize land marks better. if you would be interested in making the device please feel free to.