Shop OBEX P1 Docs P2 Docs Learn Events
PathMaker for Scribbler S2 — Parallax Forums

PathMaker for Scribbler S2

hyperritualhyperritual Posts: 11
edited 2013-06-20 11:00 in Robotics
Greetings,

I wrote a little sketch in Processing that lets you draw a path with your mouse and then output said path to Spin code to upload to the S2 robot, which will then follow the path drawn. Here is how it looks:

pathmaker.png


Here is the source code with instructions in comments: link
And here is a .zip archive with the sketch + example files: link

The output is just a Spin method you can include with other Spin code from which you call the method. I have another version of the makeFile() function which creates a complete file that can be uploaded to the S2 (along with s2.spin) without having to change anything.

Cheers,
Joshua
640 x 320 - 183K

Comments

  • Martin_HMartin_H Posts: 4,051
    edited 2013-06-01 15:47
    I don't own an S2 (yet), but that's a clever idea. Kudos!
  • ercoerco Posts: 20,256
    edited 2013-06-01 23:43
    Joshua: That's pure genius! I'm far from my S2 now, but look forward to giving it a try when I get home. Thanks for posting!
  • hyperritualhyperritual Posts: 11
    edited 2013-06-03 18:53
    Thank you both for your encouragement. I have also been thinking about a program to translate vector (SVG) files to Spin code.

    With some calibration, the PathMaker sketch could be used to plot a course for the S2 around some obstacles. Of course, that would defeat the fun/challenge of AI programming the robot to find its own way, but could be useful where only movement along the path is needed/desired.
  • Courtney JacobsCourtney Jacobs Posts: 903
    edited 2013-06-18 15:19
    Hyperritual,

    I am in the process of trying out this project, but I have hit a roadblock, so to speak.

    I am using a later version of Processing (2.0) than what is listed in your instructions/source code, and when I run the script it kicks out an error.

    At this line in the code:
    String path = selectInput("Select a background image...");

    I get this error:
    The method selectInput(String, String) in the type PApplet is not applicable for the arguments (String)

    Is this a version-compatibility (programming language) problem or something else that I am not seeing/understanding?


    Regards,
    Courtney Jacobs
  • hyperritualhyperritual Posts: 11
    edited 2013-06-20 11:00
    Hi, Courtney. Thank you for your interest in the sketch. The Powers That Be changed how selectInput() works in P2.0; it now requires two arguments (as you saw). Here is an updated version of the sketch, which should work for 2.0: link. I did not create a new .zip bundle for the new sketch, so just copy-and-paste it into your Processing 2.0 window. Please let me know if you have any other problems with it. Thanks again!
Sign In or Register to comment.