Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Program “Greppy”, a 2-wheeled robot, using a new robotics language (yoga.dev)
130 points by tlb 4 days ago | hide | favorite | 25 comments





Off-topic. I'm thinking about building a game where players are controlling real robots. The players compete for resources which are randomly distributed in the land. In the first version of the game it will be on the Earth. This game can be later used to help colonize Moon and Mars.

Do you know any robots which can be used in such game?


You probably heard of Isotopium: Chernobyl. Interesting concept and a solid implementation of a similar idea.

https://youtu.be/TET-xQIgZQE


wow had no idea something like this existed. thanks for the tip

Nope never heard of it. That is amazing.

Amazing! Thank you

Looks like this is what Bret Victor is promoting for years: a real-time feedback loop with your code and the outcome.

This would also be very nice for game development as Bret Victor demonstrated multiple times.

great!


I'm greatly inspired by his work. It seems magical for game design.

Game engines like Unity also let you tweak a lot of things interactively, but more by making those things be assets rather than code. But I never really liked that style. (For that matter, I don't like CSS being separate from the page content either.)

So I want Dynamicland for robots.


How does the differentiable programming implementation work?

Yoga is purely functional, so it's possible to use backpropagation to compute it efficiently.

It actually compiles 2 versions of each function: call them foo and foo.grad. foo.grad takes the same arguments as foo, and also a gradient for each output argument. It then computes gradients for each input argument.

The algorithm is simple: traverse the expression tree in the usual order you'd use for emitting code, and remember the order. Then traverse in reverse order, propagating gradients as you go.

The tedious bit is writing the gradients for every built-in op. For an operation like + it's simple: each argument gets the same gradient as the result:

  void ExprAdd::backprop(YogaContext const &ctx, GradientExprSet &grads, ExprNode *g)
  {
    grads.addGradient(ctx, args[0], g);
    grads.addGradient(ctx, args[1], g);
  }
For something like divide it's a bit grosser:

  void ExprDiv::backprop(YogaContext const &ctx, GradientExprSet &grads, ExprNode *g)
  {
    // https://en.wikipedia.org/wiki/Quotient_rule
    grads.addGradient(ctx, args[0], ctx.mkExpr<ExprDiv>(g, args[1]));
    grads.addGradient(ctx, args[1], ctx.mkExpr<ExprNeg>(
      ctx.mkExpr<ExprMul>(g,
        ctx.mkExpr<ExprDiv>(
          args[0],
          ctx.mkExpr<ExprPow>(
            args[1],
            ctx.mkExpr<ExprConstDouble>(2.0))))));
  }
More at https://gitlab.com/umbrellaresearch/yoga2/-/blob/master/jit/... if you're curious.

Have you considered using an off the shelf differentiable programming implementation? Or are the requirements for real-time applications too demanding for existing software?

I looked at a few systems but didn't think any of them would work.

The real-time requirement is fairly hard. The robots I work on use a 1 kHz feedback loop, so it has 1 mS in which to recalculate everything.

Caffe is pretty efficient if you can supply batches of values, but the overhead is high when running real-time.


have you tried torchscript w/ the C++ interface?

No. It looks promising. I should try it.

I think Tensorflow with Swift or Rust bindings may also work.

has umbrellaresearch considered changing yoga to a different name ? start with my +1

Okay I'm 100% biased, but this is something I've enjoyed working with as well. It's made developing a self-balancing greppy super easy :)

The robot’s name seems to imply it can find specific items in a cluttered closet. Is that the case?

That's what the googley eyes are for! Ideally, this isn't the only "greppy" design (:

Oh man, I need this. Also for finding stuff in a cluttered [my] brain.

This is amazing. I love the concept of remote programmable robotics and the real-time feedback of the controls is a great idea. I think this is the way forward, I wasted countless hours trying to fiddle with code only to see the robot failing on the edge of breaking apart. Any indications on how to build my own Greppy and the whole infrastructure behind it? :)

Curious about your use case! Do you want to setup your own warehouse for you and your own friends? Or use the existing Yoga warehouse and get your own personal Greppy on it that only a subset of people can share? Or something else?

I would love to understand how the whole thing works actually and how it can be configured/updated. Surely this approach can be adapted to smaller robots? It's more of a curiosity question since I love to tinker with robots and am looking for a good way to make them better. Apart from didactic purposes I don't have a really specific use case yet. :)

Yoga is a language as well as an environment, so if the robot has an open controller where a compiled program can be installed, it will work!

What robot did you want to tinker with


By the way Trevor is a founder of YC

I love this creepy robot!



Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: