Close

Using single cell battery now, using ThreeJS for visualizing world

A project log for Hybrid sensor (Camera + OpenCV, Lidar, Ultrasonic)

This is intended for navigating a slow, indoor robot. It's a proof of concept before the hardware design gets better.

jacob-david-c-cunninghamJacob David C Cunningham 11/11/2020 at 20:190 Comments

What you're seeing here is the "fusion sensor clu" unit facing a 90-degree wall for calibration/dumb math checks. The default full sweep pan/tilt ranges have a max of 9 samples(3 pan, 3 tilt). I was mostly concerned with the ThreeJS aspect as I was still figuring out how to plot stuff. At this time my coordinate system/math is still wrong since the result plot is not right(looks to represent the beam/measurement vs. actual points).

The fire on the battery is a minor joke, I had a brief monkey brain moment where I was prying against the battery edges with a scrap piece of 3D printed plastic and I guess I crimped the walls of the battery. It started to smoke/get warm quick... yeah. These battery holders are tight and this is a flat-top type battery cell. Hence I have the plastic in there and that distributes the force/allows me to safely pull the battery out. But I did add a switch so I don't have to pull it out as often.

This is still far from what it's supposed to do functionally. It's not supposed to be just a "pan/scan everywhere" but using THE POWER OF OPENCV it would know where to aim the sensors and roughly where to measure.

The ThreeJS aspect took me a bit but was far simpler than raw WebGL which is what I was initially going with. The ThreeJS is just a nice visual thing but ultimately all of the "computation crunching" will happen in the background/in loving memory of Python.

I'm not a spatial/math whiz guy so it will be a struggle.


This is the update to the UI so you can see the "full sweep" settings and then the resulting threejs render below. The lines is just me testing/confirming the trig math for coordinates but it will actually plot the robot  box itself vs. the world's measured polygon positions.

This thing is real hacky... there's no real time feedback from the servo position so I can't tell if they're done moving. I'm just banking on the general delays/half-delay pauses while sampling. For the most part it's okay. I will have to rework this stuff though, to be more robust mechanically and use a single board if possible eg. something like a Beaglebone. I would try to centralize everything eg. use Python for everything so I can use threads/not having to hack some NodeJS socket to Python to Arduino communication stack.

Video of it working, sorry it's not prepared, I don't really have a studio. No dedicated mic, I was crouching on the floor.

I'll beef up the ThreeJS stuff next, will confirm coordinates plotter right with some more UI toggles. Will try to get actual solid polygons plotted. The "hard/future" work would be updating meshes so if a box is not really a box/assumed angles are wrong can update it.

Discussions