Standup Zone Forum

General Category => Random => Topic started by: Wetstuff on January 31, 2019, 06:02:46 AM

Title: LIDAR - in a way I can relate to
Post by: Wetstuff on January 31, 2019, 06:02:46 AM
https://www.designboom.com/technology/mit-roboat-laserscape-amsterdam-canals-01-30-2019/?utm_source=designboom+daily&utm_medium=email&utm_campaign=MIT+uses+driverless


There's all this 'self-driving car' and automated factory conversation, but since I like water - I pay more attention.

Jim
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on January 31, 2019, 06:41:26 AM
That's pretty cool. A few years ago, I did some side work on a speculative project ("we're all going to be millionaires" - didn't work out that way). The guy I worked with had someone stake him to buy all the hardware and we just put in time. He built what was basically an electric jet ski that could be thrown in the water and go to a man overboard automatically. The target market was commercial fishing boats in rough cold water. They can't turn around quickly, it's easy to lose sight of the person in the water and time is at a premium because of the cold water.

I did the control boards using Arduinos. There was a beacon that just transmitted coordinates from a GPS when activated, a main control box that could joystick control the AV (plus some other functions mostly for testing) and the AV itself. They all communicated with data radios that were supposedly good to 6 miles. It was an interesting project even though it went nowhere. It could have if the investor had taken a low ball offer.

I used a GPS and tilt compensated compass on the AV plus motor controllers on twin props adjusting speeds to turn it. Some math with the coordinates gave me the bearing. When I got really close, I would go into what I called lawn mower mode, going fairly slowly back and forth across the area when the coordinates of the AV and beacon indicated I was very close so that I would get close enough so he could grab it and pull himself on without hitting him at high speed. That worked pretty well in testing.

As far as current and wind, the continual course adjustment would result in a slight arc that was direct enough not to worry about trying to tweak it.

This was fine for open ocean, but the real problem was detecting obstacles on the surface if there were waves. Both below and above water sonar bounces off the face of waves. Figuring that out was still on my to-do list when we folded the tent...
Title: Re: LIDAR - in a way I can relate to
Post by: TallDude on January 31, 2019, 10:58:28 AM
I'll wait for the foil version ;D  Seriously, it's cool to see the inception of something. Then years later jump on one in Amsterdam, or where ever.
Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on January 31, 2019, 08:16:25 PM
I'm building a height control system for my 78 GMC moho using LIDAR. I tried cheaper infrared and ultrasound detectors, but they're too sensitive to interference. Lidar is rock solid, even at the very short range I'm using. The GMC's have airbag suspension and originally had automatic height control. the original height sensor and the compressor system was staggeringly complex, including regenerative air dryers, automatic calibration, and automatic mode switching for parked, driving, and leveling. Wild shit. I'd restore that system if it was present, just for the technical challenge, but previous owners tore it out and installed a simple manual compressor system. I'm restoring the original functionality with ESP32 IOT controllers and Lidar. Just a few billion dollars worth of tech to do something GMC did completely analog 47 years ago.
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 01, 2019, 03:12:36 AM
I'm building a height control system for my 78 GMC moho using LIDAR. I tried cheaper infrared and ultrasound detectors, but they're too sensitive to interference. Lidar is rock solid, even at the very short range I'm using. The GMC's have airbag suspension and originally had automatic height control. the original height sensor and the compressor system was staggeringly complex, including regenerative air dryers, automatic calibration, and automatic mode switching for parked, driving, and leveling. Wild shit. I'd restore that system if it was present, just for the technical challenge, but previous owners tore it out and installed a simple manual compressor system. I'm restoring the original functionality with ESP32 IOT controllers and Lidar. Just a few billion dollars worth of tech to do something GMC did completely analog 47 years ago.

You made me look...
https://www.hackster.io/mjrobot/iot-made-simple-playing-with-the-esp32-on-arduino-ide-0fe58c

Cost of admission is pretty low if you are a techno dweeb with breadboards, power supplies and sensors to play with lying around. I have a little toy AV - literally; I put an H bridge motor controller and a steering servo in a dirt cheap RC car - that I can control with BT messing around with sensors. Yet another speculative side project that didn't get off the ground was a robotic runway inspector; the actual unit the maker had was big brushless DC motors run by an ESC, but I wrote the propulsion and steering code where it was easy to switch between the toy, which I could use at home, and his unit for field testing. Anyway, it might be kind of interesting  to adapt it to using the web for instructions/routes. I was playing around with the Sharp distance sensor. You can get all sorts of lower level info from it, like back scatter, to try to figure out what you are looking at - like smooth/rough and how reflective on top of how far away it is. Kind of a poor man's LIDAR, but not nearly as fully functional. But that smart camera module that could learn shapes was gaining some ground when I was last messing with it.

