Archive for the ‘Ramblings’ category

Coaster Bot

April 1, 2010

There is currently a contest by Make Magazine to create a coaster bot. I’m not looking to really win or anything, but it is a good excuse to create a robot of some sort.

Wall-E is a good example of a Robot. Also, pictures make posts more interesting I've been told.

I’ve ordered a few parts such as a pair of motors, some wheels, and a bunch of hexes of steel and aluminum for structure support. Unfortunately I don’t have much in the way of sensors so I’m not sure how I’m going to have it interact with the outside world. The only sensors I’ve ordered were a few ambient light sensors, but that doesn’t really help with navigation other than perhaps telling the robot to stop when it becomes dark (because you’re likely to be eaten by a grue).

Fortunately, sensors are really just devices that send some sort of electric signal when they “sense” something. Digital sensors will be basically an on-off sort of thing such as a sound impact sensor that detects loud sound changes like clapping. I’ll need some sort of sensor to detect other objects so the robot can perform some sort of navigation.

Luckily, there’s a simple sensor that I’m pretty sure I can build myself without buying an expensive sensor module. That is a touch sensor. The idea behind a touch sensor is to detect when the robot has basically run into something so that it can react to that in the future. I can do this by placing some pieces of material on the front of the robot that will bend slightly when the robot hits something, causing a piece of metal to complete a circuit and send a signal to the microcontroller.

If it looks like a hacked up ugly version of a large button, well it is. The idea is taken from the Lego Mindstorm kit that I played with in College. I should be able to find some scrap metal (maybe a washer or something) for the touch contact and another washer and some wire for the internals. I’m not sure what to make the touch arms out of yet, maybe some sort of wood or see if I have any plastic pieces laying around. Ideally I suppose I would use a part of a CD, but I don’t have any good tools for cutting and working with them. I’ll look into it though

Very rough diagram. The gold lines are just wires or plates that will connect to the Microcontroller.

The touch sensor design can be augmented for other uses as well. If you place a rod with a wheel attached to it on the underside of the front of the robot you can add an additional contact that will activate when that front wheel drops too low (such as when stairs or a ledge are encountered). It might not look pretty, but it won’t look pretty if the robot falls and smashes either.

So the robot itself will need to be able to navigate a space, around objects and such, in order to qualify. The touch sensor is a good start on that path, but it might be unfortunate that the robot will only be able to avoid something after having rammed into it. My cat might not like this much.

Another aspect of the contest is that the robot needs to be able to accept additional sensors to help it navigate. That seems easy enough, though it’s mostly on the programming side (the side I’m least worried about). Ideally I’ll be able to acquire some range finders, either ultrasonic sonar or maybe some sort of laser range finder.

Of which, lasers eventually need to be involved. I’m not sure how or in what capacity, but lasers are cool.

So this is the start of my CoasterBot build. I’ve ordered the motors and a few wheels along with a bunch of other construction parts. I probably should have ordered more wheels but I’ll manage I’m sure. I don’t know what’s going to come of it, but I’m sure it will be neat.

Advertisements

Do Research. Don’t Be Just A Code Monkey.

March 22, 2010

I don’t think that good developers are good because they’re overly smart and well suited for the work. Being smart is definitely a plus as it helps get to the heart of problems faster, but even the blade of the keenest intellect will be rendered blunt by the muffling sheathe of ignorance.

Waxing poetic aside, you can’t do a good job if you don’t know what you’re doing. No matter how good you think you might be, you can be better by research, study, and experimentation. I feel that this sentiment applies not only to programming, but to all matters of life. The driving force behind this reckless abandon in the pursuit of knowledge and research is passion. You might not have a passion for your job, but hopefully you have a passion for programming (assuming your a programmer… insert other career as it will work well enough in substitute). If you don’t, consider finding a different career, one you have a drive and desire to succeed in. You’ll go farther in an area you have a passion for than one you don’t. It’s better to be an expert at a “lesser” career than a bad or mediocre at a “higher” career. No one wants a rocket surgen that doesn’t really have a passion for rocket surgery.

“But how?” you may ask, thinking that just saying to ‘research’ without any idea of what goal to pursue isn’t very helpful advice at all. Well that might be true, but everyone’s passions, interests, and job requirements will differ so saying ‘learn about parallel processing’ or ‘research distributed computing’ or ‘learn Ruby, it’s awesome’ isn’t very helpful either. But there are a few methods you can use to start your exploration.

The main idea is to explore areas around your current job, but perhaps not directly related. Try learning a different language that you could, theoretically, implement your same work project in if you knew the ins and outs of it. Maybe start a personal project at home that uses that language to discover the differences between it and something else you already use. Sometimes the features of one language can give you ideas how to better use the one you’re stuck with. If you’ve ever used closures in Ruby (or another language that has them), you’ll start thinking about your Java or C code quite a bit differently.

