alantes / RL-for-MSRs

An implementation of using rl to control magnetic soft robots.
https://onlinelibrary.wiley.com/doi/full/10.1002/aisy.202200339
MIT License
8 stars 1 forks source link

how to run the code? #1

Closed SHITIANYU-hue closed 11 months ago

SHITIANYU-hue commented 12 months ago

i run python main.py (in before_finetuned/magnetization1_4mT) , but i got this error:

Total steps 200000 Total learning steps per simulation 2000 Traceback (most recent call last): File "/home/tianyu/code/msr/RL-for-MSRs/Code and Models/before_finetuned/magnetization1_4mT/main.py", line 47, in observation = env.reset() File "/home/tianyu/code/msr/RL-for-MSRs/Code and Models/before_finetuned/magnetization1_4mT/set_environment.py", line 132, in reset self.shearable_rod = CosseratRod.straight_rod( File "/home/tianyu/anaconda3/envs/msr/lib/python3.9/site-packages/elastica/rod/cosserat_rod.py", line 297, in straight_rod raise ValueError( ValueError: The option to set damping coefficient (nu) for the rod during rod initialisation is now deprecated. Instead, for adding damping to rods, please derive your simulation class from the add-on Damping mixin class. For reference see the class elastica.dissipation.AnalyticalLinearDamper(), and for usage check examples/axial_stretching.py

SHITIANYU-hue commented 12 months ago

But i can run axial_strectching.py successfully:

image
alantes commented 11 months ago

Hi SHITIANYU-hue, thank you for your question. It seems that you have installed a newer version of PyElastica, which may not be compatible with the initialization of straight_rod in my code. Sorry for the trouble but maybe you should try older version of PyElastica. If I remember it correctly, you may need to install v0.1.0.post2 release.

SHITIANYU-hue commented 11 months ago

Hello, Thanks for your help, yes, it works now, by the way, it has another issue with the device, it should have a device here:

image

alantes commented 11 months ago

Hello, Thanks for your help, yes, it works now, by the way, it has another issue with the device, it should have a device here:

image

Thanks. I will get it fixed soon.