LIDAR Spherical Capture Rig

by benrsnell in Circuits > Cameras

20856 Views, 170 Favorites, 0 Comments

LIDAR Spherical Capture Rig

Screen Shot 2015-11-30 at 11.38.11 PM.png
Screen Shot 2015-12-01 at 2.33.23 PM.png
IMG_5544.JPG
AK2A0522_full.jpg
AK2A0540_full.jpg
scanning_sphere.png

What's LIDAR?

LIDAR is a highly accurate light-based range-finding technology. It's typically used to scan large plots of land for aerial surveys, but more recently has found its way into many robotics applications, including the self-driving Uber car. By shooting out pulses of infrared light and measuring the time it takes to recover them, a distance estimate can be made, often up to a few mm of accuracy. However, some objects don't reflect light very well, like aluminum foil or car windows, or outdoor scenery that already contains high amounts of infrared light from the sun. High-powered LIDAR can overcome some of these deficits, but many remain for low-cost versions like the one I used here. It's important to note that this LIDAR, an Hokuyo URG-04LX-UG01 really isn't that cheap at about $1,100; however, cheaper versions can be bought and this rig modified in turn.


What does this rig do?

Most lower-end LIDAR devices can only "see" in a plane; that is, they rotate the pulses of light around a single axis. This provides sufficient data to capture, say, the outlines of all objects at knee height in a 360 degree view. This is just enough information for a small autonomous robot to avoid people and obstacles while navigating interior environments. However, if we would like to capture an entire space—not just in a plane but in all possible directions—we need to rotate the LIDAR around a second axis. This rig affords precisely this. The spherical capture rig rotates the LIDAR about an axis orthogonal to its natural sensing axis, capturing a nearly full view of its surroundings. The images obtained from one capture using this technique inside a forest are shown above. Note, however, this rig creates a blind spot in the ground beneath it: a small price to pay for near-complete vision.


How can the data be processed?

This LIDAR can connects over USB and sends the sensing data over serial. At the end of the tutorial, I provide links to download libraries that will save the data and play it back. These libraries are intended to be used with OpenFrameworks, a C++ arts engineering toolkit. For information on how to install and use OpenFrameworks, please see their website here.


Attribution & Thanks

Research Funded in Part by the Frank-Ratchye STUDIO for Creative Inquiry at Carnegie Mellon University.
Many thanks to Golan Levin for a multitude of ideas and support in his course for which this was made, Experimental Capture.
Many thanks to Dan Moore, for his gracious support and for allowing me to use his fantastic OpenFrameworks addon, ofxURG, to connect to the LIDAR.

Technical Specifications

lidar_exploded_view.png
lidar_recording_system.png
goal.png

Rig Specifications

  • size is about 5" x 8" x 8"
  • contains a standard 1/4-20 thread to mount on a tripod
  • full scan takes 52 seconds; however, scans can be shortened at the sacrifice of quality or lengthened up to a maximum of 8 minutes for maximum quality
  • an entire scan can be captured in a 180 degree (half) turn, since the LIDAR is pointed upward, not sideways
  • the gears ratios and motor system have been designed to yield an equal point resolution latitudinally and longitudinally
  • requires a 12V source of power to run (if taking outside, you will also need a semi-powerful external battery)

LIDAR Specifications

  • 0.35 degree resolution between points
  • 682 points per scan
  • 240 degree field of view (hence the blind spot below)
  • 10Hz refresh rate (makes 10 full spins every second)
  • Warning: Is powered off of USB, but draws too much current to be used off of a computer's USB port; Use a USB hub instead to separate the power and data transmissions.

LIDAR Alternatives

Other single-axis LIDARs you can purchase for less include:

Gather Materials & Tools

Below is a comprehensive bill of materials and tools needed to complete this project as is. Prices are listed for suggested suppliers; however, the project can be completed for significantly less if you already have the items or can find a replacement.

Materials Needed

* Cast acrylic is generally more precise than extruded acrylic and is the preferred type for this application. However, extruded is acceptable, though some tolerances may need to be adjusted more than usual.


