SofaDefrost / SofaGym

Machine Learning framework for Sofa
72 stars 10 forks source link

[ERROR] Connection Refused #20

Closed MingshanHe closed 1 year ago

MingshanHe commented 1 year ago

I am running a simple code like import gym import sofagym.envs env = gym.make('trunk-v0') env.reset() The I get the Error like: [ERROR] [SofaRuntime] ConnectionRefusedError: [Errno 111] Connection refused

How can I fix it? Thanks.

EtienneMenager commented 1 year ago

Hello, do you have a more detailed error? Did you try to runSofa trunkScene.py to check if it was working?

Cheers,

Etienne

MingshanHe commented 1 year ago

Yeah, I try to run runSofa gripperscene.py to check.

But I don't know the exact reason for using my code like below.

Actually, I think the newest three issues are the same.

Best, Mingshan

MingshanHe commented 1 year ago

Yeah, I try to run runSofa gripperscene.py to check.

But I don't know the exact reason for using my code like below.

Actually, I think the newest three issues are the same.

Best, Mingshan

Oh, The previous description may be somewhat misleading. I mean I check the gripper scene and run the model named 'gripper-v0'.

EtienneMenager commented 1 year ago

In fact is related to the issue #17. It doesn't stop the simulation but since you are not doing anything after env.reset() your code just ends.

You can use the env to do some stuff, but we have a problem with the rendering now. We are working on that !

Cheers

MingshanHe commented 1 year ago

Yeah, Thanks for your reply. Actually, I add the code like ` import gym import sofagym.envs env = gym.make('trunk-v0') observation = env.reset()

done = False while not done: action = env.action_space.sample() # this is where you would insert your policy observation, reward, done, info = env.step(action) env.render()

env.close() ` But then, I get the other error from the terminal like the captured figure. image

EtienneMenager commented 1 year ago

Hi,

It seems to be a problem with the visualization. We made some changes in the last RP last night. Can you update and test to see if the problem still exists?

Cheers,

Etienne

MingshanHe commented 1 year ago

Thanks for your excellent work!!

The problem has been fixed in this PR.

Best, Mingshan