Grasshopper

algorithmic modeling for Rhino

(I'm not sure where this questions belongs so it's posted in the Kangaroo Group as well)

 

I'm moving a Kangaroo anchor point with a slider (x value) and it's working fine.

When I replace the slider with values from FireFly (Arduino Uno) there is an error. Any ideas why? Video here.

Thanks!

Views: 894

Attachments:

Replies to This Discussion

Hey Marten,

I downloaded your files and I found the problem... and it wasn't a Kangaroo or Firefly issue... it was a data tree problem.  Basically, when you connected slider to the X-input of the Point XYZ component... you got a single list going into both the force objects and anchor points inputs (resulting in a single list coming out).  However, because of the data structure created from the Firefly setup, the data coming from the Remap component (into the X-input) would create a data tree and the data coming out of the particles out was also a tree... and some of the paths on this tree only had 1 point which was causing the error in the Interpolated Curve component.  Essentially, all you need to do is flatten the Anchor Points input on the Kangaroo engine and your data tree should then be consistent.  I tried it and I had your strip moving around using a light sensor (pretty fun). 

BTW, I thought I would also say (and you probably new this) but if you turn on the Timer on the Uno Read component (which I assume you would do if you want to drive this with a sensor) then you wont need the Timer component connected to the kangaroo engine.  Since all of the data is being driven upstream by the Firefly component, you wont need to turn on this other timer (it would be redundant and would mostly likely slow things down... although I haven't tested this since David rewrote the Timer component).  Anyway, that's just a heads up.

HTH,

Andy

Thanks Andy! It works now. (Just flattening the anchor points input didn't quite work out, but flattening the X Input of the point did the trick.) Also thanks for explaining more about Timer components, they're still a bit of a mystery to me. It worked fine to only have one Timer at the FireFly Compnent.

BTW, Something just came to mind which I think would be great to try out with this example.  Essentially, you're using Kangaroo to simulate a bending strip of paper... what better way to simulate this than a bend sensor... and even better... you should make your own.  There's a great tutorial here: http://www.instructables.com/id/How-to-Make-Bi-Directional-Flex-Sen...  I've made a few of these bend sensors and they are a lot of fun to make... plus you learn a lot about how to make your own custom sensors.  The nice thing too is that you can make them any size and shape (which can be really crucial for certain designs).  The only thing I wanted to mention is that when you use this sensor, you probably want to use a voltage divider in your circuit and the resistor you use is important for getting the proper output.  The resistive material that I had had a really low resistance value so I had to use a really low resistor (39ohm) in my circuit.  It's really easy to setup, you just need to test which resistor to use to get a full range of output (0-1023 being ideal).  Anyway, it could be a really fun experiment.

-Andy

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service