Stormworks: Build and Rescue

Stormworks: Build and Rescue

52 ratings
Customizable LIDAR v.1.2 (example mc)
2
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.055 MB
18 Apr, 2023 @ 9:03am
23 Apr, 2023 @ 3:16pm
2 Change Notes ( view )

Subscribe to download
Customizable LIDAR v.1.2 (example mc)

In 1 collection by Higi
Miscellaneous
5 items
Description
LIDAR v.1.0

Main features and characteristics

• Supports any monitor size
• Can work with 1 or up to 16 sensors
• Refresh rate, modes: 2x2, 4x4, 8x8 - 15 fps, 3.7 fps, 0.9 fps
• Custom colors!
• FOV range: 90* - 2.8*
• Low performance impact

How to set up
• Build an array of sensors, with dimensions from 1x1 up to 4x4
• Place mc, connect all the sensors. For help look at the example #2, Orange
• Place and connect monitor, 3 keypads or levers for the FOV and range change, and a toggle button

Building sensor array

You can build any rectangular shape array, from 1x1 up to 4x4. You can build 1x3, 2x4, 4x3, basically any combination. Sensors can be toggled infrared to hide lasers. It is important to keep arrow directions of all sensors pointing the same way, with little arrow pointing upwards. Each sensor will create 2x2, 4x4 or 8x8 "segment", the more sensors you'll have, the higher total resolution you'll get. Lower resolution higher refresh rate, i.e. you can have 1 sensor rendering 8x8 segment at 1 fps, or 16 sensors rendering 2x2 segments but same total resolution at 15 fps

Connecting sensors to controller

The mc treats sensor array as a 2 dimensional matrix, X labeled by numbers from 1 to 4, left to right. Y labeled with letters from A to D, up to down. When connecting it is important to start from A1, and go to D4. For example, 2x3 or 3x2 array must be connected to A1; A2; B1; B3; C1; C2 or A1; A2; A3; B1; B2; B3 and not like A1; A2; A3; A4; B1; B2 or C1; C2; C3; D1; D2; D3 etc. See examples #2, 3, 7, 8 , 10 and 11.

Monitors

As I said, you can pick whatever size monitor you desire, yes, that's right, 1x1 array will work with 5x9 monitor and 4x4 array will work with 1x1 monitor. More to that, even weird arrays like 1x4 will work with 1x3 monitors! It's not the most practical thing to do tho, best picture can be achieved by matching array and monitor aspect ratios. It doesn't matter if the array is even and monitor are not and vice versa. You can connect a couple of monitors to the same controller, however, they all must be the same type of monitor.

Zoom, Range, On/Off

You'll need to connect minimal, maximal distance and zoom (FOV) via 3 channel encoder. Max distance is channel 17, minimal 19 and zoom is 18. Zoom is optional, by default set to 90* wide fov. On/Off is toggling whole controller so it won't load anything when off, even though it barely affects performance at max resolution.

Config

In the controller properties, you'll find a few options:
Number of sensors, X and Number of sensors, Y: This is dimensions of your array, 1x1 by default, 4x4 maximum
Resolution (segment): Basically how much pixels one sensor will render. Higher resolutions result in lower refresh rate. 4x4 by default
Monitor resolution, X and Monitor resolution, Y: Resolution of your monitor. If you don't remember resolution of a monitor, simply multiply it's dimensions by 32. 64x64 or 2x2 monitor by default
Color start, Color middle, Color end: First color is the nearest distances, second is the middle distances, third is the furthest distances
Color A: Alpha channel. 255 by default. I found it useless only worsening image quality, but it still here if you want to experiment with that, or it could be useful for HUD displays

How does it work

In short, it works just like real LiDaR would work. Scan area, create depth map

Whole system runs of a clock, and each clock step lua sends position where laser should go, at the same time reading laser's output and placing pixel on a screen. Clock runs at game tick speed or 60 ticks per second, this is fundamental limitation of how fast you can read and draw from one sensor, thus this controller focused on running multiple distance sensors in parallel. Pixels placed in screen coordinates, and do not have any world data. In other words, this is mapping tool and not projection