Tools Needed

  • laser cutter capable of cutting through at least 1/4" acrylic
  • soldering iron, solder, fan (to remove vapors)
  • small Phillips screwdriver
  • wire cutters
  • wire strippers
  • needle nose pliers
  • glue gun and blue painters tape or masking tape
  • tripod
  • hot air gun

Software Needed

To Program the Arduino:

To Run Provided Capture Software:

  • Apple computer
  • OpenFrameworks and C++ experience for modifying the provided capture code

Lasercut Acrylic Parts

AK2A0296_full.jpg
AK2A0293_full.jpg

Included here are four vector files:

  • lidar_rig_assembled.ai : Contains aligned lasercut and non-lasercut parts separated into layers. This file is provided for your own reference or if you would like to modify any of the parts.
  • lidar_rig_lasercut_layout.ai : Contains two layers, each labeled with a different thickness of acrylic. The first option is to lasercut from these files directly. They are laid out on 12" x 12" boards.
  • lidar_rig_lasercut_layout_quarter_inch_acrylic.svg and lidar_rig_lasercut_layout_eighth_inch_acrylic.svg : These files represent the same parts as the AI file, but are provided as a second option to lasercut from, if you don't have access to Adobe Illustrator.

Proceed to lasercut all files. Cast acrylic is recommended over extruded for accuracy.

Attach Tripod Plate

AK2A0300_full.jpg
AK2A0311_full.jpg
AK2A0312_full.jpg
AK2A0313_full.jpg
AK2A0314_full.jpg

Gather the bottom plate, tripod plate, T nut insert, and three 2-56 screws.

Sandwich the bottom plate in between the T nut insert and the tripod plate. From the flanged side of the T nut, screw the 2-56 screws directly into the acrylic. The tolerances should be just right to ensure a snug fit. If they are too loose and the screws don't grip the acrylic, adjust the tolerances and lasercut new pieces.

Splice Slip Ring Into USB Cable

AK2A0316_full.jpg
AK2A0288_full.jpg
AK2A0290_full.jpg

Gather the USB A male to B mini male cable and slip ring.

A slip ring is a essentially a group of wires that can twist over and over again without ever getting stuck or tying into a knot. Slip rings solve the problem of sending and receiving data and power over a connection that needs to rotate indefinitely. We have this exactly problem in this rig, since the top gear will rotate on top of the bottom plate, but needs to be connected to it somehow to receive power and send data. This is why we need a slip ring.

Cut the USB cable about 4-5 inches away from the mini end. On both ends, pull back the rubber and wire mesh sheathing, exposing the four inner wires. Run shrink wrap tubing over each individual wire and each bunch. Solder the USB wires to each end of the slip ring, being sure to solder strong connections and connect the same USB colored wires to each end of the slip ring. For example, if a USB wire is red, you need not solder it to the red slip ring wire (though this may be easier to remember). Say you solder it to a green slip ring wire, then simply connect the other side of the slip ring's green wire to the red wire in the other half of the USB cable. Pull the tubing over the solder joints and heat with a hot air gun to shrink.

Install Slip Ring

AK2A0324_full.jpg
AK2A0326_full.jpg
AK2A0330_full.jpg
AK2A0332_full.jpg
AK2A0335_full.jpg
AK2A0336_full.jpg
AK2A0338_full.jpg
AK2A0340_full.jpg
AK2A0347_full.jpg
AK2A0342_full.jpg
AK2A0344_full.jpg

Gather the assembled slip ring cable, assembled bottom plate, three 1" 4-40 screws, and seven 4-40 nuts.

Place the screws through the holes in the slip ring. Then, screw one nut on each just a few turns shy of being tightened fully. On the one screw perpendicular to the separation of the slip ring wires place a second nut and screw about halfway up.

Slide the assemblage into the holes in the bottom plate with the two-nut screw facing toward the hole in the plate. Turn the plate over and place the last three nuts in their respective hexagonal holes. Tighten the screws into these bottom nuts, then tighten the nuts on the top of the mount using needle nose pliers. The resulting slip ring should be tightly secured on the bottom plate.

