]> pere.pagekite.me Git - homepage.git/blob - blog/archive/2010/09/09.rss
Generated.
[homepage.git] / blog / archive / 2010 / 09 / 09.rss
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
3 <channel>
4 <title>Petter Reinholdtsen - Entries from September 2010</title>
5 <description>Entries from September 2010</description>
6 <link>http://people.skolelinux.org/pere/blog/</link>
7
8
9 <item>
10 <title>My first perl GUI application - controlling a Spykee robot</title>
11 <link>http://people.skolelinux.org/pere/blog/My_first_perl_GUI_application___controlling_a_Spykee_robot.html</link>
12 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/My_first_perl_GUI_application___controlling_a_Spykee_robot.html</guid>
13 <pubDate>Wed, 1 Sep 2010 21:00:00 +0200</pubDate>
14 <description>
15 &lt;p&gt;This evening I made my first Perl GUI application. The last few
16 days I have worked on a Perl module for controlling my recently
17 aquired Spykee robots, and the module is now getting complete enought
18 that it is possible to use it to control the robot driving at least.
19 It was now time to figure out how to use it to create some GUI to
20 allow me to drive the robot around. I picked PerlQt as I have had
21 positive experiences with the Qt API before, and spent a few minutes
22 browsing the web for examples. Using Qt Designer seemed like a short
23 cut, so I ended up writing the perl GUI using Qt Designer and
24 compiling it into a perl program using the puic program from
25 libqt-perl. Nothing fancy yet, but it got buttons to connect and
26 drive around.&lt;/p&gt;
27
28 &lt;p&gt;The perl module I have written provide a object oriented API for
29 controlling the robot. Here is an small example on how to use it:&lt;/p&gt;
30
31 &lt;p&gt;&lt;pre&gt;
32 use Spykee;
33 Spykee::discover(sub {$robot{$_[0]} = $_[1]});
34 my $host = (keys %robot)[0];
35 my $spykee = Spykee-&gt;new();
36 $spykee-&gt;contact($host, &quot;admin&quot;, &quot;admin&quot;);
37 $spykee-&gt;left();
38 sleep 2;
39 $spykee-&gt;right();
40 sleep 2;
41 $spykee-&gt;forward();
42 sleep 2;
43 $spykee-&gt;back();
44 sleep 2;
45 $spykee-&gt;stop();
46 &lt;/pre&gt;&lt;/p&gt;
47
48 &lt;p&gt;Thanks to the release of the source of the robot firmware, I could
49 peek into the implementation at the other end to figure out how to
50 implement the protocol used by the robot. I&#39;ve implemented several of
51 the commands the robot understand, but is still missing the camera
52 support to make it possible to control the robot from remote. First I
53 want to implement support for uploading new firmware and configuring
54 the wireless network, to make it possible to bootstrap a Spykee robot
55 without the producers Windows and MacOSX software (I only have Linux,
56 so I had to ask a friend to come over to get the robot testing
57 going. :).&lt;/p&gt;
58
59 &lt;p&gt;Will release the source to the public soon, but need to figure out
60 where to make it available first. I will add a link to
61 &lt;a href=&quot;http://wiki.nuug.no/grupper/robot/&quot;&gt;the NUUG wiki&lt;/a&gt; for
62 those that want to check back later to find it.&lt;/p&gt;
63 </description>
64 </item>
65
66 </channel>
67 </rss>