Another excellent thing to do is learn a new framework or way of doing things that is not the norm for your day to day job. Let’s say you’re writing web apps that deal with a lot of relational database transactions and data manipulation. Try learning about non-relational databases such as object databases or NoSQL. There are many open sourced, non-sql dependent databases that you can try out to learn how you can store and retrieve semi-structured data in a non-relational way. Try to figure out the benefits you gain with your current methods, and compare them to the benefits you’d gain if you switched to a different one. You probably won’t switch your work project over, most people don’t have the authority to do such a thing, but it’s still useful because you’ll open your eyes to different ways of doing things which will end up translating to useful knowledge in your daily job.

Learn a new language every year. Do personal projects in that language. If it’s scripting, maybe make some scripts to help your day to day life out a little. Knowing how to utilize more langages will help you appreciate the differences of them and allow you to be better able to pick the best tool for a given job. It also doesn’t hurt when someone at the office starts asking for someone with experience in some new language and you’re the one who knows anything about it. Embrace change, and don’t get stuck in a rut.

Learn something new every day. Be it a use for a framework, a new language feature, or just something about your own code. Continually learning is critical in the high tech field, as you’re knowledge goes out of date way faster than a lot of other professions. Letting yourself get out of date is like letting a knife rust. It won’t be very useful to its user for long, and will be replaced if it gets too far worn.

Test your code before you write it. Test Driven Development really works. You’ll end up writing way more test code than you ever did before, which is a good thing. You might also notice that you structure your code differently if you write your tests first. The main idea is to allow each piece of code to be tested individually from any other piece of code. If you have a class that you want to test a method of, you should be able to fully test that method without implementing any other class. Any reliance on another classes behavior should be implemented through mock objects. Keep your code decoupled and program based on interfaces. It might not be a bad idea to look into a dependency injection framework, or to get familiar with the finer points of the factory design pattern.

Learning and knowledge is the key to success in our world. I would much rather have someone who’s passionate and willing to put in some work to learn how things work and how to do things better than the average day to day code monkey on my team rather than a good code monkey. The second can implement things that I ask for, but the first can invent new implementations and design reusable code that is worth 3x the code monkey.

3D Printing and Electronics

March 10, 2010

I was recently approached by a friend of mine to join forces and create a DIY 3D printer. For those who don’t know, a 3D printer is a machine that can fabricate 3D objects that are rendered in a computer using a medium such as plastic, rubber, or sugar. Much of the design is similar to a regular desktop printer, except that instead of using ink it uses a building material, and instead of just printing in 2 directions, it has a moving platform that lowers to allow for the 3rd dimension. It really just prints the material in several 2D layers that build up to slowly create a physical object. Useful in prototyping and art.

My main desire for having a 3D printer is to build housing and components for an arduino. It would be much easier to custom create components from a 3D model for me than to hand make them out of wood or metal, especially since I lack in a decent work shop with power tools. Commercial 3D printers run from $15k up, but DIY kits can be had for under a grand. I’m not sure when my resources will allow me that indulgence, but it’s something to look forward to in the future.

However, my recent fascination in the Arduino, physical computing, and robotics in general have made me wonder if I shouldn’t have also gotten a degree in Electrical Engineering. The college I graduated from did not offer that degree, however the field has begun to interest me increasingly so. I might try to look up some electronics courses at a local community college to expand my horizons.

In the meantime, one of the best ways of learning is not through an institution but through research and experimentation. For experimentation I have to wait for my arduino to arrive (it should be here on friday), but as for research, there are more possibilities in that area. I’m looking at some books on the subject, but I’m not quite sure where is the best place to start. I could focus on some of the physics and basic text books on the subject, or focus more on the experimentation and practical usages. If anyone out there has a good learning road map to a non-colligate learning curriculum on hobbyest electrical engineering, let me know. 🙂

In a slightly different ramble, I’m discovering that my leanings seem to be towards the lower level and possibly abstract areas of programming and engineering. I’ve been focusing my code on creating libraries rather than single use programs. Code reuse has always been an interesting topic in computer science I feel. It’s greatly expounded upon as one of the benefits of object oriented and modular code, the ability for reuse. However I’ve noticed that many developers, and entire teams of developers, rarely write any code that is reused in another project. They will use code from existing libraries such as the Java Standard Library, but will not often create them. However, I feel drawn to making base items that can be reused in multiple projects and by other people.