Lastly, tie the A-male end of the USB cable to the bottom of the plate with a cable tie.

Assemble LIDAR Mount

AK2A0354_full.jpg
AK2A0364_full.jpg
AK2A0365_full.jpg
AK2A0366_full.jpg
AK2A0367_full.jpg
AK2A0369_full.jpg
AK2A0372_full.jpg
AK2A0373_full.jpg
AK2A0378_full.jpg
AK2A0374_full.jpg
AK2A0390_full.jpg
AK2A0387_full.jpg
AK2A0392_full.jpg

Gather the remaining lasercut parts, eleven 5/8" 4-40 screws, and eleven 4-40 nuts.

Begin by screwing two screws into the triangular part (as shown in the photos) and tightening a nut on each halfway up the screw. Slide this part into the long rectangular piece. Tighten the screws until the two parts feel snug against one another. Don't tighten too hard or the acrylic may snap.

Then, add the smaller brace and large rectangular piece with a similar procedure, according to the photos. This becomes the mount on which the LIDAR will rest.

Repeat this procedure with the four remaining screws and nuts to attach this assemblage to the large gear.

Install Stepper Motor

AK2A0399_full.jpg
AK2A0406_full.jpg
AK2A0407_full.jpg
AK2A0409_full.jpg
AK2A0410_full.jpg
AK2A0411_full.jpg
AK2A0417_full.jpg

Gather the assembled bottom plate (with slip ring attached), stepper motor, small gear, two rubber grommets, and four 10mm M3 screws.

Using the M3 screws, screw the stepper motor into the bottom of bottom plate. Orient the stepper cables away from the center of the mount so they don't collide with a mounted tripod.

Slide a grommet halfway down the shaft of the motor. Slide the small gear on next, then finally a second grommet. Push these three down until they just clear the top of the shaft.

Assemble Rig With Turntable

AK2A0420_full.jpg
AK2A0435_full.jpg
AK2A0436_full.jpg
AK2A0437_full.jpg
AK2A0438_full.jpg
AK2A0439_full.jpg
AK2A0442_full.jpg
AK2A0443_full.jpg
AK2A0471_full.jpg
AK2A0464_full.jpg

Gather the assembled bottom plate, assembled top gear, turntable, eight 3/8" 4-40 screws, and eight 4-40 nuts.

Run the B-mini end of the USB cable through the center of the turntable. Position the turntable directly in the center of the bottom plate (it may be wise to use a small bit of tape to secure it through this process). Secure the turntable with four screws and nuts, placing the nuts on the side of the turntable.

Place the large gear on top of the turntable and rotate so that two holes align on either side of the bottom plate. Begin with two screws and two nuts. Tighten only enough so that the gear can be repositioned with a nudge. Rotate the top gear to check that it's aligned. (Look at the space between the gear and the slip ring. Uneven gaps indicate that either the top gear is off-center on the turntable. If the uneven gaps don't go away, try repositioning the turntable on the bottom plate). Finally, add the last two screws to secure both parts to the turntable.

This forms the rig (minus the LIDAR).

Mount LIDAR

AK2A0493_full.jpg
AK2A0503_full.jpg
AK2A0504_full.jpg
AK2A0505_full.jpg
AK2A0506_full.jpg
AK2A0509_full.jpg
AK2A0523_full.jpg

Gather the rig, the LIDAR, and two 6mm M3 screws.

Position the LIDAR facing toward the center of the rig on the large rectangular plate. The lip of the LIDAR (that creates a blind spot) should be facing down toward the rig to maximize the amount of unobstructed view.

Screw the LIDAR into the mount.

Connect the USB cable (B-mini) end into the LIDAR.

This completes the rig.

Assemble Motor Driver Electronics

lidar_arduino_schem_rev.png
AK2A0554_full.jpg
AK2A0557_full.jpg
AK2A0558_full.jpg
AK2A0559_full.jpg
AK2A0564_full.jpg
AK2A0565_full.jpg

Assemble all specified electronics. The arrangement of components on a protoboard is up to you; however, one possible arrangement is in the photographs above.

