rohanpsingh / LearningHumanoidWalking

Training a humanoid robot for locomotion using Reinforcement Learning
BSD 2-Clause "Simplified" License
227 stars 40 forks source link

Questions about applying the algorithm to other models #25

Open TRYzero opened 7 months ago

TRYzero commented 7 months ago

Hello, I've been encountering some challenges while attempting to apply your algorithm to different bipedal robots. Specifically, I tested the algorithm on two robots with distinct configurations.

  1. On a bipedal robot with six joints per leg, the robot can walk, but it continuously straddles.

https://github.com/rohanpsingh/LearningHumanoidWalking/assets/83504717/c5da3161-54fc-45b9-852d-6f8d90476a1f

  1. On a bipedal robot with five joints per leg, the policy network still tries to straddle and fails to walk properly.

https://github.com/rohanpsingh/LearningHumanoidWalking/assets/83504717/0c6feeb8-252a-4a94-b870-775f13fcb341

I'm wondering if these issues are related to how I'm adjusting the parameters. Could there be specific parameter settings or modifications needed for different robot structures? Any guidance or suggestions on how to optimize the algorithm for various joint configurations would be greatly appreciated. Thank you for your time and assistance.

Sujgaik2003 commented 4 months ago

How do you apply to other robot plz guide me

TRYzero commented 4 months ago

How do you apply to other robot plz guide me

I've made three main adjustments:

  1. Switched to my own MJCF model.
  2. Tuned the PD parameters.
  3. Modified the mirror loss function.

If all these aspects are fine, the program should now be usable with your own robot model.

Sujgaik2003 commented 4 months ago

Thanks for reply actually I want to apply it on nao robot so plz can u help me out . By adjusting the parameters for nao robot.

Sujgaik2003 commented 4 months ago

@TRYzero can u provide me the above project link where can I see the code it will be great help 🙂.

TRYzero commented 4 months ago

@TRYzero can u provide me the above project link where can I see the code it will be great help 🙂.

Well, I'm not entirely sure which aspect you're confused about. Could you please describe your question in more detail? Are you unclear about the entire process?

  1. If your question concerns how to convert URDF files to XML files, you might want to search for MuJoCo-related tutorials.
  2. Once you have the XML file for the NAO robot, you can adjust your model using envs/jvrc/gen_xml.py. This script is designed to transform a complete robot model into one that is more suitable for training.
  3. Next, you might need to refer to envs/jvrc/jvrc_walk.py to write your own nao_walk.py. In this file, you may need to adjust the PD gains and the mirror symmetry settings. Of course, you will need to replace the imported XML path with your own.
  4. Another file you might need to adjust is envs/jvrc/robot.py, because the half_sitting_pose used for the JVRC may not be suitable for your robot.
Sujgaik2003 commented 4 months ago

Hey I am done with step one by converting urdf to XML file not going ahead with 2,3,4 step as you mentioned can u guide me regarding the 4 step as u mentioned it could be a great help

TRYzero commented 4 months ago

Hey I am done with step one by converting urdf to XML file not going ahead with 2,3,4 step as you mentioned can u guide me regarding the 4 step as u mentioned it could be a great help

In the fourth step, I mentioned the "half_sitting_pose" as shown in the screenshot. image Well, this will not be the key factor.

Sujgaik2003 commented 4 months ago

Okhy So there is no need to change in robot.py ? It can also use with nao robot

TRYzero commented 4 months ago

Okhy So there is no need to change in robot.py ? It can also use with nao robot

yep

Sujgaik2003 commented 4 months ago

IMG-20240418-WA0001

