<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Carlitos' Contraptions &#187; Robotics</title>
	<atom:link href="http://carlitoscontraptions.com/category/project/robotics/feed/" rel="self" type="application/rss+xml" />
	<link>http://carlitoscontraptions.com</link>
	<description>A modest journal of my creations.</description>
	<lastBuildDate>Fri, 16 Jul 2010 04:21:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Panoramaker</title>
		<link>http://carlitoscontraptions.com/2009/10/panoramaker/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=panoramaker</link>
		<comments>http://carlitoscontraptions.com/2009/10/panoramaker/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 01:55:03 +0000</pubDate>
		<dc:creator>Carlitos</dc:creator>
				<category><![CDATA[Project]]></category>
		<category><![CDATA[Robotics]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://carlitoscontraptions.com/?p=348</guid>
		<description><![CDATA[As promised before, here is the Python script that runs my panoramic camera hardware. It is a very quick prototype and is by no means intended for widespread use since it requires manual calibration. Nevertheless, it might be very useful to those seeking to learn how to position the servos or control a digital camera [...]]]></description>
			<content:encoded><![CDATA[<p>As promised <a title="Panoramic Camera Prototype" href="http://carlitoscontraptions.com/2009/09/panoramic-camera-prototype/">before</a>, here is the Python script that runs my <a title="Panoramic Camera Prototype" href="http://carlitoscontraptions.com/2009/09/panoramic-camera-prototype/">panoramic camera hardware</a>. It is a very quick prototype and is by no means intended for widespread use since it requires manual calibration. Nevertheless, it might be very useful to those seeking to learn how to position the servos or control a digital camera through Python.</p>
<p>This script requires my <a title="Pololu Library" href="http://carlitoscontraptions.com/2009/07/pololu-python-library/">Pololu library</a> and includes some codes from <a title="Digital Camera Control with gphoto2 " href="https://vmlaker.org/geek/python/digital-camera-control-with-gphoto2">here</a> in order to control the camera. Besides the basic requirements of lib_pololu,  the script also requires <a title="gPhoto" href="http://gphoto.sourceforge.net/">gPhoto</a>. If you are running Linux, you most likely  already have it but in case you do not, you can install it through your favourite package manager or by using the console (e.g. for Ubuntu/Debian):</p>
<blockquote><p>sudo apt-get install gphoto</p></blockquote>
<p>If you are using some other OS, you can download gPhoto from <a title="Download gPhoto" href="http://sourceforge.net/projects/gphoto/files/">here</a>.</p>
<p><strong>The Code</strong></p>
<div><a href="http://carlitoscontraptions.com/http://files.carlitoscontraptions.com/programming/Panoramaker/panoramaker.txt" style="float: right; margin-right: 5px;">Download</a>
<div class="dean_ch" style="white-space: wrap;"><span class="co1"># Adding the path to the lib_pololu.py file to your modules path.</span><br />
<span class="co1"># Assuming that the file is at /your/path/to/the/library/lib_pololu.py</span><br />
<span class="kw1">import</span> <span class="kw3">sys</span><br />
<span class="kw3">sys</span>.<span class="me1">path</span>.<span class="me1">append</span><span class="br0">&#40;</span><span class="st0">&#8216;/your/path/to/the/library&#8217;</span><span class="br0">&#41;</span></p>
<p><span class="co1"># Import the lib_pololu module</span><br />
<span class="kw1">import</span> lib_pololu</p>
<p><span class="co1"># Import the serial communication and time modules</span><br />
<span class="kw1">import</span> serial<br />
<span class="kw1">import</span> <span class="kw3">time</span></p>
<p><span class="co1"># Open serial port</span><br />
port = serial.<span class="me1">Serial</span><span class="br0">&#40;</span><span class="st0">&#8216;/dev/ttyUSB1&#8242;</span><span class="br0">&#41;</span><br />
port.<span class="me1">baudrate</span>=<span class="nu0">2400</span> <span class="co1">#set an appropriate baudrate</span></p>
<p><span class="co1"># Camera Code (from vmlaker.org)</span><br />
<span class="kw1">import</span> <span class="kw3">os</span>, <span class="kw3">re</span><br />
<span class="kw1">from</span> <span class="kw3">subprocess</span> <span class="kw1">import</span> call, Popen, PIPE</p>
<p><span class="kw1">def</span> run<span class="br0">&#40;</span>command<span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&#8216;Running:&#8217;</span>, command<br />
&nbsp; &nbsp; p = Popen<span class="br0">&#40;</span>command, shell=<span class="kw2">True</span>, stdout=PIPE<span class="br0">&#41;</span><br />
&nbsp; &nbsp; lines = p.<span class="me1">stdout</span>.<span class="me1">readlines</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">for</span> line <span class="kw1">in</span> lines:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&#8216;Stdout :&#8217;</span>, line,<br />
&nbsp; &nbsp; <span class="kw1">return</span> lines<br />
<span class="kw1">def</span> capture<span class="br0">&#40;</span><span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; c = <span class="st0">&#8216;gphoto2 &#8211;capture-image&#8217;</span><br />
&nbsp; &nbsp; sout = run<span class="br0">&#40;</span>c<span class="br0">&#41;</span><br />
&nbsp; &nbsp; firstLine = sout<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; expr = <span class="st0">&#8216;New file is in location (.*?) on the camera&#8217;</span><br />
&nbsp; &nbsp; comp = <span class="kw3">re</span>.<span class="kw2">compile</span><span class="br0">&#40;</span>expr, <span class="kw3">re</span>.<span class="me1">DOTALL</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; path = <span class="kw3">re</span>.<span class="me1">findall</span><span class="br0">&#40;</span>comp, firstLine<span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><br />
&nbsp; &nbsp; <span class="kw2">dir</span>, fname = <span class="kw3">os</span>.<span class="me1">path</span>.<span class="me1">split</span><span class="br0">&#40;</span>path<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; c = <span class="st0">&#8216;gphoto2 &#8211;get-file %s &#8211;folder %s&#8217;</span>%<span class="br0">&#40;</span>fname, <span class="kw2">dir</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; run<span class="br0">&#40;</span>c<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; c = <span class="st0">&#8216;gphoto2 &#8211;delete-file %s &#8211;folder %s&#8217;</span>%<span class="br0">&#40;</span>fname, <span class="kw2">dir</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; run<span class="br0">&#40;</span>c<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; c = <span class="st0">&#8216;gphoto2 &#8211;storage-info&#8217;</span><br />
&nbsp; &nbsp; run<span class="br0">&#40;</span>c<span class="br0">&#41;</span></p>
<p><span class="co1"># Calibration Parameters</span><br />
<span class="co1"># These parameters set the limits and reference positions of the rig.</span><br />
<span class="co1"># They have been obtained trough trial and error.</span><br />
horizontal = <span class="nu0">93.5</span><br />
front = <span class="nu0">95.5</span><br />
back_l = <span class="nu0">84.5</span><br />
back_r = <span class="nu0">107</span><br />
top = <span class="nu0">70</span><br />
bottom = <span class="nu0">110</span></p>
<p><span class="co1"># Create two motors</span><br />
<span class="co1"># There are associated to the panning and tilting motion of the rig.</span><br />
tilt = lib_pololu.<span class="me1">Servo</span><span class="br0">&#40;</span>port, <span class="nu0">0</span>, <span class="nu0">1150</span>, <span class="nu0">4650</span><span class="br0">&#41;</span><br />
pan = lib_pololu.<span class="me1">Servo</span><span class="br0">&#40;</span>port, <span class="nu0">1</span>, <span class="nu0">1200</span>, <span class="nu0">4987</span><span class="br0">&#41;</span></p>
<p><span class="co1"># Define a capture routine</span><br />
<span class="co1"># This is a simple loop that takes pictures in order to produce a</span><br />
<span class="co1"># 360 deg panorama.</span><br />
<span class="kw1">def</span> capture_pano<span class="br0">&#40;</span><span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1"># Capture parameters</span><br />
&nbsp; &nbsp; steps_h = <span class="nu0">16</span><br />
&nbsp; &nbsp; steps_v = <span class="nu0">4</span><br />
&nbsp; &nbsp; step_h = <span class="br0">&#40;</span>back_r &#8211; back_l<span class="br0">&#41;</span>/steps_h<br />
&nbsp; &nbsp; step_v = <span class="br0">&#40;</span>bottom &#8211; top<span class="br0">&#41;</span>/steps_v<br />
&nbsp; &nbsp; pos_v = bottom</p>
<p>&nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span>pos_v &gt;=top<span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; tilt.<span class="me1">set_pos</span><span class="br0">&#40;</span>pos_v<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; pos_v = pos_v &#8211; step_v<br />
&nbsp; &nbsp; &nbsp; &nbsp; pos_h = back_l<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span><span class="br0">&#40;</span>pos_h &lt;= back_r<span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pan.<span class="me1">set_pos</span><span class="br0">&#40;</span>pos_h<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pos_h = pos_h + step_h<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">time</span>.<span class="me1">sleep</span><span class="br0">&#40;</span><span class="nu0">2</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; capture<span class="br0">&#40;</span><span class="br0">&#41;</span></p>
<p>
<span class="co1"># Initialize the motors</span><br />
tilt.<span class="me1">set_pos</span><span class="br0">&#40;</span>horizontal<span class="br0">&#41;</span><br />
pan.<span class="me1">set_pos</span><span class="br0">&#40;</span>front<span class="br0">&#41;</span><br />
<span class="kw3">time</span>.<span class="me1">sleep</span><span class="br0">&#40;</span><span class="nu0">2</span><span class="br0">&#41;</span></p>
<p><span class="co1"># Capture the panorama</span><br />
capture_pano<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp;</div>
</div>
<p>Again, many thanks to <a title="RobotShop" href="http://www.robotshop.com/">RobotShop</a> who provided the hardware that made this project possible.</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F10%2Fpanoramaker%2F&amp;title=Panoramaker&amp;bodytext=As%20promised%20before%2C%20here%20is%20the%20Python%20script%20that%20runs%20my%20panoramic%20camera%20hardware.%20It%20is%20a%20very%20quick%20prototype%20and%20is%20by%20no%20means%20intended%20for%20widespread%20use%20since%20it%20requires%20manual%20calibration.%20Nevertheless%2C%20it%20might%20be%20very%20useful%20to%20those%20see" title="Digg"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F10%2Fpanoramaker%2F&amp;title=Panoramaker" title="StumbleUpon"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F10%2Fpanoramaker%2F&amp;title=Panoramaker" title="Reddit"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Panoramaker%20-%20http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F10%2Fpanoramaker%2F" title="Twitter"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F10%2Fpanoramaker%2F&amp;t=Panoramaker" title="Facebook"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F10%2Fpanoramaker%2F&amp;title=Panoramaker&amp;notes=As%20promised%20before%2C%20here%20is%20the%20Python%20script%20that%20runs%20my%20panoramic%20camera%20hardware.%20It%20is%20a%20very%20quick%20prototype%20and%20is%20by%20no%20means%20intended%20for%20widespread%20use%20since%20it%20requires%20manual%20calibration.%20Nevertheless%2C%20it%20might%20be%20very%20useful%20to%20those%20see" title="del.icio.us"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F10%2Fpanoramaker%2F&amp;title=Panoramaker&amp;annotation=As%20promised%20before%2C%20here%20is%20the%20Python%20script%20that%20runs%20my%20panoramic%20camera%20hardware.%20It%20is%20a%20very%20quick%20prototype%20and%20is%20by%20no%20means%20intended%20for%20widespread%20use%20since%20it%20requires%20manual%20calibration.%20Nevertheless%2C%20it%20might%20be%20very%20useful%20to%20those%20see" title="Google Bookmarks"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F10%2Fpanoramaker%2F&amp;partner=sociable" title="Print"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://carlitoscontraptions.com/2009/10/panoramaker/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Panoramic Camera &#8211; Prototype</title>
		<link>http://carlitoscontraptions.com/2009/09/panoramic-camera-prototype/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=panoramic-camera-prototype</link>
		<comments>http://carlitoscontraptions.com/2009/09/panoramic-camera-prototype/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 05:46:45 +0000</pubDate>
		<dc:creator>Carlitos</dc:creator>
				<category><![CDATA[Project]]></category>
		<category><![CDATA[Robotics]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://carlitoscontraptions.com/?p=333</guid>
		<description><![CDATA[This time, I built a panoramic camera. My main objective was to have a platform that can be used with pretty much any camera and that can produce panoramas with a minimum of work. If there is enough interest from the public and if this prototype is well received by the DIY community, I'm planning to produce (and hopefully sell) kits that would include all the parts to build this device.]]></description>
			<content:encoded><![CDATA[<h2><span style="color: #ff0000;">Update: </span></h2>
<p style="padding-left: 30px;">Read the follow up posts: <a title="Panoramaker" href="http://carlitoscontraptions.com/2009/10/panoramaker/">Panoramaker</a>, where I expose the software, and <a title="Automatic Panoramas in Montreal" href="http://carlitoscontraptions.com/2009/10/automatic-panoramas-in-montreal/">Automatic Panoramas in Montreal</a>, where the final result can be seen.</p>
<p>I have finally completed my second project sponsored by <a title="RobotShop" href="http://www.robotshop.com/">RobotShop</a>. I apologize for the immense delay, I really missed my promise of rolling out a new project every two weeks. Let&#8217;s just say that I had a lot going on lately and I could barely keep up with my obligations, let alone blogging or building new projects.</p>
<div id="attachment_338" class="wp-caption aligncenter" style="width: 310px"><a href="http://carlitoscontraptions.com/wp-content/uploads/2009/09/ville_marie_2_fused.tif.jpg"><img class="size-medium wp-image-338" title="Place Ville-Marie" src="http://carlitoscontraptions.com/wp-content/uploads/2009/09/ville_marie_2_fused.tif-300x83.jpg" alt="Place Ville Marie Panorama" width="300" height="83" /></a><p class="wp-caption-text">Place Ville-Marie Panorama</p></div>
<p>This time, I built a panoramic camera. My main objective was to have a platform that can be used with pretty much any camera and that can produce panoramas with a minimum of work. If there is enough interest from the public and if this prototype is well received by the DIY community, I&#8217;m planning to produce (and hopefully sell) kits that would include all the parts to build this device.</p>
<h3>Materials</h3>
<ul>
<li><a title="Hitec HS-785HB Winch Servo Motor" href="http://www.robotshop.ca/hitec-hs785hb-servo-motor.html">Hitec HS-785HB Winch Servo Motor</a></li>
<li><a title="ServoCity SPT200 Direct Drive Pan &amp; Tilt System" href="http://www.robotshop.ca/servocity-spt200-pan-tilt.html">ServoCity SPT200 Direct Drive Pan &amp; Tilt System</a></li>
<li><a href="http://www.robotshop.ca/pololu-micro-serial-servo-controller.html">Pololu Micro Serial 8 Servo Controller</a></li>
<li><a title="Hitec HS-425BB Servo Motor" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.robotshop.ca');" href="http://www.robotshop.ca/Hitec-HS-425BB-Servo-Motor.html">Hitec HS-425BB Servo Motor</a></li>
<li>A digital camera</li>
<li>Small plastic container</li>
<li>Battery holders</li>
<li>(Rechargeable) Batteries</li>
<li>A piece of aluminum (I used an old heat sink)</li>
<li>A long nut (of the same size as a tripod screw)</li>
<li>A screw (that fits into the tripod attachment on the camera)</li>
<li>A tripod</li>
<li>Cable ties</li>
<li>A small piece of neoprene (or any other mushy substance)</li>
<li>A <a onclick="javascript:pageTracker._trackPageview('/outbound/article/www.ftdichip.com');" href="http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm">USB to Serial cable</a></li>
<li>Some female headers and wires</li>
</ul>
<h3>Putting It Together</h3>
<div id="attachment_341" class="wp-caption aligncenter" style="width: 310px"><a href="http://carlitoscontraptions.com/wp-content/uploads/2009/09/Canon31.jpg"><img class="size-medium wp-image-341" title="Panoramic Camera Mount" src="http://carlitoscontraptions.com/wp-content/uploads/2009/09/Canon31-300x240.jpg" alt="Panoramic Camera Mount" width="300" height="240" /></a><p class="wp-caption-text">Panoramic Camera Mount</p></div>
<p>The first step was to put together the ServoCity Pan and Tilt system. This took away much of the building work since it is really simple to put together in no time at all. Nevertheless, I applied some modifications to it: I discarded the bottom plate that should be attached to the panning servo (since I am using a larger winch servo that would not fit otherwise), and I drilled a hole on the top plate in order to be able to fasten the camera to the rig. Note that I also included a little piece of neoprene that was lying around in order to prevent the bottom of my camera from getting scratched.</p>
<p>The mounting hole for the camera must be placed so that the lens&#8217; pupil is at the centre of rotation. This way, the horizontal rotation axis will be close to the no-parallax-error point  (or whatever it is called) of the camera and will minimize the parallax errors.</p>
<p>Then, I used an old heat sink as the main structure since it is sturdy and basically free. I used the trusty Dremel to adapt it and cut the proper holes and slots in order to mount all the remaining pieces. The pieces to be mounted on the aluminum plate are the battery holders, the Pololu servo controller, and the winch servo motor. (or whatever it is called</p>
<p>I encapsulated the Pololu servo controller in a small plastic container I got from for free while on a trip with my girlfriend to the beauty/ soap/cream shop. I also used two 2-AA battery holders in order to provide power for the servo motors. I used 29000 mAh NiMH rechargeable batteries that gave me several hours of autonomy. In order to connect the battery holders to the controller, I soldered a two-position female header and insulated the leads with heat-shrink tubing.</p>
<p>I used almost exclusively cable ties to tie everything on the aluminum plate except for the winch servo motor that I screwed in and the long nut that was also screwed in place (after being drilled sideways).  I also had to drill the bottom aluminum face in order to allow for the tripod screw to be inserted into the nut.</p>
<h3>Operating it</h3>
<div id="attachment_343" class="wp-caption aligncenter" style="width: 310px"><a href="http://carlitoscontraptions.com/wp-content/uploads/2009/09/Panorama.jpg"><img class="size-medium wp-image-343" title="Panoramic camera in action" src="http://carlitoscontraptions.com/wp-content/uploads/2009/09/Panorama-300x240.jpg" alt="Panoramic camera in action" width="300" height="240" /></a><p class="wp-caption-text">Panoramic camera in action</p></div>
<p>This first prototype requires a laptop to be operated, which can be a little annoying.  I plan to use my EeePC in the immediate future and an embedded computer for an eventual commercial kit. It basically works as follows:</p>
<ol>
<li>The camera is set on the panoramic mount, which is fastened to the tripod.</li>
<li>The servo controller and the camera are connected to the computer trough their respective USB cables.</li>
<li>The controlling program is run.</li>
<li>The user waits in awe while the camera takes pictures by itself.</li>
</ol>
<p>In order to control the hardware, I use a python script that uses my <a title="Pololu Library" href="http://carlitoscontraptions.com/2009/07/pololu-python-library/">Pololu library</a> and <a title="gPhoto" href="http://gphoto.sourceforge.net/">gPhoto</a> in order to operate the servos and the camera respectively. I chose gPhoto since it supports a very wide range of cameras and it is very easy to use.</p>
<p>For now, taking a full 360 panorama takes about 15 minutes. This is a very long time and is mostly due to the fact that my script was hastily put together without care about the performance and in very little time. I will, very soon, post a cleaner version of the code, as well as all the panoramas I took properly processes and in full format, similarly to what I did with my <a title="San Francisco Panoramas" href="http://carlitoscontraptions.com/2009/05/making-panoramas/">San Francisco panoramas</a>.</p>
<h3>Acknowledgements</h3>
<div id="attachment_345" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.robotshop.com/"><img class="size-medium wp-image-345" title="RobotShop" src="http://carlitoscontraptions.com/wp-content/uploads/2009/09/robotshop_logoSIDE_001-300x128.jpg" alt="RobotShop.com" width="300" height="128" /></a><p class="wp-caption-text">RobotShop.com</p></div>
<p>I would like to thank the great people at <a title="RobotShop" href="http://www.robotshop.com/">RobotShop</a> for providing the <a title="Pololu servo controller" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.robotshop.ca');" href="http://www.robotshop.ca/pololu-micro-serial-servo-controller.html">Pololu Micro Serial Servo Controller</a>, the   <a title="ServoCity SPT200 Direct Drive Pan &amp; Tilt System" href="http://www.robotshop.ca/servocity-spt200-pan-tilt.html">ServoCity SPT200 Direct Drive Pan &amp; Tilt System</a>, and the <a title="Hitec HS-785HB Winch Servo Motor" href="http://www.robotshop.ca/hitec-hs785hb-servo-motor.html">Hitec HS-785HB Winch Servo Motor</a>. This is the second (and hopefully not the last) project they sponsor here at <a title="Carlitos' Contraptions" href="../">Carlitos’ Contraptions</a>. Without their help, I would have never been able to afford any of the materials (except for those that come straight from the garbage as usual).</p>
<p>They have also being very patient and understanding about my unexpected delay in rolling out this project.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 1730px; width: 1px; height: 1px;">http://carlitoscontraptions.com/2009/05/making-panoramas/</div>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F09%2Fpanoramic-camera-prototype%2F&amp;title=Panoramic%20Camera%20-%20Prototype&amp;bodytext=This%20time%2C%20I%20built%20a%20panoramic%20camera.%20My%20main%20objective%20was%20to%20have%20a%20platform%20that%20can%20be%20used%20with%20pretty%20much%20any%20camera%20and%20that%20can%20produce%20panoramas%20with%20a%20minimum%20of%20work.%20If%20there%20is%20enough%20interest%20from%20the%20public%20and%20if%20this%20prototype%20is%20well%20received%20by%20the%20DIY%20community%2C%20I%27m%20planning%20to%20produce%20%28and%20hopefully%20sell%29%20kits%20that%20would%20include%20all%20the%20parts%20to%20build%20this%20device." title="Digg"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F09%2Fpanoramic-camera-prototype%2F&amp;title=Panoramic%20Camera%20-%20Prototype" title="StumbleUpon"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F09%2Fpanoramic-camera-prototype%2F&amp;title=Panoramic%20Camera%20-%20Prototype" title="Reddit"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Panoramic%20Camera%20-%20Prototype%20-%20http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F09%2Fpanoramic-camera-prototype%2F" title="Twitter"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F09%2Fpanoramic-camera-prototype%2F&amp;t=Panoramic%20Camera%20-%20Prototype" title="Facebook"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F09%2Fpanoramic-camera-prototype%2F&amp;title=Panoramic%20Camera%20-%20Prototype&amp;notes=This%20time%2C%20I%20built%20a%20panoramic%20camera.%20My%20main%20objective%20was%20to%20have%20a%20platform%20that%20can%20be%20used%20with%20pretty%20much%20any%20camera%20and%20that%20can%20produce%20panoramas%20with%20a%20minimum%20of%20work.%20If%20there%20is%20enough%20interest%20from%20the%20public%20and%20if%20this%20prototype%20is%20well%20received%20by%20the%20DIY%20community%2C%20I%27m%20planning%20to%20produce%20%28and%20hopefully%20sell%29%20kits%20that%20would%20include%20all%20the%20parts%20to%20build%20this%20device." title="del.icio.us"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F09%2Fpanoramic-camera-prototype%2F&amp;title=Panoramic%20Camera%20-%20Prototype&amp;annotation=This%20time%2C%20I%20built%20a%20panoramic%20camera.%20My%20main%20objective%20was%20to%20have%20a%20platform%20that%20can%20be%20used%20with%20pretty%20much%20any%20camera%20and%20that%20can%20produce%20panoramas%20with%20a%20minimum%20of%20work.%20If%20there%20is%20enough%20interest%20from%20the%20public%20and%20if%20this%20prototype%20is%20well%20received%20by%20the%20DIY%20community%2C%20I%27m%20planning%20to%20produce%20%28and%20hopefully%20sell%29%20kits%20that%20would%20include%20all%20the%20parts%20to%20build%20this%20device." title="Google Bookmarks"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F09%2Fpanoramic-camera-prototype%2F&amp;partner=sociable" title="Print"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://carlitoscontraptions.com/2009/09/panoramic-camera-prototype/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Gentle Safe Cracker</title>
		<link>http://carlitoscontraptions.com/2009/07/gentle-safe-cracker/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=gentle-safe-cracker</link>
		<comments>http://carlitoscontraptions.com/2009/07/gentle-safe-cracker/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 19:30:44 +0000</pubDate>
		<dc:creator>Carlitos</dc:creator>
				<category><![CDATA[Project]]></category>
		<category><![CDATA[Robotics]]></category>
		<category><![CDATA[Cracking]]></category>
		<category><![CDATA[Mechanics]]></category>

		<guid isPermaLink="false">http://carlitoscontraptions.com/?p=277</guid>
		<description><![CDATA[The problem: I found a little safe box in the garbage some time ago and I would really like to open it. The box features some dents and scratches that show some people tried to open it in the past but did not succeed. Also, when shaken, it produces some interesting noises that indicate it [...]]]></description>
			<content:encoded><![CDATA[<h3>The problem:</h3>
<div id="attachment_278" class="wp-caption aligncenter" style="width: 310px"><a href="http://carlitoscontraptions.com/wp-content/uploads/2009/07/IMG_1437.JPG"><img class="size-medium wp-image-278" title="Safe Box" src="http://carlitoscontraptions.com/wp-content/uploads/2009/07/IMG_1437-300x240.jpg" alt="Misterious Safe Box" width="300" height="240" /></a><p class="wp-caption-text">Mysterious Safe Box</p></div>
<p>I found a little safe box in the garbage some time ago and I would really like to open it. The box features some dents and scratches that show some people tried to open it in the past but did not succeed. Also, when shaken, it produces some interesting noises that indicate it is not empty and may contain <span style="text-decoration: line-through;">a valuable treasure</span> some cool junk.</p>
<h3>The Plan:</h3>
<p>Of course, there are many ways of achieving this (e.g. cutting holes into its walls, removing the hinges, hiring a locksmith) but I do not want to break the safe, nor do I want to hire anyone to do it in my place. Inspired by so many movies, the first thing I tried was to listen to the (nonexistent) clicking of the dial as it turns: it did not work at all.</p>
<p>Very quickly, I decided that the appropriate way of doing it (given my set of skills) was to have a machine do it in my place. So, I decided to build a little manipulator that will test all possible combinations of the safe until it opens up.</p>
<p>Since this requires precise positioning, I thought a servo motor would be the best choice of actuator (and also because I have some other project ideas involving servos).</p>
<h3>The Materials:</h3>
<ul>
<li><a title="Pololu servo controller" href="http://www.robotshop.ca/pololu-micro-serial-servo-controller.html">Pololu Micro Serial Servo Controller</a></li>
<li><a title="Hitec HS-425BB Servo Motor" href="http://www.robotshop.ca/Hitec-HS-425BB-Servo-Motor.html">Hitec HS-425BB Servo Motor</a></li>
<li>Male and female headers</li>
<li>Power adaptor (4 to 6 VDC)</li>
<li>Wire</li>
<li>Heat shrink tubing</li>
<li><a href="http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm">USB to Serial cable</a></li>
<li>2 gears and a spindle (one four times larger than the other, I got mine from an old photocopier)</li>
<li>A project box (in my case, an old computer power supply case)</li>
<li>A bottle cap and an old heat sink</li>
<li>Steel wire (e.g. form an old coat hanger)</li>
<li>Magnets (the stronger the better)</li>
<li>Various screws</li>
</ul>
<h3>Essential Tools</h3>
<ul>
<li>Screwdrivers</li>
<li>Rotary tool (Dremel)</li>
<li>File</li>
</ul>
<h3>The How and the Why:</h3>
<div id="attachment_281" class="wp-caption aligncenter" style="width: 310px"><a href="http://carlitoscontraptions.com/wp-content/uploads/2009/07/IMG_1388.JPG"><img class="size-medium wp-image-281" title="IMG_1388" src="http://carlitoscontraptions.com/wp-content/uploads/2009/07/IMG_1388-300x225.jpg" alt="The Electronics" width="300" height="225" /></a><p class="wp-caption-text">Electronic Parts</p></div>
<p>I chose the Pololu servo controller since it is easy to interface by either using a computer or a simple microcontroller. Also, I already own a USB-to-serial cable (that I normally use to program the <a title="Arduino" href="http://carlitoscontraptions.com/category/arduino/">Arduino</a>) that I can use to send commands to the controller.</p>
<p>The choice of the servo motor was based in getting the maximum torque at a reasonable price.</p>
<p>In order to control the servo motor, I devised a simple <a title="lib_pololu.py" href="http://files.carlitoscontraptions.com/programming/Pololu/lib_pololu.txt">python module</a> as seen in <a title="Pololu Library" href="http://carlitoscontraptions.com/2009/07/pololu-python-library/">my previous post</a>.</p>
<p>Since, usually, servo motors have a motion range slightly greater than 180 deg, I decided to use gears to be able to produce a motion range large enough to operate the safe (at least two full turns).</p>
<div id="attachment_283" class="wp-caption aligncenter" style="width: 310px"><a href="http://carlitoscontraptions.com/wp-content/uploads/2009/07/Safe_Cracker.jpg"><img class="size-medium wp-image-283" title="Mechanical Parts" src="http://carlitoscontraptions.com/wp-content/uploads/2009/07/Safe_Cracker-300x240.jpg" alt="Mechanical Parts" width="300" height="240" /></a><p class="wp-caption-text">Mechanical Parts</p></div>
<p>I used an old heat sink and cut it with the Dremel in order to produce a bracket for the servo and a mounting hole for the secondary (smallest) gear axle.</p>
<p>I attached the larger gear to the servo directly using the brackets and screws that came bundled with <a title="Hitec HS-425BB Servo Motor" href="http://www.robotshop.ca/Hitec-HS-425BB-Servo-Motor.html">the motor</a>. Also, in order to hold the shaft in place, I used <a title="e-style retaining ring" href="http://www.mcmaster.com/#retaining-rings/=2saqww">e-style retaining rings</a> and spacers (other dummy gears and shoulder washers) in order to match the grooves already present in the shaft. Of course, I got all these handy mechanical parts from an old photocopier I found in the garbage.</p>
<div id="attachment_285" class="wp-caption aligncenter" style="width: 310px"><a href="http://carlitoscontraptions.com/wp-content/uploads/2009/07/IMG_1366.JPG"><img class="size-medium wp-image-285" title="Dial Coupling" src="http://carlitoscontraptions.com/wp-content/uploads/2009/07/IMG_1366-300x225.jpg" alt="Dial coupling attached to the small gear" width="300" height="225" /></a><p class="wp-caption-text">Dial coupling attached to the small gear</p></div>
<p>In order to couple the small gear to the safe dial, I used a bottle cap which fitted perfectly over it. The cap has some child proofing which provided a firm grip for the dial.</p>
<div id="attachment_282" class="wp-caption aligncenter" style="width: 310px"><a href="http://carlitoscontraptions.com/wp-content/uploads/2009/07/IMG_1386.JPG"><img class="size-medium wp-image-282" title="Project Box" src="http://carlitoscontraptions.com/wp-content/uploads/2009/07/IMG_1386-300x240.jpg" alt="The Project Box" width="300" height="240" /></a><p class="wp-caption-text">The Project Box</p></div>
<p>Once the assembly was done, I mounted it into an old power supply box. Although the box required some drilling and cutting, it was very easy to adapt. I would recommend using this type of boxes for other projects since they are sturdy and easy to machine.</p>
<p style="text-align: left;">
<div id="attachment_287" class="wp-caption aligncenter" style="width: 310px"><a href="http://carlitoscontraptions.com/wp-content/uploads/2009/07/Safe_Cracker1.jpg"><img class="size-medium wp-image-287" title="Safe Cracker Electronic Assembly" src="http://carlitoscontraptions.com/wp-content/uploads/2009/07/Safe_Cracker1-300x240.jpg" alt="Electronic Assembly" width="300" height="240" /></a><p class="wp-caption-text">Electronic Assembly</p></div>
<p style="text-align: left;">So to include the electronic parts into the box, I used a small plastic capsule (that must come from the time when my young brother liked those little toys they sell in a dispensing machine). In the capsule, I placed the Pololu servo controller, the USB to serial cable and the servo motor cable, and the power supply cable.</p>
<p style="text-align: left;">I needed to adapt the USB to serial cable in order to match the pin-out on the controller. For this, I used a male and a female header, and some wire. I connected the GND and the V+ pins to their respective counterparts, and the TX pin to the Serial-in pin.</p>
<p style="text-align: left;">In order to supply the appropriate power, I used an old cellphone charger and I replaced its original connector with a female header. As always, it is good practise to isolate the electrical connections with some heat-shrink tubing.</p>
<h3 style="text-align: left;">The (disappointing) outcome</h3>
<p style="text-align: left;">
<div id="attachment_288" class="wp-caption aligncenter" style="width: 310px"><a href="http://carlitoscontraptions.com/wp-content/uploads/2009/07/Safe_Cracker2.jpg"><img class="size-medium wp-image-288" title="Safe Cracker Mark 1" src="http://carlitoscontraptions.com/wp-content/uploads/2009/07/Safe_Cracker2-300x240.jpg" alt="Very gentle safe cracker " width="300" height="240" /></a><p class="wp-caption-text">Very gentle safe cracker </p></div>
<p style="text-align: left;">Once everything was done, I fixed the new little machine to the safe and got ready to get it trying codes. I used a coat hanger and some rare earth magnets in order to hold the cracker firmly in place.</p>
<p style="text-align: left;">To my great disappointment, I realized that the gears I used provoked a (much expected) torque reduction. This meant that the system is not strong enough for turning the dial to a set position reliably. No matter how much lubricant I used, the dial was too stiff for the little robot.</p>
<p style="text-align: left;">This represents a (temporary) victory for the safe, but the war is far from being over.</p>
<p style="text-align: left;"><strong>Epilogue</strong></p>
<p style="text-align: left;">I decided to publish these results in spite of my failure since too often we read reports of success (notably in science) and often forget that we can learn from failures as well. Never do we read about scientits proving their original hypothesis wrong, but very often, documenting those mistakes could prevent others from doing the same.</p>
<p style="text-align: left;">Finally, for those wondering how I was planning to pull on the safe lids so it opens, it is remarkably simple: since the safe does not have any handle to latch it closed, I merely need to hang it from its handle and try the codes until it opens and the bottom part goes down.</p>
<p style="text-align: left;">
<div id="attachment_289" class="wp-caption aligncenter" style="width: 310px"><a href="http://carlitoscontraptions.com/wp-content/uploads/2009/07/IMG_1391.JPG"><img class="size-medium wp-image-289" title="The safe hanging" src="http://carlitoscontraptions.com/wp-content/uploads/2009/07/IMG_1391-300x225.jpg" alt="The safe hanging unaware of its fate" width="300" height="225" /></a><p class="wp-caption-text">The safe hanging unaware of its fate</p></div>
<p>Finally (this time for real), I cannot say too much about my next plans on attacking the safe, but be sure that they involve a stepper motor.</p>
<h3>Acknowledgements:</h3>
<div id="attachment_292" class="wp-caption alignleft" style="width: 193px"><a href="http://www.robotshop.com/"><img class="size-medium wp-image-292" title="RobotShop" src="http://carlitoscontraptions.com/wp-content/uploads/2009/07/robotshop_logoTOP_004-183x300.jpg" alt="RobotShop.com" width="183" height="300" /></a><p class="wp-caption-text">RobotShop.com</p></div>
<p>I would like to thank the great people at <a title="RobotShop" href="http://www.robotshop.com/">RobotShop</a> for providing the <a title="Pololu servo controller" href="http://www.robotshop.ca/pololu-micro-serial-servo-controller.html">Pololu Micro Serial Servo Controller</a> and the <a title="Hitec HS-425BB Servo Motor" href="http://www.robotshop.ca/Hitec-HS-425BB-Servo-Motor.html">Hitec HS-425BB Servo Motor</a>. As I mentioned <a title="RobotShop + Carlitos' Contraptions" href="http://carlitoscontraptions.com/2009/06/robotshop-carlitos-contraptions/">before</a>, they will be sponsoring a set of projects here at <a title="Carlitos' Contraptions" href="http://carlitoscontraptions.com/">Carlitos&#8217; Contraptions</a> in the foreseeable future.</p>
<p>They were also kind enough to quickly ship a <a title="Hitec HS-422/425 Replacement Resin Gears" href="http://www.robotshop.ca/hitec-hs-422-425-gear-set.html">replacement gear set</a> when I ruined the original one on the servo motor by hand forcing it to turn (I know, I sound brilliant).</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fgentle-safe-cracker%2F&amp;title=Gentle%20Safe%20Cracker&amp;bodytext=The%20problem%3A%0D%0A%0D%0A%0D%0AI%20found%20a%20little%20safe%20box%20in%20the%20garbage%20some%20time%20ago%20and%20I%20would%20really%20like%20to%20open%20it.%20The%20box%20features%20some%20dents%20and%20scratches%20that%20show%20some%20people%20tried%20to%20open%20it%20in%20the%20past%20but%20did%20not%20succeed.%20Also%2C%20when%20shaken%2C%20it%20produ" title="Digg"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fgentle-safe-cracker%2F&amp;title=Gentle%20Safe%20Cracker" title="StumbleUpon"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fgentle-safe-cracker%2F&amp;title=Gentle%20Safe%20Cracker" title="Reddit"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Gentle%20Safe%20Cracker%20-%20http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fgentle-safe-cracker%2F" title="Twitter"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fgentle-safe-cracker%2F&amp;t=Gentle%20Safe%20Cracker" title="Facebook"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fgentle-safe-cracker%2F&amp;title=Gentle%20Safe%20Cracker&amp;notes=The%20problem%3A%0D%0A%0D%0A%0D%0AI%20found%20a%20little%20safe%20box%20in%20the%20garbage%20some%20time%20ago%20and%20I%20would%20really%20like%20to%20open%20it.%20The%20box%20features%20some%20dents%20and%20scratches%20that%20show%20some%20people%20tried%20to%20open%20it%20in%20the%20past%20but%20did%20not%20succeed.%20Also%2C%20when%20shaken%2C%20it%20produ" title="del.icio.us"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fgentle-safe-cracker%2F&amp;title=Gentle%20Safe%20Cracker&amp;annotation=The%20problem%3A%0D%0A%0D%0A%0D%0AI%20found%20a%20little%20safe%20box%20in%20the%20garbage%20some%20time%20ago%20and%20I%20would%20really%20like%20to%20open%20it.%20The%20box%20features%20some%20dents%20and%20scratches%20that%20show%20some%20people%20tried%20to%20open%20it%20in%20the%20past%20but%20did%20not%20succeed.%20Also%2C%20when%20shaken%2C%20it%20produ" title="Google Bookmarks"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fgentle-safe-cracker%2F&amp;partner=sociable" title="Print"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://carlitoscontraptions.com/2009/07/gentle-safe-cracker/feed/</wfw:commentRss>
		<slash:comments>49</slash:comments>
		</item>
		<item>
		<title>Pololu Python Library</title>
		<link>http://carlitoscontraptions.com/2009/07/pololu-python-library/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=pololu-python-library</link>
		<comments>http://carlitoscontraptions.com/2009/07/pololu-python-library/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 04:54:29 +0000</pubDate>
		<dc:creator>Carlitos</dc:creator>
				<category><![CDATA[Project]]></category>
		<category><![CDATA[Robotics]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://carlitoscontraptions.com/?p=222</guid>
		<description><![CDATA[I started writing a library for controlling the Pololu motor controllers with a computer trough a serial port. I&#8217;m writing this in Python so the code can be cross-platform but I would be very glad to have some feedback about running it on other OSs than Linux. Actually, any feedback would be very welcome. As [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_269" class="wp-caption aligncenter" style="width: 310px"><a href="http://carlitoscontraptions.com/wp-content/uploads/2009/07/IMG_1409.JPG"><img class="size-medium wp-image-269" title="Pololu Micro Serial Servo Controller" src="http://carlitoscontraptions.com/wp-content/uploads/2009/07/IMG_1409-300x240.jpg" alt="Pololu Micro Serial Servo Controller" width="300" height="240" /></a><p class="wp-caption-text">Pololu Micro Serial Servo Controller</p></div>
<p>I started writing a library for controlling the Pololu motor controllers with a computer trough a serial port.</p>
<p>I&#8217;m writing this in Python so the code can be cross-platform but I would be very glad to have some feedback about running it on other OSs than Linux. Actually, any feedback would be very welcome.</p>
<p>As of now it can interface with the <a title="Pololu servo controller" href="http://www.pololu.com/catalog/product/207/resources">Pololu Micro Serial Servo Controller</a> that I got form <a title="Pololu servo controller" href="http://www.robotshop.ca/pololu-micro-serial-servo-controller.html">RobotShop</a>.  I am planning to use this code in my upcoming project RobotShop is sponsoring. I will supplement this library as I get newer hardware to work with.</p>
<p>I know there is already a <a href="http://dmt195.wordpress.com/2009/01/19/python-to-interface-with-the-pololu-8-channel-servo-controller/">python interface</a> for it but I really wanted to have an object oriented way of managing motors (i.e. they can be instantiated and controlled more easily).</p>
<p>You can download the library here: <a title="lib_pololu.py" href="http://files.carlitoscontraptions.com/programming/Pololu/lib_pololu.txt">lib_pololu.py</a> (you will need to change the extension of the file to .py instead of txt).</p>
<p>In order to properly use this library you will require:</p>
<ol>
<li><a title="Python" href="http://www.python.org/download/">Python</a></li>
<li><a href="http://sourceforge.net/projects/pyserial/files/">Pyserial</a></li>
</ol>
<p>If you use a civilized OS you may be able to get all this by typing this in a command prompt:</p>
<blockquote><p>sudo apt-get install idle python-serial</p></blockquote>
<p>Here is a sample script that will use the library in order to control a servo: <a href="http://files.carlitoscontraptions.com/programming/Pololu/servo_example.txt">servo_example.py</a> (you will need to change the extension of the file to .py instead of txt).</p>
<div><a href="http://carlitoscontraptions.com/http://files.carlitoscontraptions.com/programming/Pololu/servo_example.txt" style="float: right; margin-right: 5px;">Download</a>
<div class="dean_ch" style="white-space: wrap;"><span class="co1"># Adding the path to the lib_pololu.py file to your modules path.</span><br />
<span class="co1"># Assuming that the file is at your/path/to/the/library/lib_pololu.py</span><br />
<span class="kw1">import</span> <span class="kw3">sys</span><br />
<span class="kw3">sys</span>.<span class="me1">path</span>.<span class="me1">append</span><span class="br0">&#40;</span><span class="st0">&#8216;/your/path/to/the/library&#8217;</span><span class="br0">&#41;</span></p>
<p><span class="co1">#Import the lib_pololu module</span><br />
<span class="kw1">import</span> lib_pololu</p>
<p><span class="co1">#Import the serial communication module that should already be installed</span><br />
<span class="kw1">import</span> serial</p>
<p><span class="co1">#Open serial port</span><br />
port = serial.<span class="me1">Serial</span><span class="br0">&#40;</span><span class="st0">&#8216;/dev/ttyUSB0&#8242;</span><span class="br0">&#41;</span><br />
port.<span class="me1">baudrate</span>=<span class="nu0">2400</span> <span class="co1">#set an appropriate baudrate</span></p>
<p><span class="co1">#Create a motor assuming that the motor is connected to the connector</span><br />
<span class="co1">#number 0 on the controller. The two numbers (1150 and 4650) are</span><br />
<span class="co1">#the calibration values corresponding to the 0 ans 180 deg positions</span><br />
<span class="co1">#respectively. These are the numbers that should be sent to the servos </span><br />
<span class="co1">#using command 4 with the methos send_command() in lib_pololu</span><br />
motor = lib_pololu.<span class="me1">Servo</span><span class="br0">&#40;</span>port, <span class="nu0">0</span>, <span class="nu0">1150</span>, <span class="nu0">4650</span><span class="br0">&#41;</span></p>
<p><span class="co1">#Playing around with the motor</span><br />
motor.<span class="me1">set_pos</span><span class="br0">&#40;</span><span class="nu0">45</span><span class="br0">&#41;</span> <span class="co1">#sets the posotion of the motors in degerees.</span><br />
motor.<span class="me1">set_speed</span><span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span> <span class="co1">#sets the speed at a value between 0 and 127</span><br />
&nbsp;</div>
</div>
<p>Note for Redmond OS (aka Window$) users: you will need the <a title="Win32 Extensions for Python" href="http://python.net/crew/mhammond/win32/Downloads.html">Win32 Python extension</a> for pyserial to work.</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fpololu-python-library%2F&amp;title=Pololu%20Python%20Library&amp;bodytext=%0D%0A%0D%0AI%20started%20writing%20a%20library%20for%20controlling%20the%20Pololu%20motor%20controllers%20with%20a%20computer%20trough%20a%20serial%20port.%0D%0A%0D%0AI%27m%20writing%20this%20in%20Python%20so%20the%20code%20can%20be%20cross-platform%20but%20I%20would%20be%20very%20glad%20to%20have%20some%20feedback%20about%20running%20it%20on%20othe" title="Digg"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fpololu-python-library%2F&amp;title=Pololu%20Python%20Library" title="StumbleUpon"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fpololu-python-library%2F&amp;title=Pololu%20Python%20Library" title="Reddit"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Pololu%20Python%20Library%20-%20http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fpololu-python-library%2F" title="Twitter"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fpololu-python-library%2F&amp;t=Pololu%20Python%20Library" title="Facebook"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fpololu-python-library%2F&amp;title=Pololu%20Python%20Library&amp;notes=%0D%0A%0D%0AI%20started%20writing%20a%20library%20for%20controlling%20the%20Pololu%20motor%20controllers%20with%20a%20computer%20trough%20a%20serial%20port.%0D%0A%0D%0AI%27m%20writing%20this%20in%20Python%20so%20the%20code%20can%20be%20cross-platform%20but%20I%20would%20be%20very%20glad%20to%20have%20some%20feedback%20about%20running%20it%20on%20othe" title="del.icio.us"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fpololu-python-library%2F&amp;title=Pololu%20Python%20Library&amp;annotation=%0D%0A%0D%0AI%20started%20writing%20a%20library%20for%20controlling%20the%20Pololu%20motor%20controllers%20with%20a%20computer%20trough%20a%20serial%20port.%0D%0A%0D%0AI%27m%20writing%20this%20in%20Python%20so%20the%20code%20can%20be%20cross-platform%20but%20I%20would%20be%20very%20glad%20to%20have%20some%20feedback%20about%20running%20it%20on%20othe" title="Google Bookmarks"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fcarlitoscontraptions.com%2F2009%2F07%2Fpololu-python-library%2F&amp;partner=sociable" title="Print"><img src="http://carlitoscontraptions.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://carlitoscontraptions.com/2009/07/pololu-python-library/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