Solder all connects according to the circuit diagram provided above.

The switches allow you to switch between different stepping amounts for the stepper motor. The standard step I set to afford equal point spacing with a 52 second capture time is to turn the first switch on and the second two off.

The capacitor wards off voltage spikes when mounting and dismounting the 12V power supply.

Be careful not to program the Arduino while the 12V supply is connected for fear of powering the Arduino with two separate 5V sources.

The 4-pin cable is suggested as a way to connect and disconnect the rig (containing the servo) from the motor driver.

Once assembled, connect the rig to the motor driver.

Program Motor Driver

Program the Motor Driver using the code provided here.

Changing the resolution variable will change the number of steps the motor takes in one cycle. The directionPin and stepPin refer to the digital pins on the Arduino that connect to the A4988.

Be sure to unplug the 12V supply while programming the Arduino so two 5V sources aren't powering the Arduino at the same time.

Connecting and Powering the Assembly

AK2A0600_full.jpg

First, connect the USB A-male end of the cable emanating from the LIDAR rig into the USB hub as a data source. Connect your computer via usb cable into the USB hub to ensure that the LIDAR rig draws power from the hub (and thus the wall), not your computer (since it can fry your USB ports otherwise).

To power on the assembly, connect the Motor Driver System to the 12V wall power supply. Then, power on the USB hub. Your computer should recognize a new USB connection and the LIDAR should power on. On this model, a small blinking yellow light appears on the top of the device and a faint red light can be seen pulsing from the clear cylindrical section at the right angle. The large gear should also begin rotating, in turn rotating the LIDAR with it.

Recording Spherical Captures

IMG_5619.JPG
composite.jpg

To record spherical captures, first stabilize your rig by attaching it to a tripod. If you take your rig outdoors without a wall outlet near, you may need to purchase an external battery to power the motor system, USB HUB (and thus, LIDAR).

To record captures with the provided software, you will need OpenFrameworks to compile the applications. The first application you will need to compile and run (after your LIDAR is connected to your computer) is Dan Moore's ofxURG sender application. Navigate to releases > Sender to download the binaries. Follow the instructions on his README page for setting up this app.

The next application you will need to compile and run (after the sender application is running) is my urg_record application found here. OpenFrameworks familiarity is encouraged: instructions for downloading it and compiling projects can be found here.

Once both applications are open and connected to the correct OSC ports (an option you can change in the settings.xml file), you should see something like the screenshot above is all parts of the pipeline are working (of course, the scene captured will be whatever you are currently capturing).

Click New Recording to begin a recording and End Recording to end it. It will be saved in the bin > data folder of your application as a csv file. Each line in the file represents the information (682 points) recorded in one sweep of the laser. The first number is the number of elapsed milliseconds since the recording began. Each pair of points that follows represents the floating point value of the (X, Y) location in the planar space of a single scan in units of mm.

Playing Back Spherical Captures

Screen Shot 2015-11-30 at 10.53.03 PM.png
Screen Shot 2015-11-30 at 11.36.22 PM.png
Screen Shot 2015-12-05 at 5.52.38 PM.png

To play back recordings, compile the project urg_display here.

Set the path of the recorded data csv file by changing the path loaded in "ofApp.cpp"

Set the proper capture type at the top of "ofApp.h" Recordings fall into two categories: those made with the rig while it's rotating (these are spherical captures, for which this Instructable was designed), and those made with the LIDAR while it's standing still (these are linear captures, and don't need this rig or any rig for that matter).

The capture should load as soon as app is run. Change the view by translating, rescaling, and mirroring it. To slide through or rotate the scan (depending on its type), press 's' or 'r', respectively.

A few screenshots of captures that I've taken are included for reference above.

Extensions

Temporalized Hallway, Carnegie Museum
Lidar Timelapse: Sleeping
Bamboo Forest, A View as We Know It

There are many ways you can extend this project. For example (in the order of included videos):

  1. Take linear captures to see how people get "extruded" through time.
  2. Take many sequential captures and splice them into a 3D timelapse.
  3. Apply shader effects to the resulting point clouds to bring the capture to life.