(https://github.com/rohanpsingh/LearningHumanoidWalking/assets/118328948/d7f08070-c17e-453d-9000-8e4f272f722d) WA0001.jpg…]()

Encounter with the error

Try to solve by below 👇🏼 links but not worked https://github.com/openai/mujoco-py/issues/475

https://medium.com/@sayanmndl21/install-openai-gym-with-box2d-and-mujoco-in-windows-10-e25ee9b5c1d5

formoree commented 1 month ago

IMG-20240418-WA0001

(https://github.com/rohanpsingh/LearningHumanoidWalking/assets/118328948/d7f08070-c17e-453d-9000-8e4f272f722d)( https://github.com/rohanpsingh/LearningHumanoidWalking/assets/118328948/d7f08070-c17e-453d-9000-8e4f272f722d) WA0001.jpg…]() WA0001.jpg...]()

Encounter with the error遇到错误

Try to solve by below 👇🏼 links but not worked尝试通过以下👇🏼链接解决,但没有奏效 https://github.com/openai/mujoco-py/issues/475

https://medium.com/@sayanmndl21/install-openai-gym-with-box2d-and-mujoco-in-windows-10-e25ee9b5c1d5

Did you finally work it out?

Sujgaik2003 commented 1 month ago

Still not yet !

formoree commented 1 month ago

Hello, I've been encountering some challenges while attempting to apply your algorithm to different bipedal robots. Specifically, I tested the algorithm on two robots with distinct configurations.

  1. On a bipedal robot with six joints per leg, the robot can walk, but it continuously straddles.

    1.30.2.mp4

  2. On a bipedal robot with five joints per leg, the policy network still tries to straddle and fails to walk properly.

    1.30.1.mp4 I'm wondering if these issues are related to how I'm adjusting the parameters. Could there be specific parameter settings or modifications needed for different robot structures? Any guidance or suggestions on how to optimize the algorithm for various joint configurations would be greatly appreciated. Thank you for your time and assistance.

Have you ever solve this problem? I think the key factors may be the setting of pdgains, the transformation of the .xml file and reward setting. I have change the robot to OP3, and it is still hard for it to walk steadily.

formoree commented 1 month ago

Still not yet !

I have read through your bugs, i think the problem is the mujoco library. Maybe you don't download the python packsites of mujoco. To be clear that the problem has nothing to do with your code.

TRYzero commented 1 month ago

Have you ever solve this problem? I think the key factors may be the setting of pdgains, the transformation of the .xml file and reward setting. I have change the robot to OP3, and it is still hard for it to walk steadily.

I solved this problem by introducing reference motions. Well, there shouldn't be any need for this. Did this issue also appear on your robot?

formoree commented 1 month ago

Have you ever solve this problem? I think the key factors may be the setting of pdgains, the transformation of the .xml file and reward setting. I have change the robot to OP3, and it is still hard for it to walk steadily.

I solved this problem by introducing reference motions. Well, there shouldn't be any need for this. Did this issue also appear on your robot?

https://github.com/user-attachments/assets/c4aa1788-7ac0-475f-9480-1aeae7bf1160

I don't know why my robot keeps trembling and can't walk normally like humans, I don't know if it's because that i add a collision geom in .xml file.

Sujgaik2003 commented 1 month ago

Still not yet !

I have read through your bugs, i think the problem is the mujoco library. Maybe you don't download the python packsites of mujoco. To be clear that the problem has nothing to do with your code.

Still not yet !

I have read through your bugs, i think the problem is the mujoco library. Maybe you don't download the python packsites of mujoco. To be clear that the problem has nothing to do with your code.

Hey I think that would be the issue can u plz provide any reference doc to which by referring I can download the python pack sites of mujoco

formoree commented 1 month ago

Still not yet !

I have read through your bugs, i think the problem is the mujoco library. Maybe you don't download the python packsites of mujoco. To be clear that the problem has nothing to do with your code.

Still not yet !

I have read through your bugs, i think the problem is the mujoco library. Maybe you don't download the python packsites of mujoco. To be clear that the problem has nothing to do with your code.

Hey I think that would be the issue can u plz provide any reference doc to which by referring I can download the python pack sites of mujoco

I have not met this problem. I just use "pip install" comand to install the target version mujoco

Sujgaik2003 commented 1 month ago

Still not yet !

I have read through your bugs, i think the problem is the mujoco library. Maybe you don't download the python packsites of mujoco. To be clear that the problem has nothing to do with your code.

Still not yet !

I have read through your bugs, i think the problem is the mujoco library. Maybe you don't download the python packsites of mujoco. To be clear that the problem has nothing to do with your code.

Hey I think that would be the issue can u plz provide any reference doc to which by referring I can download the python pack sites of mujoco

I have not met this problem. I just use "pip install" comand to install the target version mujoco

Yeah I have tried the same put still not available to resolve the error it still saying add mujoco path to environment i have tried all way but not able to solve the error

formoree commented 1 month ago

Still not yet !

I have read through your bugs, i think the problem is the mujoco library. Maybe you don't download the python packsites of mujoco. To be clear that the problem has nothing to do with your code.

Still not yet !

I have read through your bugs, i think the problem is the mujoco library. Maybe you don't download the python packsites of mujoco. To be clear that the problem has nothing to do with your code.

Hey I think that would be the issue can u plz provide any reference doc to which by referring I can download the python pack sites of mujoco

I have not met this problem. I just use "pip install" comand to install the target version mujoco

Yeah I have tried the same put still not available to resolve the error it still saying add mujoco path to environment i have tried all way but not able to solve the error

I have asked Claude the problem,it gives the following answer: It seems like you are encountering an issue with the MuJoCo library not being properly set up in your system's PATH environment variable. This is a common problem when working with MuJoCo, which is a proprietary physics simulation engine used in robotics and machine learning.

To resolve this issue, you need to add the MuJoCo library directory to your system's PATH environment variable. The specific steps may vary depending on your operating system, but here's a general guide:

  1. Locate the MuJoCo installation directory. It's typically in your user's home directory, such as C:\Users\YourUsername\.mujoco\mujoco210 on Windows or ~/.mujoco/mujoco210 on macOS/Linux.

  2. Open the appropriate system environment variable editor:

    • On Windows: Open the Start menu, search for "Environment Variables", and select "Edit the system environment variables".
    • On macOS/Linux: Open a terminal and run the command nano ~/.bashrc (or the appropriate editor for your shell).
  3. In the environment variable editor, find the "Path" or "PATH" variable and add the MuJoCo library directory to it. For example, on Windows, the entry might look like this:

    C:\Users\YourUsername\.mujoco\mujoco210\bin;%PATH%

    On macOS/Linux, it might look like this:

    ~/.mujoco/mujoco210/bin:$PATH
  4. Save the changes and close the environment variable editor.

  5. Restart your system or terminal session to ensure the new PATH is applied.

After completing these steps, the MuJoCo library should be available in your system's PATH, and you should be able to run your code without the "Please add mujoco library to your PATH" exception.

If you are still experiencing issues, make sure that you have properly installed the MuJoCo license and that the library files are present in the correct directory. You may also need to check your Python environment and ensure that the MuJoCo Python bindings are correctly installed and accessible.

TRYzero commented 1 month ago

Have you ever solve this problem? I think the key factors may be the setting of pdgains, the transformation of the .xml file and reward setting. I have change the robot to OP3, and it is still hard for it to walk steadily.

I solved this problem by introducing reference motions. Well, there shouldn't be any need for this. Did this issue also appear on your robot?

20240717_114941.mp4 I don't know why my robot keeps trembling and can't walk normally like humans, I don't know if it's because that i add a collision geom in .xml file.

Perhaps you can introduce foot trajectory reward terms to solve the problem. For example, have your foot's height track a curve that you design.