x75 / smp_sphero

Sensorimotor learning experiments with the Sphero robot (smp_sphero)
MIT License
1 stars 1 forks source link

Missing modules #1

Open x75 opened 5 years ago

x75 commented 5 years ago

When I try to run your text files(sphero_raw.py or shpero_res_learner_1d.py, e.t.c...) I get the error message: No module named reservoirs

x75 commented 5 years ago

first one is smp_msgs.msg.reservoir

quick fix is to git clone smp_msgs repository into your ros-workspace/src and run catkin

cd ws-kinetic-py3/src
git clone git@github.com:x75/smp_msgs.git
cd ..
catkin_make_isolated install

better but more effort is to replace the reservoir message with just FloatArray from std_msgs, didn't know back then.

x75 commented 5 years ago

second one is you'll need Reservoir class from reservoirs.py, which has moved to smp_base and become smp_base.models_reservoirs. smp_base is available as well but you'd need to edit the imports.

x75 commented 5 years ago

queued and WIP, will be back with fixes but may take a bit

NevilleKitala commented 5 years ago

Thank you for your reply. I will work on this right now

NevilleKitala commented 5 years ago

I have updated the import statements. But a new error comes up:

ImportError for rlspy ("Couldn't import init_jpype from measures_infth, make sure jpype is installed", ImportError('No module named config',)) Traceback (most recent call last): File "src/smp_sphero/sphero_res_learner_1D.py", line 21, in from smp_base.models_learners import learnerEH File "/home/neville/Ros_Workspace/src/smp_base/smp_base/models_learners.py", line 702, in class learnerReward(object): File "/home/neville/Ros_Workspace/src/smp_base/smp_base/models_learners.py", line 794, in learnerReward @dec_compute_infth_soft() NameError: name 'dec_compute_infth_soft' is not defined.

I assumed perhaps that I didn't have the jpype installed but I ran :

sudo apt-get install python-jpype but the error persists. Any advice on this issue?

x75 commented 5 years ago

sorry for the mess and thx for patience, let me try and fix the packages deps today, be back when done sometime tonight.

NevilleKitala commented 5 years ago

Appreciate the speedy reply. Many Thanks.

x75 commented 5 years ago

are you on py2 or 3?

NevilleKitala commented 5 years ago

I'm using py2

x75 commented 5 years ago

replaced offending imports, if you have smp_base in your PATH it might just work. lmk.

NevilleKitala commented 5 years ago

I'm going to try it now. Thank you

NevilleKitala commented 5 years ago

I would like to report that this error persists. I had updated the local repository I had originally pulled. The issue is in model_learners:

line 794, in learnerReward @dec_compute_infth_soft() NameError: name 'dec_compute_infth_soft' is not defined.

The system recommendations were to install jpype but I already have that installed.

NevilleKitala commented 5 years ago

Please explain what the @dec_compute_infth_soft() function does.

x75 commented 5 years ago

ah seems i forgot about the second issue. you'll need jpype, infodynamics.jar from JIDT, and then create a config.py in from config.py.dist in smp_base/smp_base. the config has the path to the jar file.

x75 commented 5 years ago

i'll fix along and push

x75 commented 5 years ago

the smp_base/README should have some install info. if not, it needs to be fixed as well :)

NevilleKitala commented 5 years ago

OK. Please let me know!

x75 commented 5 years ago

it's actually a different issue, so i split that to #2

git pull in smp_base and see the README, it was missing a section for installing rlspy, jpype and jidt.

it's a hassle but is necessary to have installed for utilizing actual smp_sphero model code.