Check out Inline::C. You can use it to write a Perl module that wraps the C API for your robot. As long as you can get Perl and Perl modules installed on the machine your program will execute on, you should be golden. My former roomate took a similar class while we were in University and all the processing was done offboard on a laptop. They were doing a lot of vision work, which, for some reason, is really easy to do in Matlab. They had no problem using Matlab's C interface to control the robot.

As to your question about resources: Perl typically uses more memory and runs slower than an equivalent C program, but this only typically matters if you are doing a lot of iteration or dealing with a massive amount of data. I've done a fair amount of AI-related development in Perl and have found the reduced development time was more than a fair trade-off for the slight speed deficit. That said, I'd be careful doing hard-core search in Perl. I ran into a lot of trouble doing heurisitic search in a program that played stratego. To milk any sort of performance in these problems you'll need to know a lot about subroutine calls, recursion, and parameter passing in Perl. I ended up forking off a C process to do the search, but I would have wrapped the code using Inline::C if I'd known how to do so at the time.

Check out XS Info for more information about calling C from Perl. The original question referenced XS, but there is a good deal of Inline::C info in the node as well.


In reply to Re: Hardware Programming and Perl by dbp
in thread Hardware Programming and Perl by Willman023

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.