SquidDev-CC/plethora

Moar Sensors!

Closed this issue · 1 comments

Having the sensors that are already in game are cool and all, but sometimes the sensors (take the block sensor for example) are a bit... too much.

Adding simple sensors like a LIDAR or stationary range finder would be pretty cool, and allow for more simple pathfinding.

Sensor ideas:

LIDAR

Adding a LIDAR would be useful for dynamic pathfinding, and for the robotics enthusiasts in the crowd. Using the LIDAR would allow the turtle (and by extension, you the programmer) to know where it is in relation to walls or obstacles, without having to sort through hundreds of other blocks.
In theory it should also be much easier processing-wise as it only needs to see the locations of blocks, and doesn't have to return all the extra block data.

LIDARs are good for determining all obstructions in a circle, but cannot determine what those obstructions are.

  • Configurable "maximum" range, maybe in tiers?
  • Would return all block locations (Not the blocks themselves, just their locations) in a 2D circle around themselves, up to the maximum range. This cannot see through blocks (except maybe glass?).
    • A kind-of point-cloud, but the points are blocks instead.

Laser Range Finder

Laser Range Finders are good for getting the distance to an obstruction, but they can't tell what the obstruction is.

  • Pretty much just turtle.detect(), but from a range.
  • returns true, range:number if there is a block, false if not. Up to a configurable "maximum" range, maybe in tiers?
    • Cannot determine what the block is, just the range to the block.
  • Can only see forward in a line (maybe down and up too since detectDown and detectUp exist?).

Camera

Cameras are good for seeing what's in front of you, but they are not very good at determining distance.

  • Pretty much just turtle.inspect(), but from a range.
  • Returns true, block:table if there is a block, false if not. Up to a configurable "maximum" range, maybe in tiers?
    • Cannot determine range to block, just that the type of block is there.
  • Can only see forward in a line (maybe down and up too since inspectDown and inspectUp exist?).

Gimbals

Combined with a Laser Range Finder or Camera in the crafting table, allows the sensor to "look" at an object. Can be useful if using the LIDAR with a Gimbal Camera.

Laser Range Finder Gimbals could also be useful for mapping out caves, or other things you may find in minecraft.

Thoughts on these? I think they'd be a fun addition, and perhaps even spice up CC in general with a few new things.

I appreciate the ideas, and thank you for taking the time to explain their behaviour and functionality in such detail! However, I'm afraid I don't think it's something which fits with the rest of Plethora.

As you've pointed out already, most of Plethora's modules are pretty wide in scope, and so have a fair amount of functionality. There's a couple of reasons for this:

  • Module and turtle/pocket computer upgrade space is limited, and so ideally modules should provide a reasonable amount of functionality. While having one peripheral do lots is problematic at times, it's also more convenient than having to swap between lots of them at runtime.

  • Modules generally aim to do "everything about X" (for instance, the block scanner gives you "everything about nearby blocks"). Making things so general normally makes it pretty easy to work out where new methods should go. It also allows for the (somewhat underutilised) compositional behaviour of modules.