Shared posts

27 Jan 21:43

Flight

by David M Willis
02 Aug 16:57

Simple Autonomy with an RC Boat

by Ethan Zonca

[Vlad] wrote in to tell us about his latest project—an RC boat that autonomously navigates between waypoints. Building an autonomous vehicle seems like a really complicated project, but [Vlad]’s build shows how you can make a simple waypoint-following vehicle without a background in autonomy and control systems. His design is inspired by the Scout autonomous vehicle that we’ve covered before.

[Vlad] started prototyping with an Arduino, a GPS module, and a digital compass. He wrote a quick sketch that uses the compass and GPS readings to control a servo that steers towards a waypoint. [Vlad] took his prototype outside and walked around to make sure that steering and navigation were working correctly before putting it in a boat. After a bit of tweaking, his controller steered correctly and advanced to the next waypoint after the GPS position was within 5 meters of its goal.

boatgifNext [Vlad] took to the water. His first attempt was a home-built airboat, which looked awesome but unfortunately didn’t work very well. Finally he ended up buying a $20 boat off of eBay and made a MOSFET-based motor controller to drive its dual thrusters. This design worked much better and after a bit of PID tuning, the boat was autonomously navigating between waypoints in the water. In the future [Vlad] plans to use the skills he learned on this project to make an autopilot for the 38-foot catamaran his dad is building (an awesome project by itself!). Watch the video after the break for more details and to see the boat in action.


Filed under: robots hacks
01 Aug 20:51

Photo



29 Dec 12:53

medievalpoc: Khadak (2006) A Mongolian post-apocalyptic sci...











medievalpoc:

Khadak (2006)

A Mongolian post-apocalyptic sci fi/fantasy film about a plague that threatens to eradicate nomadism with a disabled protagonist? Get on my to-watch list!

You can view the trailer here.

29 Dec 12:47

"Languages animate objects by giving them names, making them noticeable when we might not otherwise..."

Languages animate objects by giving them names, making them noticeable when we might not otherwise be aware of them. Tuvan has a word iy (pronounced like the letter e), which indicates the short side of a hill.

I had never noticed that hills had a short side. But once I learned the word, I began to study the contours of hills, trying to identify the iy. It turns out that hills are asymmetrical, never perfectly conical, and indeed one of their sides tends to be steeper and shorter than the others.

If you are riding a horse, carrying firewood, or herding goats on foot, this is a highly salient concept. You never want to mount a hill from the iy side, as it takes more energy to ascend, and an iy descent is more treacherous as well. Once you know about the iy, you see it in every hill and identify it automatically, directing your horse, sheep, or footsteps accordingly.

This is a perfect example of how language adapts to local environment, by packaging knowledge into ecologically relevant bits. Once you know that there is an iy, you don’t really have to be told to notice it or avoid it. You just do. The language has taught you useful information in a covert fashion, without explicit instruction.



- K. David Harrison, The Last Speakers (via perugu—-annam)
25 Dec 17:50

Secret Attic Library Door

by Josh Marsh

We have a pretty good guess where [Krizbleen] hides away any seasonal presents for his family: behind his shiny new secret library door. An experienced woodworker, [Krizbleen] was in the process of finishing the attic in his home when he decided to take advantage of the chimney’s otherwise annoying placement in front of his soon-to-be office. He built a false wall in front of the central chimney obstacle and placed a TV in the middle of the wall (directly in front of the chimney) flanked on either side by a bookcase.

If you touch the secret book or knock out the secret sequence, however, the right-side bookcase slides gently out of the way to reveal [Krizbleen’s] home office. Behind the scenes, a heavy duty linear actuator pushes or pulls the door as necessary, onto which [Krizbleen] expertly mounted the bookcase with some 2″ caster wheels. The actuator expects +24V or -24V to send it moving in one of its two directions, so the Arduino Uno needed a couple of relays to handle the voltage difference.

The effort spent here was immense, but the result is seamless. After borrowing a knock-detection script and hooking up a secondary access button concealed in a book, [Krizbleen] had the secret door he’d always wanted: albeit maybe a bit slow to open and close. You can see a video of its operation below.


Filed under: Arduino Hacks, home hacks
27 Aug 18:13

CodeSOD: The Database Gazes Also Into You

by Dan Adams-Jacobson

When Simon asked us to consider this code from his predecessor's custom-built PHP CMS, we weren't terribly impressed:

$rs = new RecordSet("SELECT * FROM moduleData WHERE moduleID = '".$moduleID."' ORDER BY displayOrder ASC");

Since that code just selects a single record by its primary key, the only thing wrong with it is the redundant ORDER BY clause. But that wasn't all. Simon leaned forward across the table, his face made sinister by the single, flickering light bulb we make every would-be submitter sit under (TDWTF policy), and he whispered, "Wouldn't you like to know about the field in moduleData called SQLCode?"

We should have known better, Dear Reader. You would have known better. You would have known not to ask, not to take Simon's hand and follow him down the rickety, rusty spiral staircase into madness.

"SELECT * FROM ( SELECT * FROM (
    SELECT 1 as active, modulePR.*, DATE_FORMAT(createDate, '%M %Y') as groupBy FROM modulePR WHERE ".is_published($moduleID, 'modulePR', SITE_ID)." AND archiveStatus ".(ARCHIVE_MODE ? " =1" : " <>1")."
    UNION
    SELECT 0 as active, modulePR_old.*, DATE_FORMAT(createDate, '%M %Y') as groupBy FROM modulePR_old WHERE ".is_published($moduleID, 'modulePR_old', SITE_ID)." AND archiveStatus ".(ARCHIVE_MODE ? " =1" : " <>1")." GROUP BY linkUID
    ORDER BY active DESC, lastEditedDate desc
) as pr1
GROUP BY linkUID
) as prSorted
ORDER BY DATE_FORMAT(createDate,'%Y%m') DESC, itemTitle

Yes, that is a SQL string with PHP embedded in it, being stored in a database table. And, as Simon was quick to point out, that is_published() function returns even more SQL that makes up the first part of the WHERE clause. At this point, we'd learned our lesson. The lightbulb had flickered out while Simon described the monstrosity, and now his face was lost in shadow. He seemed to be chuckling to himself, quietly. He seemed to know, as we knew, that we were duty-bound to hear the fate of the SQL string. Praying it would just be fed to a simple eval() call, we kept recording—for you, Dear Reader. We did this for you...

while(!$rs->EOF()) {
    $moduleData['sql'] = !@eval("return ".$rs->field("SQLCode").";") ? !@eval("return \"".$rs->field("SQLCode")."\";") ? false : @eval("return \"".$rs->field("SQLCode")."\";") : @eval("return ".$rs->field("SQLCode").";");
    // ...snip a dozen or so more fields to build the $moduleData array, several of which contain similar thing to the above
    $rs2 = new RecordSet($moduleData['sql']);
    while(!$rs2->EOF()) {
        // ...
    }
    $rs->next();
}

Simon was laughing openly now, the atonal cackle of the truly lost. With the last of our sanity we heard him say, "The SQL/PHP blob from the DB is eval()ed to determine whether it's valid PHP code. In this example it isn't, so the eval fails, so it's eval()ed again with quotes around it to determine whether it's a valid PHP string-with-embedded-PHP-code. If either of these tests succeeds, the successful eval() is run one more time to get a value to put into the $moduleData[] array."

He went on, as though unable to stop, "If neither eval() works, or if they just return a falsey value like zero or the empty string, moduleData['sql'] gets set to false. False isn't a valid SQL string, so you'd think passing it into a new RecordSet without any further error checks might be a problem, but, no! The RecordSet class fails silently on SQL errors, and just sets EOF to true."

That's all we got out of Simon, who would do nothing further but mutter "GROUP BY with no aggregate" over and over. Weep for him, Dear Reader, for he has surely glimpsed an abyss. And shed a tear for yourself, for now you have, too.

[Advertisement] Have you seen BuildMaster 4.3 yet? Lots of new features to make continuous delivery even easier; deploy builds from TeamCity (and other CI) to your own servers, the cloud, and more.