Best setup for motor control algorithm tests

Post Reply
texasflood
Posts: 5
Joined: Wed Oct 15, 2014 6:59 pm

Best setup for motor control algorithm tests

Post by texasflood »

Hi all,

My engineering masters project is about using evolutionary algorithms to design the morphology and control algorithms for legged robots. I am planning on using bullet to simulate the success of different robots with different controllers and bodies.

Eventually, the robots should be able to be manufactured and work based on the results obtained using bullet, so accuracy is very important. My questions are:
  • What solver should I use? From this forum, (http://www.bulletphysics.org/Bullet/php ... f=9&t=1685) it seems like I should use Featherstone.
  • Is the current implementation of Featherstone working to a level where I can expect it to perform reliably? I ask because when I run the evolutionary algorithm on a large scale, I won't be able to view every simulation myself, so if something goes wrong, I won't know. How significant would the problems of 'blowing up' (http://www.bulletphysics.org/Bullet/php ... ?f=4&t=949) for the motors be for my application?
  • Is ODE more suitable for this project? I've heard they have a more mature implementation of Featherstone
  • How flexible is a btMultiBody? Could I create a full walking robot with one?
Many thanks to everyone, and a special thanks to Erwin Coumans for his outstanding work!
texasflood
Posts: 5
Joined: Wed Oct 15, 2014 6:59 pm

Re: Best setup for motor control algorithm tests

Post by texasflood »

Also, how do you add an internal tick callback function which I would need for the control algorithm? And is there any documentation on how to use the Featherstone multi body features?
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Best setup for motor control algorithm tests

Post by drleviathan »

I've looked at Bullet's Featherstone demo and implementation. I suspect that it would suit your needs.

You might also consider using the SimBody engine: https://simtk.org/home/simbody . Supposedly it has a very stable Featherstone implementation. I doubt its performance would be as fast as Bullet but would expect its simulation to be more physically correct, and you don't need real-time simulation performance for automated tests.

Regarding setting the internal tick callback function, there is a wiki page for how to do that in Bullet: http://bulletphysics.org/mediawiki-1.5. ... _Callbacks

BTW, speaking of evolutionary algorithms for legged robots... someone pointed me at this page today, and just in case you haven't seen it yet: http://goatstream.com/research/
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Best setup for motor control algorithm tests

Post by Basroil »

texasflood wrote:Hi all,

My engineering masters project is about using evolutionary algorithms to design the morphology and control algorithms for legged robots. I am planning on using bullet to simulate the success of different robots with different controllers and bodies.

Eventually, the robots should be able to be manufactured and work based on the results obtained using bullet, so accuracy is very important. My questions are:
  • What solver should I use? From this forum, (http://www.bulletphysics.org/Bullet/php ... f=9&t=1685) it seems like I should use Featherstone.
  • Is the current implementation of Featherstone working to a level where I can expect it to perform reliably? I ask because when I run the evolutionary algorithm on a large scale, I won't be able to view every simulation myself, so if something goes wrong, I won't know. How significant would the problems of 'blowing up' (http://www.bulletphysics.org/Bullet/php ... ?f=4&t=949) for the motors be for my application?
  • Is ODE more suitable for this project? I've heard they have a more mature implementation of Featherstone
  • How flexible is a btMultiBody? Could I create a full walking robot with one?
Many thanks to everyone, and a special thanks to Erwin Coumans for his outstanding work!
All depends on your motors. If you're using AX12s or analog servos, standard SI solver at higher iterations is more than enough to get within the angle read error (I've gotten below .67 degrees RMS using Dantzig solver, on par with the best results published in robotics journals, with two setup errors that have since been corrected). If you're modeling a custom motor with micro-rad resolution, you're going to need something more powerful than bullet!
texasflood
Posts: 5
Joined: Wed Oct 15, 2014 6:59 pm

Re: Best setup for motor control algorithm tests

Post by texasflood »

drleviathan wrote:I've looked at Bullet's Featherstone demo and implementation. I suspect that it would suit your needs.

You might also consider using the SimBody engine: https://simtk.org/home/simbody . Supposedly it has a very stable Featherstone implementation. I doubt its performance would be as fast as Bullet but would expect its simulation to be more physically correct, and you don't need real-time simulation performance for automated tests.

Regarding setting the internal tick callback function, there is a wiki page for how to do that in Bullet: http://bulletphysics.org/mediawiki-1.5. ... _Callbacks

BTW, speaking of evolutionary algorithms for legged robots... someone pointed me at this page today, and just in case you haven't seen it yet: http://goatstream.com/research/
Thanks, the Simbody application looks great, I think it might be more suitable for what I want, I'll check it out!

With the callback function. does that apply to a btMultiBodyDynamicsWorld as well? As far as I can tell this world does not have a setInternalTickCallback method.

And yes I have seen that, it's definitely an interesting paper. My focus is more on robotics (so no muscles) and using evolutionary algorithms to evolve the controller and the morphology together as opposed to just the controller.
texasflood
Posts: 5
Joined: Wed Oct 15, 2014 6:59 pm

Re: Best setup for motor control algorithm tests

Post by texasflood »

Basroil wrote:
texasflood wrote:Hi all,

My engineering masters project is about using evolutionary algorithms to design the morphology and control algorithms for legged robots. I am planning on using bullet to simulate the success of different robots with different controllers and bodies.

Eventually, the robots should be able to be manufactured and work based on the results obtained using bullet, so accuracy is very important. My questions are:
  • What solver should I use? From this forum, (http://www.bulletphysics.org/Bullet/php ... f=9&t=1685) it seems like I should use Featherstone.
  • Is the current implementation of Featherstone working to a level where I can expect it to perform reliably? I ask because when I run the evolutionary algorithm on a large scale, I won't be able to view every simulation myself, so if something goes wrong, I won't know. How significant would the problems of 'blowing up' (http://www.bulletphysics.org/Bullet/php ... ?f=4&t=949) for the motors be for my application?
  • Is ODE more suitable for this project? I've heard they have a more mature implementation of Featherstone
  • How flexible is a btMultiBody? Could I create a full walking robot with one?
Many thanks to everyone, and a special thanks to Erwin Coumans for his outstanding work!
All depends on your motors. If you're using AX12s or analog servos, standard SI solver at higher iterations is more than enough to get within the angle read error (I've gotten below .67 degrees RMS using Dantzig solver, on par with the best results published in robotics journals, with two setup errors that have since been corrected). If you're modeling a custom motor with micro-rad resolution, you're going to need something more powerful than bullet!
I definitely don't need micro radian resolution :P I am not actually going to build the robot myself, that is beyond the scope of my project but in theory, someone in the future should be able to use my results and actually build a robot.
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Best setup for motor control algorithm tests

Post by drleviathan »

texasflood wrote: With the callback function. does that apply to a btMultiBodyDynamicsWorld as well? As far as I can tell this world does not have a setInternalTickCallback method.
Yes. btMultiBodyDynamicsWorld derives from btDiscreteDynamicsWorld which derives from btDynamicsWorld which implements setInternalTickCallback().

You can test by hacking the Featherstone demo to have an InternalTickCallback that prints a counter. I've followed the instructions on the InternalTickCallback page for a regular btDiscreteDynamicsWorld and it worked for me.
texasflood
Posts: 5
Joined: Wed Oct 15, 2014 6:59 pm

Re: Best setup for motor control algorithm tests

Post by texasflood »

drleviathan wrote:
texasflood wrote: With the callback function. does that apply to a btMultiBodyDynamicsWorld as well? As far as I can tell this world does not have a setInternalTickCallback method.
Yes. btMultiBodyDynamicsWorld derives from btDiscreteDynamicsWorld which derives from btDynamicsWorld which implements setInternalTickCallback().

You can test by hacking the Featherstone demo to have an InternalTickCallback that prints a counter. I've followed the instructions on the InternalTickCallback page for a regular btDiscreteDynamicsWorld and it worked for me.
OK, that makes sense then, thanks. Having looked at Simbody, I think it might be more suitable for me. Are there any limitations of Simbody that would be a problem for me, in your opinion?
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Best setup for motor control algorithm tests

Post by drleviathan »

I've never used SimBody for my own projects but I did play with some of their demos and poked around their source code. There's one called "JaredsDude" that models a humanoid character from the waist down. It appeared stable and physically correct... more or less. The legs don't actually collide with the floor except for some spheres that are part of the feet, but that is how the demo was designed to work, as far as I can tell.

I didn't see any limitations of the physics engine except for the fact that for large simulations it probably was not going to run in real-time - as far as I know SimBody hasn't been used for an actual game or virtual world.
Post Reply