I think this is why electronic engineering fascinates me so much right now. It’s one of those areas where lower level library code is very much in need. If I can design and create a device that can interface with a microcontroller to perform some interesting action, I would then need to write a driver or library to make that interaction more abstract and easier for a basic user. I haven’t done much C/C++/Assembly programming so I’ve never written a driver, and that’s where my knowledge of theory and experience deviate.

Gaining some practical experience for basic theory is that area of excitement that I feel I can achieve by wiring up components to a microcontroller and building devices that have not yet been built. An exciting prospect that, in the end, I feel will help to improve myself as a developer.

Building Things

March 1, 2010

Most of my posts on here have been about software development and work related issues and observances. I’m going to deviate slightly into the realm of hobby, which I think is important for people of any career in order to keep the personal passion alive and to keep your brain active without burning out.

Recently I’ve been reading a lot of Make Magazine which is primarily about building things of all sorts, though it does lean a bit towards electronics. Building technology is one of those basic features of humanity that separates us from other species. When I was younger I used to visit a friend’s house who’s father had an extremely well equipped workshop that we would use to make random things. For the longest time I stored all of my blank CDR’s on a wooden spindle that we created in that shop. Somewhere along the way with college and a career, building things fell to the wayside. Something that was so interesting and involved when I was a kid I no longer thought about or had time for. It is an unfortunate state to have gotten to, but luckily I’ve been able to rediscover the fun and excitement of making things from raw materials.

My first project was to build a small scale version of a trebuchet. My version is not even close to historically accurate, was created by lashing together pieces of wood with string, isn’t extremely sturdy, and the hook on the throwing arm is a bent nail taped with electrical tape. However, it works. It can toss a small ball around 50-60′ using a sack of change as a counterweight. Just by making the proof of concept small scale rickety version, I have built in myself ambition for creating a proper model.

I think that as we get older, for those of us who don’t stay in a making field or practice, we forget that we have the ability to create things ourselves. You do not have to be a master carpenter to build a table. You can build a trebuchet using hand tools and scraps of wood without any significant training. Making things, especially if they’re fun or useful (or both!), can be a very rewarding experience that I think many people forget that they have the ability to do, even in some spare time.

One of my original ambitions upon moving to California was to utilize the local Fry’s and build myself a robot. I’m not really sure what this robot will do, or its exact purpose. It probably won’t even look like any normal robot, but I wanted to create one. It’s been almost 2 years and I haven’t started even thinking about how I would create a robot. The dream just never seemed feasible to me with my limited knowledge. I’m not an electrical engineer, I’m a computer scientist. I can program a robot that’s already built, but making one is something outside of my expertise. Luckily today with the abundance of resources on the internet along with the open source movement, Robotics and creating electronics is not out of the realm of a passionate hobbyest who has no formal training.

My next goal along the path of building things will take me to the Arduino which is an open source microcontroller. There is a kit available that will get me started on the path of physical computing with the ability to control LEDs, servos, gears, read various sensors, and make noises. The eventual robot army is the natural conclusion. Everyone needs a hobby, even if it’s world domination. It keeps the mind busy.

Blog Schedule Modification/Goals

January 15, 2010

I’ve decided to change the schedule in which I update this blog. I’m finding it difficult to make 3 updates a week and still have something relevant to say. To that effect I’m going to try a schedule of Friday updates. This will give me a week worth of experience to draw upon every post and perhaps will lead me to more on-topic discussions.

With that said I still have a post to make, and make it I shall. Today I’m going to ramble again, but this time about my own personal career and personal goals; my Developer Aspirations if you will.

From the time my family acquired our first computer, a 486 SX 25Mhz beast with 4MB ram, 210MB hard drive, 2x CD-ROM, and 2400 baud modem, I was pretty much captivated. When you spend so much time tinkering and using a thing due to pure enjoyment of discovery, it makes sense to work that thing into your career. For anyone who still wonders what profession to get into, I would highly suggest something that you can enjoy and that you spend time doing anyway.

My overall goal had been, and to an extent I would say still remains, to become a video game programmer. However that dream is not the easiest to achieve due to a very competitive employment market along with my base skill set and experience hasn’t reflected that required of the industry. I also am not that big of a fan of 16 hour workdays 7 days a week for 3 month stretches which also plagues that industry. However the independent game industry is actually thriving more than ever now due to the increase availability of embedded devices like the iPhone and the Android OS. Platforms that require by design small, narrow-focused apps that can actually be written by a single person or a small team.

So a renewed focus on embedded devices and high performance applications in restricted resource environments. I have no OpenGL experience so the 3D stuff isn’t very obtainable (I’m not the best artist either). It seems like utility applications or gameplay rather than graphic oriented games are the areas I can still dabble.

So I suppose my current development goals are to become more focused on Objective-C and the cocoa APIs. I may also attempt to leverage my free time in making small C or C++ text-based games as a refresher to build my familiarity with the C-based languages and create something simple.

Ideally if I were able to manage the commitment I would dedicate myself to making a small game every week, just to get some code out. That might be a workable goal I can put on my todo list and see if I can’t make at least one decent attempt before Spring hits us.

I think as far as current career goes I’d like to focus more on research and scalability. There are some interesting problems that don’t seem to have very good solutions. Being able to just identify a problem that needs a solution is a good step to making a useful application or model. I know that our current application does not have a very good data model for scaling beyond a few servers, and it would be good to see a way to create the same application in a distributed way like we have with programs like Git.

iPhone woes

January 12, 2010

This is a late post because I ran out of time yesterday. It’s also not on any of the subjects that I usually cover. Instead my current iPhone troubles led me to thinking about the state of smartphones and some of the general trends that the industry seems to be leaning towards.

My iPhone randomly turned off last night and hasn’t turned back on yet. I’ve tried charging it, letting it drain, all to no effect. It’s still under warranty so I’ll go and have it checked out at the Apple store tonight. However, being without the handy little device does make me appreciate it more. I also realize just how far these pieces of technology have changed my behaviors in the last few years.

The iPhone was the second cell phone I’ve ever had. My first was a Motorola Razr, which had an extremely slow data connection with a very poor web browser. It could make calls and text just fine, and for a while I figured that was the main purpose of a cell phone so it suited me well enough. I had an iPod for music playing (just a color photo one) and a PSP for playing videos on the go. The number of devices has never really been a problem since I always carried my bag around with me.

The iPhone came out and I jumped on a few months after it was released. There was no app store or any apps other than what came with the phone and web apps, however just having the ability to utilize a real web browser in a phone was pretty useful. Maps also came in handy a number of times when trying to find the nearest store or atm when I was out wandering. After native apps came around and the 3GS was released the phone became even more useful. I can use it to play music, watch video (both on youtube and just copied over), play games, run utilities, and yes, even make phone calls and text messages (now with MMS!). Often when I’m home I will not even bother to take out the laptop and turn it on because I can just as easily reach for my phone and use my home wireless to quickly view web pages or check my email.

I did not miss not having an iPhone before I had one, but now that I have one and it’s broken it drives me crazy. I have to modify my behaviors to get information from other sources instead of that small, easy to use device. I feel the same way about my Kindle. The ability to carry around new books, sync bookmarks with my handy little phone, and read any of my library anywhere is something that makes regular books seem just bland in comparison. I still love regular books, but I’m nearing the point now where if I had the option between reading a physical paper copy or the same book on the Kindle, I’d prefer the Kindle. Having dictionary and wikipedia lookup is just too useful, and so is automatic bookmarks so that I don’t have to keep scraps of paper or worry about losing my place if I need to drop the book quickly.

It is rumored that Apple will be announcing a tablet sometime later this month for availability in March or so. I can’t help but ponder and speculate what they might come up with. I’ve always known that modifications of the computer (which in all honesty is what both the iPhone and Kindle are) would be able to replace many aspects of our current lives as far as information consumption. I have to wonder if there will be a device that will replace my Kindle, Laptop, and perhaps my iPhone just like the iPhone replaced my razr, iPod, and PSP. Granted the form factor will be the most difficult aspect of replacing something like the phone, since if it’s too large to fit in your pocket you won’t want to carry it everywhere like you do with the iPhone. If the screen is too small you won’t want to read on it like you do the kindle, or do any serious writing or more involved apps like you can on a laptop.

Still, many companies have tried pushing the tablet idea and customers haven’t been biting. Apple seems to be good at customer fishing however with the most tasty of bait around. Maybe it’s the fruit origins.

The cell phone industry, especially in the area of touch smart phones, is in an incredible boom right now. Everyone is trying to outdo each other with the newest and greatest little gadget that is faster and with better battery life than their competition. Granted in the US we still have the problem of carrier lock-in and lock-downs (I’m looking at you Verizon). However even some of that is shifting as the carriers lose power to the manufacturers like Apple or Google who are beginning to dictate more and more how their phone can be used rather than the other way around. I imagine someday it will be more common to see less contract-tied plans and slightly more expensive phones that have the flexibility to move between networks. It’s already started a little bit, but the carriers are still too interested in 2-year contracts and don’t seem to be ready to give that up just yet.

So even though my iPhone is currently acting as a very expensive, and lightweight, brick, it does make me reflect that the lose of such an interesting piece of technology and the effect it can have on ones day to day life speaks volumes of where we are today and where we are going in the future of technology.