Also, probably should say that in the beginning: This is rather proof of concept/hobby project and it might need some optimization. I'm planning to use this thing in my future projects, I'll update this mc. Perhaps
Anyway, this can be used as a platform for your own builds, like adding radar to that or some UI, touchscreen whatever you might think off. It's basically built to be customizable.

If you have any suggestions feel free to leave a comment!
If you want to publish it in your creation or publish modified version credit is welcome
_______________________________________________________________

UPDATE 4.24.2023

Fix - Gamma correction
Fix - Added minimal distance feature

Rework - Moved range and fov inputs to composite
Rework - Added 3 point gradient instead of single color with black fade
_______________________________________________________________

Peace \/
33 Comments
Adh4sive Motors 3 Mar @ 1:34pm 
can this be used for tanks
Higi  [author] 26 Jun, 2023 @ 6:53am 
@Maniac this is exactly the reason I've added front clip or clip start or minimal distance. Depth is 400? 410 for end clip and 380 for start clip and you can look at the seaflor with great detail. Set it like 399 start 401 end and you'd have perfect tool for finding penies
Mat 26 Jun, 2023 @ 3:31am 
Hi
do you think there is a way to increase the contrast of depth ? trying to notice a meter-high object at 400 meters is basically impossible
Higi  [author] 4 Jun, 2023 @ 4:29am 
@Femboy ah yeah mirroring will mess directions up
Femboy Gaymer 3 Jun, 2023 @ 3:50pm 
@higi The problem was the fact that some of the lasers were mirrored. I disabled mirroring mode, replaced them, and then it worked great.
Higi  [author] 3 Jun, 2023 @ 11:10am 
@Femboy assuming you wired everything correctly, this can only occure if your laser array is smaller than what set in the controller itself. Check "number of sensors X, Y"
Femboy Gaymer 3 Jun, 2023 @ 6:13am 
There seems to be a problem. I am 99% sure I hooked it up and set up the MC properly, but the whole thing aims off to the left for some reason. I'd have to twist the whole assembly like 45 degrees for it to scan what's in front of my submarine.
Kelloggs Digga 12 May, 2023 @ 5:58pm 
sure this is great but can't get anyithing more than a straight horizontal line on there
Higi  [author] 26 Apr, 2023 @ 5:47am 
@mark-bench most of the features can be made as a separate overlay very easily, like touch screen or some data out, camera radar whatever you will

Automatic range have some problems: It's really computationally expensive and doesn't really work well in some situations, like imagine looking at something far and a random "particle" flies right in front of the scanner, making colors freak out

Shifting scan area is hard due to float nature. It just brakes alignment 'cuz of weird remainders like 0.00235676532 etc. when you try move it really small step

Getting rid of distortion doesn't make much sense bc regular camera has same amount of it, plus it would mess with line/stroke which I don't even want to bother any longer now that it works XD
mark-bench 26 Apr, 2023 @ 5:24am 
This is a great and super useful example. Thank you so much!
Using nine of the mcs with an x and/or y offset for a 12x12 sensor array gives a really nice resolution. Some featueres i would love to implement or see implement by you or someone else:
-Automatic range/contrast adjustment
-Min & max distance output to display on another screen as a legend
-Option to change the scanning direction at higher zoom factors
-Make an overlay with a camera (needs to be time and maybe weather dependent for good overlay visibility)
-Combine with a radar to track targets for better positional info on it than reworked radar gives or with deprecated radar even a completly stabilised imaghe of the target.
-Add a stabiliser (needed for moving ships)
-Make a version that scanns even slower but fills the 9x5 monitor at full resolution
-Target detection (aircraft, ships, fish)
-Option to correct spherical distortion (useful when scanning seafloor at low zoom factor)