Might give me something to do while I can't paddle...
Title: Re: LIDAR - in a way I can relate to
Post by: supthecreek on February 01, 2019, 03:25:46 AM
Interesting vid Wetstuff.... interesting to watch the "live" readings turn into continually updated objects in relative 3D optics.
Title: Re: LIDAR - in a way I can relate to
Post by: Wetstuff on February 01, 2019, 09:30:02 AM
I envy you RTG, I'd love to be able to program c'hit. I am working on a 'crawler' for the marsh that will crush Phragmites out front of my house.  I have about 3-4 acres of them that wreck our view. A friend who builds racecars will make the chassis and rig the hydro-drive for me.  My last one -a roller- was too tall and I would get chucked off into the mud when it dipped into a hole.  I would love to make the new one R/C and saving ~200lbs to haul my azz also.  I could probably do walk-behind controls, but that's not fun...


Jim
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 01, 2019, 05:02:34 PM
I envy you RTG, I'd love to be able to program c'hit. I am working on a 'crawler' for the marsh that will crush Phragmites out front of my house.  I have about 3-4 acres of them that wreck our view. A friend who builds racecars will make the chassis and rig the hydro-drive for me.  My last one -a roller- was too tall and I would get chucked off into the mud when it dipped into a hole.  I would love to make the new one R/C and saving ~200lbs to haul my azz also.  I could probably do walk-behind controls, but that's not fun...
Sometimes I am about ready to be done with programming. 40 years professionally.

But Arduino is kind of fun and different. I did some some discrete device firmware ~30 years ago but all I could do was purely the software side. All the stuff like sensors had to be built chip by chip with all the right resistors and capacitors, address decoders and what not. You needed a real EE and you couldn't just mess around. With the Arduino, and other similar microcontrollers, you can. You can get sensors for $5 or so for all sorts of things - distance, temperature, proximity , compass, GPS (a bit more, but still some choices around $20 and I have "harvested" some from other devices for very cheap). Motors that you can run to provide locomotion or precise movement. All sorts of stuff and it's all pretty easy to wire up - power, ground and maybe 1 to 3 wires to communicate with. Tons of code all over the net to help you get started.

The out of the box RC stuff is pretty easy to deal with. With that or with the microcontrollers, you just share ground with the scary high voltage motors and send low voltage "instructions" (pulses, actually) to the speed controllers or servo logic (for things that move back and forth, like steering). When I get shocked it's like 7.5 volts with very little amperage. It usually doesn't even smoke sensors if you wire them up wrong. That's what makes computer chips work - smoke. As soon as you let it out, they stop working.  ::)

You should post up some pictures of this thing you are making.
Title: Re: LIDAR - in a way I can relate to
Post by: surfcowboy on February 01, 2019, 06:35:20 PM
Yeah guys. It’s easier than ever to learn to program now. Check your local maker space or stem center and take an arduino class. Super fun and surprisingly easy, especially since you’re “doing something” and not every thing is theoretical.

Good winter projects if you’re up North.
Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 01, 2019, 06:36:55 PM
The ESP 32 is like Arduino plus radios (BT and wifi) and a bunch more, and it's a lot more powerful than most Arduinos--dual core, 32 bit is more or less standard.  When I first looked at the it was AT commands, C or assembler (ugh) but now you can program it with the Arduino IDE, C++, and Micropython. For all I know by now you can probably program them in AWK. OK, maybe not. Reasonably small in most implementations. I feel like every time I stop doing this stuff for a few months everything gets smaller, faster, cooler. ESP32 also has ten touch sensors, 18 channels of analog to digital converters, two digital to analog, most have temperature sensors, a hall effect sensor, ethernet, all the usual motor PWM stuff, voltage regulator with 3 and 5v out and tons more. A whole frickin' kitchen pantry full of crap on a dinky little board. You can do a hell of a lot with not much connected to it.


Sensors are getting insanely cheap since a number of Chinese hobbyist companies started doing kits of sensors on breakout boards with I2C. Each company is trying to outdo the other. 40 sensor boards for 15 bucks is common.



Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 01, 2019, 07:00:03 PM
The article I linked earlier said under $10 for the DIP ESP 32. I have cheaper Arduinos but they are slower with IO ports that are easy to wire to but nothing really built in. I connect BT or data radios and sensors on the breadboard. I end up daisy chaining breadboards. I can be a little less than organized when that starts happening and end up with a nasty mess like the one on the aforementioned toy car AV:
(EDIT - upper center is one of the harvested GPS units I mentioned earlier. I cracked open a USB GPS that came with an outdated version of MS Streets I got for about $5 and soldered leads to power, data and ground. It's amazingly accurate)
This is not one of the dirt cheap little Arduinos, but not a whole lot more.
Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 01, 2019, 09:48:15 PM
My breadboards are equally ugly. I used XBees for the rudder/autopilot project, but they are spendy overkill, so I  did a few projects with super cheap (less than a buck) 433mhz transmitters and receivers, but they have no handshaking--you have to do all the checking in software. Not hard, but I ditched those in favor of the nRF24L01 transceivers which are nearly as cheap and much more sophisticated. You can even connect them in a mesh, or simpler yet for a project I'm working on that needs two transmitters talking to a central receiver, connect two controlled with a collision protocol that works just fine. Most of the wireless stuff I'm doing in my GMC motorhome was prototyped with these. But now there's ESP32 which means I might have to redo all that stuff. Low energy Bluetooth is ideal for lots of stuff. And anything that requires more bandwidth and range can be WiFi.

Strange world. Stuff that would have taken months to build with discrete components is now trivial, and things that would be super expensive and power hungry now cost nothing and run for weeks on a dinky battery.
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 02, 2019, 05:47:23 AM
xBee is what we used on the rescue jet ski thing. The one that is supposed to 6 miles. I never tried more than a mile but that was fine. I also played with those no handshake data radios, making up my own protocol. I would send a bunch of 'U' characters in a row as a preamble as it is a series of perfectly timed spikes high and low that is not likely to be random static. They constantly stream crap "data" the rest of the time and the range was pretty limited. It would be better with an ESC and brushless motor instead of that uni toy motor. The nice thing about BT is that I use a little phone app that lets me assign commands to buttons so I could make my driving remote easy to use by placing them around the edges and put a little terminal window right in the middle where I would stream out all sorts of diagnostics. I implemented a little command processor so I could request values like GPS coordinates, heading from compass, etc. One thing I wish they had is multi threading. My code gets complicated as I do everything in the loop and make it a state machine caching the milliseconds every time I do something then return and don't do the next step too soon and get stuck. For example, that Sharp IR sensor is really accurate because it does a bunch of internal processing before returning a value. If you do a blocking read, it will take 100 ms. If you go do other stuff and come back and read it after 100 ms have passed, it's immediate.
Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 02, 2019, 10:26:36 AM
See what you started wetstuff. You don't throw bait to geeks. They'll take it every time and add their own pile.
Title: Re: LIDAR - in a way I can relate to
Post by: SanoSlatchSup on February 02, 2019, 02:04:57 PM
This thread seems like it would be extremely interesting....as soon as someone translates it into "tech moron" for me. :-[ :D
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 02, 2019, 02:28:59 PM
This thread seems like it would be extremely interesting....as soon as someone translates it into "tech moron" for me. :-[ :D

Stuff that used to be tremendously expensive and require a team of engineers working for a year to put together can now be done by one guy in a weekend for the price of a pizza.

If you have a great idea for a device that does something worth while (or not) that involves things that you can determine using your senses, there are off shelf parts (electronic sensors) that hobbyists can cobble together pretty easily for not much money. Communicating between devices or your phone or the net is also not that hard or expensive. It can get a little more expensive if you want it to move around and do stuff, but that is still something that hobbyists can do.
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 02, 2019, 06:39:30 PM
So PonoBill talked me into ordering an ESP32. I have no idea what I am going to do with it.  ;D

I guess I will have to come up with something. I poked through my stuff and found a 3 wheel AV I abandoned when the builder for the runway inspector decided not to go forward. It has a couple of stepper motors for the back wheels. I was pushing that idea since we wanted more precise turning than you get with drive wheels in the back and steering in the front. The motors are weak though. It has a crappy little Arduino mini running it that has some issues; that's a candidate for the ESP32. I still have one of the high power xBees, which is pretty useless by itself, connected to yet another Arduino, GPS and tilt compensated compass. A rotary encoder. A fairly powerful brushless motor and ESC. Somewhere around here there's another Arduino that has the USB device settings and does some MIDI controller stuff. I think I have another box of sensors (like the Sharp IR) and I misplaced a little RC boat. This is what happens when I dabble with something and then stop messing with it for a while.

EDIT - found a bunch of sensors, but not the IR. I can't remember what half the stuff is; going to have to Google chip numbers.
Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 02, 2019, 11:47:02 PM
I feel your pain. This is my little electronics corner in my garage in Maui. The one in Hood River is at least an order of magnitude more confusing. I'm constantly picking up a board and trying to figure out WTF it is.

(https://www.ponostyle.com/wp-content/uploads/2019/02/IMG_1114.jpg)

(https://www.ponostyle.com/wp-content/uploads/2019/02/IMG_5791.jpg)

Title: Re: LIDAR - in a way I can relate to
Post by: Wetstuff on February 03, 2019, 08:18:58 AM
Jeez...   "as a preamble as it is a series of perfectly timed spikes high and low that is not likely to be random static."  We had a 2-cyl JD tractor on my aunt's farm that was started with a flywheel.  I am extremely fortunate that with decent hands and dumb luck, I have been able to run a little business for ~40yrs.   I'd be still on the Concrete Gang if I was dependant on my brain.  A friend who decided what went on DOD satellites has learned to throttle back the brainiac.

Here's my first attempt at 'marsh management'.   FWD, articulated, hydro-driven.  ...too heavy, too tall, too narrow.  It 'worked' but I ended up getting chucked off when it fell in a hole  ..then had to muscle it upright and back it out with the aid of planks/plywood  ...me, a total mess schlepping around on snowshoes.  I looked at making a sled with a reversible rope tow - parking a pontoon boat on the creek and anchoring the shore-end to trees, etc.   The sled works - I tried it with an old truck hood, but too futsy.  I also thought of a mega weed wacker that looked like a Gravely walk-behind but it looked too easily fouled and marsh-walking is not fun when you are also getting jerked around. (Phragmites are hollow and crush easily making a virtual roadbed.)

I bought two of the widest/longest snowmachine tracks, 'come up with a simple boogie system that my friend Hank will fab into a crawler.  Its low profile and better traction should eliminate most of the issues I had with this monster.   One imagines an opportunity to 'take the show on the road' and buried expenses in the future.  There's a lot of property around the Chesapeake Bay with the same -recurring- issue.


Jim

Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 03, 2019, 09:13:00 AM
 You sell yourself short. Intelligence isn't just one thing. Problems like your Phragmites get solved by iteratively trying stuff and having the creativity and drive to keep at it.
Title: Re: LIDAR - in a way I can relate to
Post by: SanoSlatchSup on February 03, 2019, 11:18:34 AM
I also thought of a mega weed wacker that looked like a Gravely walk-behind but it looked too easily fouled and marsh-walking is not fun when you are also getting jerked around. (Phragmites are hollow and crush easily making a virtual roadbed.)
Did you ever consider a front mounted sickle bar mower to mow 'em down instead of just smushing them?
https://www.youtube.com/watch?v=eAKEhKicFxU
Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 03, 2019, 11:38:47 AM
I think you have headed the right way with your wide wheel rollers, they just weren't wide enough and floaty enough. I'd rework that contraption but make the rollers twice as wide and fill them with foam. If it was me, I'd make the thing autonomous, easy to do with GPS and nothing much to hit, or no big problem if it bumps something unyielding.  But driving it works.
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 03, 2019, 02:35:54 PM
I think you have headed the right way with your wide wheel rollers, they just weren't wide enough and floaty enough. I'd rework that contraption but make the rollers twice as wide and fill them with foam. If it was me, I'd make the thing autonomous, easy to do with GPS and nothing much to hit, or no big problem if it bumps something unyielding.  But driving it works.

When I did my first AV, I was poking around the net looking for code/info and found a project somebody did where they logged GPS while carrying the bot around, then set it own, flipped a switch and it drove itself back along the same route. You could do the same sort of thing with a removable head unit or a separate SD logger to walk the planned path first.

To get it perfect, I would want true zero turn radius, so at the pivots you turn 90, go forward the distance of the cut width, turn 90 again and start forward. GPS will be near worthless while pivoting.

There are some serious safety concerns letting something that leads with a power cutter run around autonomously. Not that a car going 45 would do any less damage but it has an array of sensors and safety countermeasures.

I looked at the LIDAR components. The "real" ones aren't cheap. There are TOF laser distance sensors that do use the same technology, but they aren't really LIDAR. I found some of those around $10 if I must have it now and $5 if slow boat from China is okay. I went the $5 route as I have a decent IR that functions identically from the software side to play with. I think I might use my little stepper motors to sweep side to side and up and down and see if I can generate a 3D representation of things that don't move much (or ever  ;) ) because it will not be fast, though at low granularity (like points 2" apart at 3' or whatever) it would be a little quicker.

First I have to come up with a use...
Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 03, 2019, 10:52:51 PM
I wouldn't do a sickle bar, just run them over. I was fiddling around and wrote the pseudocode for the idea that Ride described with some tweaks. I'm going to build a little fake version here after I finish the project I'm doing for my PT. The stuff for the motorhome can wait a bit. I modified the notion a little. You take your iPhone and use the compass/GPS. Go to each of the four corners of a rectangle to get squashed and get the coordinates. Enter them in the software (you could grab it right from the GPS app, but that looks like work), turn on the squasher and walk away. The Squasher code divides up the rectangle into GPS-directed paths a little narrower than the squasher width and then drives the paths, correcting after each 180.

I did something similar with navigation code for drones a few years ago. Flying a drone along an imaginary cable, like one of those cablecams. Pretty easy to do in the air with a drone though we crashed them into a lot of stuff. Headmount was with me when I was showing it off here in Maui. It hit some palm fronds hanging down flying the cable path and fell out of the sky. Unfortunately, there was a homeless guy riding a bicycle and it swooped down a bit out of control and buzzed up his leg with one of the props. Good thing he had on long pants. Din't really hurt him, just scared the shit out of both him and me.

I have an old robot lawnmower in Hood river that did random paths within a boundary signal wire. I never liked the random thing, and I couldn't come up with a way to make it mow the multiple levels of lawn we have in HR so it's just sitting. I bought the thing to do a huge lawn we had at our house in Portland. Didn't work well. But GPS guided--yeah. I could do a map, including travel paths where it didn't run the cutter. Both the squasher and my lawnmower could use a simple bumper or an IR object detector for avoidance. Implementation always is tougher than it seems, but this seems to be a worthy project that I could use as a base for a number of things.

If I get it going well I'll give you a version of it Wetstuff, to scare your neighbors with an autonomous squasher.
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 04, 2019, 03:31:16 AM
Are you going to do steppers in the back and swivels up front? If you do, electric wheelchair or mobility scooter parts are a good source. A common reason people use the scooters these days is obesity, so you can get some really high powered ones. The motors are ready to bolt on to a chassis, have the torque and are ready to wire. If you are lucky, you might find a wrecked scooter cheap.

I got motivated enough to set up a MEGA and breadboard to do some sensor and stepper motor work. Hopefully most code will port over to ESP32. Certainly any math work with coordinates will. Besides, it will only be a few days until I get the ESP32. I still am working on how/why I might use the web to get instructions and/or upload results.

I updated to latest Arduino dev environment and added ESP32 support. I was surprised at the length of the board list. It looks like there is less hardware standardization than on Arduino boars.
Title: Re: LIDAR - in a way I can relate to
Post by: Wetstuff on February 04, 2019, 07:18:54 AM
Thanks, Bill...'Ya, press on!'  Unlike you guys, I am limited to a reservoir of manual/visual experience. My brain simply will not process 'electronics'.  I am having a helluva fun/difficult time just dealing with security cams.

Sano, a sickle bar (I first did it by hand with a small scythe, then weed wacker) is really not needed; being hollow, when mature, they simply fold flat and mat.  I attempted to use very large back tarps (heat+darkness) to stop re-growth, but they simply elevated the tarps. They look like asparagus when they first come up.   I had a Gravley walk-behind and that sucker weighed as much as a small car.  You are -up to your knees- in that soft muck where these thrive. I use snowshoes, waders are a bitch to suck back out of the muck.

Jim
Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 04, 2019, 08:44:03 AM
Ride--I recommend the Random nerd tutorials for ESP32 stuff. Bright guy, and he builds a lot of things that relate to what I'm doing. My Moho will be largely Alexa-controlled. https://randomnerdtutorials.com/alexa-echo-with-esp32-and-esp8266/
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 04, 2019, 10:04:41 AM
Ride--I recommend the Random nerd tutorials for ESP32 stuff. Bright guy, and he builds a lot of things that relate to what I'm doing. My Moho will be largely Alexa-controlled. https://randomnerdtutorials.com/alexa-echo-with-esp32-and-esp8266/

Hmm...
Alexa - that got my attention. Not sure exactly what I would do with it, but it starts more gears turning.

The irTOF distance sensor I had lying around, a Pololu VL6180X breakout (because I can't find that damn Sharp), I have dealt with before so I had code lying around. I have been reminded why I got the Sharp. The range is max 20 to 60 cm depending on scale factor. It reads out 0-200 and you multiply by the scale factor of 1, 2 or 3 to get mm. You set scale and it reduces resolution but increases range. That sounds okay except it bounces around so you have to get a few readings and vote. The high spikes are bigger than the low ones so I can't average them. It also returns ambient light readings. I spit out distance and ambiance readings every 750 ms in a loop and pointed it around and it became very obvious that above a given brightness, distance sensing goes to hell. Still worth playing with for now.
Title: Re: LIDAR - in a way I can relate to
Post by: SanoSlatchSup on February 04, 2019, 12:09:51 PM
Sano, a sickle bar (I first did it by hand with a small scythe, then weed wacker) is really not needed; being hollow, when mature, they simply fold flat and mat.  I attempted to use very large back tarps (heat+darkness) to stop re-growth, but they simply elevated the tarps. They look like asparagus when they first come up.   I had a Gravley walk-behind and that sucker weighed as much as a small car.  You are -up to your knees- in that soft muck where these thrive. I use snowshoes, waders are a bitch to suck back out of the muck.
Yeah, that's what happens when a SoCal kid weighs in on sheet he knows nothing about. As soon as I read "I use snowshoes" in the swamp...I know I was definitely out of my imaginary element. ;D

Best of luck with whatever you (and the mad scientists...I say that with love, respect, and admiration) dream up. I'll :-X for now. Lol.
Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 04, 2019, 01:33:28 PM
That sounds okay except it bounces around so you have to get a few readings and vote. The high spikes are bigger than the low ones so I can't average them. It also returns ambient light readings. I spit out distance and ambiance readings every 750 ms in a loop and pointed it around and it became very obvious that above a given brightness, distance sensing goes to hell. Still worth playing with for now.

I confess I don't really know the difference between the expensive Lidar sensors (about $150) and the much cheaper Time of Flight sensors (about five bucks) which seems likely to be what is used in inexpensive measuring systems like the Stanley pocket laser measurer for 12 bucks.
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 04, 2019, 06:29:28 PM
That sounds okay except it bounces around so you have to get a few readings and vote. The high spikes are bigger than the low ones so I can't average them. It also returns ambient light readings. I spit out distance and ambiance readings every 750 ms in a loop and pointed it around and it became very obvious that above a given brightness, distance sensing goes to hell. Still worth playing with for now.

I confess I don't really know the difference between the expensive Lidar sensors (about $150) and the much cheaper Time of Flight sensors (about five bucks) which seems likely to be what is used in inexpensive measuring systems like the Stanley pocket laser measurer for 12 bucks.

I ordered one of the $5 laser TOF sensors, but it will be a while before it gets here from Asia. What I am using now is single point infrared. The Sharp that I like triangulates using infrared. 
Real lidar implies actual moving parts that can do a quick sweep. It also uses back scattering and has multiple sensors for the returned light. It maps in 3D using a lot of points for distance. That's what I am trying to do but I can't do it as quickly with the cheap parts.
Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 04, 2019, 09:45:16 PM
Most of the Lidar systems I've looked at use a spinning mirror for the scan. I actually bought one of the $150 units from Sparkfun, but haven't done anything with it (it's in Hood River). And then there's this guy for $319:https://www.sparkfun.com/products/14756

(https://cdn.sparkfun.com//assets/parts/1/2/9/9/1/14756-RPLIDAR_A2M8_360___Laser_Range_Scanner-01.jpg)
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 05, 2019, 04:57:00 AM
Most of the Lidar systems I've looked at use a spinning mirror for the scan. I actually bought one of the $150 units from Sparkfun, but haven't done anything with it (it's in Hood River).

I am going a little more low budget for the moment. I just ordered one of these from a US seller (so I can work with it soon):

(https://images-na.ssl-images-amazon.com/images/I/21p0xzwP-jL.jpg)

So I can point my little single point ir (to be replaced by laser for more accuracy when that shows up) around. I will move it around in a grid pattern. Where I am in the pattern will give me X and Y and the distance will give me Z and I can make a contour map. There will be some interesting geometry in that to reduce skew. The further away the point is in the Z plane, the further the sample point moved in X and Y per degree of pan and tilt. It's going to be really rough with ir as it actually has a cone of reflection, not a true single point. It's not too wide, but it's a cone. With ir, if I set it in front of a football and can tell is a tapered column I will be happy. With laser, I should be able to map the laces. When I get the laser range finder, I think I can legitimately call it Lidar.


Anyway, all that processing and mechanics is built in to your Lidar unit. I will have to pan around back and forth so I don't wrap the wires around the arm and because I am using servos with a limited range of motion. I would have had the same issue with stepper motors with respect to the wires. The Lidar units solve the wrapping wire problem by pointing the laser straight down at the pivot point of a spinning mirror.
The funny thing is that if I value my time at all, my Lidar will be way more expensive than yours, much slower, bigger and won't handle the environments your can. But the hobby is more about the journey than the destination.  ;D
Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 05, 2019, 08:42:33 PM
The funny thing is that if I value my time at all, my Lidar will be way more expensive than yours, much slower, bigger and won't handle the environments your can. But the hobby is more about the journey than the destination.  ;D

It's ALL about the journey. For me this makes no commercial sense at all, just keeping my brain working. I try to step it up every year, learn something harder.  I think it makes a difference, I think I'm sharper now than I was at 40, though that might just be the dementia fooling me.
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 06, 2019, 03:52:49 AM
The funny thing is that if I value my time at all, my Lidar will be way more expensive than yours, much slower, bigger and won't handle the environments your can. But the hobby is more about the journey than the destination.  ;D

It's ALL about the journey. For me this makes no commercial sense at all, just keeping my brain working. I try to step it up every year, learn something harder.  I think it makes a difference, I think I'm sharper now than I was at 40, though that might just be the dementia fooling me.

I doubt there is commercial use for what I will do to start with since it could be done with off shelf hardware. I have started thinking about what the next step will be to see what the data looks like once I get it. There's the easy way; dump it into a CSV file and open it in Excel to do a surface chart as pictured below or a possibly more interesting and challenging way to deliver the data over the web:

https://almende.github.io/chap-links-library/graph3d.html



Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 08, 2019, 04:39:33 AM
I should get the ESP32 tonight or tomorrow. I did find info on using the 2 cores independently on the Randaom Nerd Tutorials site you sent me to for a different article.
https://randomnerdtutorials.com/esp32-dual-core-arduino-ide/

I decided to put my Arduino Pro Mini on my toy car and when I have the ESP32 Lidar working, I will have it communicate with the Pro Mini to drive around while the ESP32 is mapping. I got the Bluetooth command interface working on the Pro Mini last night and the motor control wired, but had to charge a battery to test. I expect that to go smoothly as this is mostly just a slight port from code that worked on a MEGA.
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 08, 2019, 03:57:33 PM
A little more running monologue. My ESP32 came and I moved the IR range finder over to it. Recompiled the little testing sketch and it ran just fine. Played with the range finder a little, moving objects in front of it. IR is going to give me some pretty rough numbers. It finds edges but not surface contours or indentations unless they are pretty big.
The toy car works with the little Pro Mini, though I need a better battery. Drove it back and forth a couple of times with my phone. But I put all that aside for now. If I decide this thing needs to move around intelligently, I have a solution. Not really much more to do until the pan and tilt comes. I have a peel and stick mini breadboard to put on it to mount the sensor and then the fun will begin.

EDIT - actually I do have the tilt compensated compass I can wire and do a little testing with. I need it to know how many degrees off center I pan and tilt for calculations. I don't know how else I could ever calibrate to the servos well enough to get decent numbers.
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 08, 2019, 07:18:29 PM
and still a little more and then I probably won't get back to geeking out until next week after my tilt/pan arm gets here.

Below is the kind of data I will turn into 3D points.I will point to whatever the servos center at and get the bearing, pitch and roll at that point. Then as I point around getting distances, I will use the bearing to know how many degrees off center I am aimed horizontally, pitch will give me the vertical and roll will either be used to adjust the compass perfectly on the board or taken into account with pitch to get the vertical number. If I tie this into mapping/gps at some point, then I will care what the bearing is specifically. To start with all I want it for is to know how many degrees I point the sensor off center.

Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 10, 2019, 02:35:31 PM
Had all sorts of trouble getting compass and TOF distance sensor running together on ESP32, then also on Arduino again when I stepped back to that, so I decided just to go with coordinates based on servos. I gathered data to plot, but right now Excel seems to be having a tough time doing an area plot with 12,159 data points. I may have to find another way to plot it.

https://youtu.be/vw61Fo5RLCY
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 10, 2019, 03:05:16 PM
Found a way to generate it online, but can't set options to have decreasing Z toward me; doesn't rotate 360 degrees.  So this is viewing from the backside of the plot. You can see the general shape of the jug in there. Really rough and need to invert Z if I am going to use this plotting page.

Was going to edit this into prior post, but cold not find how I might add attachments.

Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 10, 2019, 03:48:24 PM
Pretty cool. I'm working on my project today since it's a bit too "blustery" to foil or downwind. 60 mph from a very unusual westerly direction. My power keeps going off. Good thing the IDE saves differentials, though my sketch got corrupted in one momentary blackout. I just restored it from the last save and got most of it back, though of course, I don't remember what I did. That's okay, the second solution is often better, though there have been times when I've lost a little "magic".

I'm having some issues getting two channels of low energy Bluetooth to play nice. I might have to do something brute force instead of the elegant handoff they are supposed to manage.
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 10, 2019, 05:22:47 PM
I have a UPS to keep from losing stuff. I worked on the "LidarLike" stuff off and on. I had the compass and range working at the same time for a bit when I took the earlier screen shot. When I had trouble later, I found all kinds of info on line about problems with I2C on the ESP32, especially if you have more than one device. Even with one, it will often get out of phase with some other source of interrupts and stop working sometimes. I had seen that and thought I had some issue with wiring or whatever. I am going to set it aside until the laser range finder comes and maybe play with the IOT side of things on the ESP32. I also have a level shifter on the way as I thought it might be kind of interesting to do some kind of fancy integrated sensor on one slaved to the other.

Had some actual work from my job to do also. Not doing the sort of work I have done for the last 40 years as the project stream for us kind of dried up. But I am staying relevant with the client by doing business rule and document automation work as well as maintenance on the last project we did for them. I have been where I am a long time and would have to take a big cut to move on, plus there is that whole ageism issue. Some different kinds of challenges; still puzzles to solve so it's still interesting enough to do for a while. Hopefully it gets me to retirement, which is not far away.
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 26, 2019, 11:44:20 AM
My little laser TOF sensor showed up. May breathe some life back in this thread later. First I have to solder the pins on without going blind. Unlike Pono, that is not my favorite part. But now I have to go get some dental work done, so it may not be today...
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 26, 2019, 04:45:35 PM
Not my favorite part, but my ugly handy work  is done. Think I used enough solder? I got the near one about right. the rest? Well, they aren't touching/shorting and I don't think I have to worry much about them coming loose...

EDIT - I did trim them and break off the extra pins.

Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 26, 2019, 06:56:38 PM
I use a rework system for most of my soldering. Tin the pins with an iron and then use the hot air to flow it out. Takes about ten minutes to get good with it. About 75 bux. Money well spent, I have one here and in hood river.

The ESP32 boards come in a zillion different configurations, I've settled on the Doit boards which seems to have most of the I2C problem well in hand, they are the one that Random Nerd recommends. I probably should have mentioned that earlier. .
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on February 27, 2019, 03:07:41 AM
I use a rework system for most of my soldering. Tin the pins with an iron and then use the hot air to flow it out. Takes about ten minutes to get good with it. About 75 bux. Money well spent, I have one here and in hood river.

The ESP32 boards come in a zillion different configurations, I've settled on the Doit boards which seems to have most of the I2C problem well in hand, they are the one that Random Nerd recommends. I probably should have mentioned that earlier. .

I did later find a post about some boards needing pull up resistors on I2C, but with mixed replies. I may try that at some point. I didn't wire and test it yet; maybe tonight.

The rework stations are interesting. I have a tiny heat gun that I have used sort of like that a few times, mostly with a solder wick to clean up a glob. So many toys...
Title: Re: LIDAR - in a way I can relate to
Post by: PonoBill on February 27, 2019, 08:28:05 AM
Great for desoldering, great for ensuring that strip connectors are all solid connections. I use the small nozzle for most work. It's almost the only way to do any surface mount soldering. The techniques of getting components onto a board are as varied and sophisticated as the components these days. I've tried reballing a FPGA and about half of it worked, so success!!
Title: Re: LIDAR - in a way I can relate to
Post by: RideTheGlide on March 03, 2019, 12:25:41 PM
With the laser I am not getting anything more impressive than the prior graph, but it occurs to me that the numbers I am using need a lot of hard math thrown at them. I need to de-skew; a flat wall would appear to curve away because the distance to the outer edges is further. Worse and harder is that I have been feeding in angles as X and Y instead of coordinates. Z is in millimeters, so X and Y also need to be. The reported distance and the corrected distance are two sides of a right triangle and I need to do the Pythagorean theorem match to get the distance away the point is in the XY plane. I will then have to use the pan and tilt angles to determine the direction that the point is away from center and then I can compute the X and Y. My head Hz...