poppy-project / poppy-torso

Poppy Torso is an open-source and 3D printed torso robot. Optimized for research and education purposes, its modularity allows for a wide range of applications and experimentations.
36 stars 26 forks source link

Prevent the monitor temperature primitive to be used in v-rep #12

Closed pierre-rouanet closed 8 years ago

pierre-rouanet commented 8 years ago

Using the Torso in v-rep may raised an error as the temperature monitoring primitive may now raise an alert (see https://github.com/poppy-project/pypot/commit/f4f727815336b6a58a79583080578c5166f031c0). Yet, the "safety sound" is not packaged with the torso softwares.

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/Users/pierrerouanet/.pyenv/versions/anaconda-2.4.0/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/Users/pierrerouanet/.pyenv/versions/anaconda-2.4.0/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Users/pierrerouanet/dev/pypot/pypot/utils/stoppablethread.py", line 119, in _wrapped_target
    self._target()
  File "/Users/pierrerouanet/dev/pypot/pypot/primitive/primitive.py", line 79, in _prim_run
    self.run()
  File "/Users/pierrerouanet/dev/pypot/pypot/primitive/primitive.py", line 167, in run
    make_update_loop(self, self._wrapped_update)
  File "/Users/pierrerouanet/dev/pypot/pypot/utils/stoppablethread.py", line 152, in make_update_loop
    update_func()
  File "/Users/pierrerouanet/dev/pypot/pypot/primitive/primitive.py", line 172, in _wrapped_update
    self.update()
  File "/Users/pierrerouanet/dev/poppy-torso/software/poppy_torso/primitives/safe.py", line 96, in update
    self.check_temperature()
  File "/Users/pierrerouanet/dev/poppy-torso/software/poppy_torso/primitives/safe.py", line 109, in check_temperature
    self.raise_problem(motor_list)
  File "/Users/pierrerouanet/dev/poppy-torso/software/poppy_torso/primitives/safe.py", line 112, in raise_problem
    subprocess.call([self.player, self.sound])
  File "/Users/pierrerouanet/.pyenv/versions/anaconda-2.4.0/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/Users/pierrerouanet/.pyenv/versions/anaconda-2.4.0/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/Users/pierrerouanet/.pyenv/versions/anaconda-2.4.0/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

I would guess the better solution is to either disable the monitor primitive in v-rep or to simply log when there is a virtual motor "burning" instead of trying to play the sound.

show0k commented 8 years ago

I disabled the primitive for V-REP in 7ab0fc97ecf287be6e83a0a99353b01ddac565af.

We have to move this primitive directly in pypot and package this sound file in pypot (or poppy-creature ?). Opinions on that @pierre-rouanet ?

pierre-rouanet commented 8 years ago

I don't think it should go to pypot. The temperature monitoring should be creature based. For instance, we know the torso weakness point is the abs, etc.

For the sound, I think the good strategies is not to rely on sound exclusively. For the moment, on the Ergo we do not have an official way to play sound. So we should at least have another approach. Furthermore, I must say I don't like libraries that print stuff without asking, so playing sound when you just suppose to make motor turn doesn't seem to me like a good idea.