Posts

Showing posts from January, 2011

Moving code from ESP8266 to ESP32

Image
A while ago I made a mashup of Dan Royer's code CNC 2 Axis Demo with my own code for trapezoidal motion stepper and servo control for ESP8266.

I assumed porting the code to the ESP32 would be trivial, and that was true for the most part: changes like library name being Wifi.h instead of Wifi8266.h were not a problem. UDP now does not like multicharacter writes but you can use print instead. So far so good.

However, when it came to the interrupt code I was stuck with the stepper interrupt causing an exception sometimes. And to make things weirder, the servo interrupt worked flawlessly (both of them had the IRAM_ATTR directive if you ask me).

Going little by little, I could narrow down the culprit to a floating point operation during the interrupt, that would cause problems sometimes but not always. Browsing around I found this post. Where the solution was simple: do not use floats within the interrupt routines but doubles. The reason was the float calculation would be performed by…

Roomba: It does the work!

Image
This year we've got for Christmas our very first home robot. I was a bit reluctant to buy an expensive item just to figure out later it might work elsewhere but not at our home. This has not been the case. Since day one, our Roomba performed nicely and the only trouble we've got is that it does not like our low-profile doorstoppers.

We've made the comparison between them amount of dirt picked up by us and the one we remove from Roomba. I've to say the robot wins in the "who picked more dirt" game. The only extra work we're doing in preparation for Roomba to clean a room is to remove as many objects as possible that might interfere (i.e. chairs, trash bins, etc). I'd say it's been money well spent (as far as the robot keeps the performance level for a couple of years).

What is a plus is that the robot may return to the charge station by itself (sometimes) when battery needs to be recharged. I'd day this is not a feature to trust on, as I'm …

Geo-tagging with Canon Powershot S95

Image
No, geo-tagging is not a built-in feature on Canon Powershot S95. However, there is an interesting technology for doing that with your favourite camera. I was introduced to that three years ago by googler Mano Marks (of AppEngine fame) but I was not too impressed at the time (as I was not sure how to store that info). However, once I started using iPhoto I saw that application was aware of geo-location information and therefore it could be useful to have it in my pictures. This Christmas I've got a 2GB Geo Eye-Fi SD card as a present. I'm happy to report that it works nicely with my Powershot S95, where each image is shown as uploaded or not uploaded by means of an icon (Eye-Fi cards can wirelessly upload your pictures using wifi networks).
Uploaded images contain geo-location information, so when you import them into iPhoto they will include location information on where each picture was taken. This cards use the same Skyhook database used by other devices to pinpoint locatio…

Silhouette extraction algorithm

As shown in the video above I have been working on an algorithm to extract a person's silhouette for an arts installation I am working on. The main idea is to use the depth map provided by Microsoft's Kinect so only a small range of distances are used to identify the person standing on a certain spot marked on the floor. By discarding those pixels that are too far away and those too close what is left is the person or other obstacles placed a that desired distance from the camera.
It is a bit tricky to make depth and RGB cameras to match exactly the same image (as they are located a few inches apart) so video shows some discrepancy between the dancing user and the drawn contour line.
Code was written in Processing using Daniel Shiffman's kinect library for Macs, OpenCV library and MovieMaker library to create an output video file of the action. In the mean time I was developing this, Daniel updated his library and some changes were needed. Unfortunately, OpenCV for Process…