softbankrobotics-research / qibullet

Bullet simulation for SoftBank Robotics robots
Apache License 2.0
145 stars 38 forks source link

Equations for NAO inverse dynamics #45

Closed wbadry closed 4 years ago

wbadry commented 4 years ago

Hello, Is it possible to get the code for NAO inverse dynamics? I am looking for performing joint control. I would appreciate if there is a function I can get with equations for controlling the locomotion of NAO.

Thank you so much as you always respond in a fast way.

issue-label-bot[bot] commented 4 years ago

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

mbusy commented 4 years ago

Hi, if you're looking for inverse dynamics, my advice would be to directly use the pybullet API, more specifically the calculateInverseDynamics method (see the doc of the API here). The body unique id required by the method corresponds to the model of your robot, you can retrieve it via the getRobotModel method of the qibullet API

wbadry commented 4 years ago

I am lost with the API. Is there any example on NAO such that:

def compute_inverse_dyanmics_nao(x_dot,y_dot):
      .
      .
      .
      .
      return (theta_dot_1, ..... theta_dot_25)

My intent is to use it to control NAO on webots since there is no decent controller for it based on inverse dynamics. The software is free and allows motor control of each joint,

mbusy commented 4 years ago

What you're trying to achieve is a bit unclear... What is (x_dot, y_dot) ? The velocity of the robot's floor projection in the world frame ? and I'm assuming that the theta_dot are the velocities of NAO's joints ?

In any case, if your ultimate goal is to control NAO's walk, we currently don't plan on adding a walk controller to the project (we could consider merging a PR that would add such a feature though). The best course of action for you would be to use an open source walk controller (eg oru controller, mrsp controller), and interface it with a simulated NAO

wbadry commented 4 years ago

You are absolutely correct. I thought the walking is already implemented but it is possibly a recorded steps if not mistaken .

Thank you so much @mbusy for your fast response. I'll have a look at what you suggested.

mbusy commented 4 years ago

No walk controller has been implemented in qibullet. The "NAO walking gif" of the Readme is indeed obtained by replaying/mimicking (in the simulation) the joint positions of a real NAO, walking.

You're welcome, I'll close this issue for now