Author Topic: LIDAR - in a way I can relate to  (Read 1747 times)

RideTheGlide

  • Sunset Status
  • ****
  • Posts: 291
    • View Profile
    • Email
Re: LIDAR - in a way I can relate to
« Reply #30 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.
2016 Naish Glide 14x30 GTW
2017 GoPlus 9'9" x 6" iSUP (generic low end all around)

PonoBill

  • Cortez Bank Status
  • *****
  • Posts: 21804
    • View Profile
    • Ponohouse is for sale. Great house but it's time for new adventures
Re: LIDAR - in a way I can relate to
« Reply #31 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

Ponohouse is for sale: http://www.ponohouse.com
Foote 10'4X34", SIC 17.5 V1 hollow and an EPS one in Hood River. Foote 9'0" x 31", L41 8'8", 18' Speedboard, etc. etc.

RideTheGlide

  • Sunset Status
  • ****
  • Posts: 291
    • View Profile
    • Email
Re: LIDAR - in a way I can relate to
« Reply #32 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):



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
« Last Edit: February 05, 2019, 04:59:50 AM by RideTheGlide »
2016 Naish Glide 14x30 GTW
2017 GoPlus 9'9" x 6" iSUP (generic low end all around)

PonoBill

  • Cortez Bank Status
  • *****
  • Posts: 21804
    • View Profile
    • Ponohouse is for sale. Great house but it's time for new adventures
Re: LIDAR - in a way I can relate to
« Reply #33 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.
Ponohouse is for sale: http://www.ponohouse.com
Foote 10'4X34", SIC 17.5 V1 hollow and an EPS one in Hood River. Foote 9'0" x 31", L41 8'8", 18' Speedboard, etc. etc.

RideTheGlide

  • Sunset Status
  • ****
  • Posts: 291
    • View Profile
    • Email
Re: LIDAR - in a way I can relate to
« Reply #34 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



2016 Naish Glide 14x30 GTW
2017 GoPlus 9'9" x 6" iSUP (generic low end all around)

RideTheGlide

  • Sunset Status
  • ****
  • Posts: 291
    • View Profile
    • Email
Re: LIDAR - in a way I can relate to
« Reply #35 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.
« Last Edit: February 08, 2019, 04:43:52 AM by RideTheGlide »
2016 Naish Glide 14x30 GTW
2017 GoPlus 9'9" x 6" iSUP (generic low end all around)

RideTheGlide

  • Sunset Status
  • ****
  • Posts: 291
    • View Profile
    • Email
Re: LIDAR - in a way I can relate to
« Reply #36 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.
« Last Edit: February 08, 2019, 04:50:37 PM by RideTheGlide »
2016 Naish Glide 14x30 GTW
2017 GoPlus 9'9" x 6" iSUP (generic low end all around)

RideTheGlide

  • Sunset Status
  • ****
  • Posts: 291
    • View Profile
    • Email
Re: LIDAR - in a way I can relate to
« Reply #37 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.

2016 Naish Glide 14x30 GTW
2017 GoPlus 9'9" x 6" iSUP (generic low end all around)

RideTheGlide

  • Sunset Status
  • ****
  • Posts: 291
    • View Profile
    • Email
Re: LIDAR - in a way I can relate to
« Reply #38 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.


2016 Naish Glide 14x30 GTW
2017 GoPlus 9'9" x 6" iSUP (generic low end all around)

RideTheGlide

  • Sunset Status
  • ****
  • Posts: 291
    • View Profile
    • Email
Re: LIDAR - in a way I can relate to
« Reply #39 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.

2016 Naish Glide 14x30 GTW
2017 GoPlus 9'9" x 6" iSUP (generic low end all around)

PonoBill

  • Cortez Bank Status
  • *****
  • Posts: 21804
    • View Profile
    • Ponohouse is for sale. Great house but it's time for new adventures
Re: LIDAR - in a way I can relate to
« Reply #40 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.
Ponohouse is for sale: http://www.ponohouse.com
Foote 10'4X34", SIC 17.5 V1 hollow and an EPS one in Hood River. Foote 9'0" x 31", L41 8'8", 18' Speedboard, etc. etc.

RideTheGlide

  • Sunset Status
  • ****
  • Posts: 291
    • View Profile
    • Email
Re: LIDAR - in a way I can relate to
« Reply #41 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.
2016 Naish Glide 14x30 GTW
2017 GoPlus 9'9" x 6" iSUP (generic low end all around)