jsk-ros-pkg / jsk_robot

jsk-ros-pkg/jsk_robot
https://github.com/jsk-ros-pkg/jsk_robot
73 stars 97 forks source link

jsk_pepper_robot/jsk_pepper_startup/sample/sample.lをペッパーで試す #167

Closed kochigami closed 9 years ago

kochigami commented 9 years ago

ペッパーくんのサンプルコードを動かしてみたのですが、ナオで試した時と違い、音声認識をやらずにプログラムが止まってしまいました。(10回以上試して、全てこの結果になりました。)

顔認識をしてペッパーが話している間に音声認識が走り、一瞬で終わってしまっているようです。

/stop_recognitionのサービスを呼ぶところでエラーが起きているようで、 2〜3回ほど jsk_pepper_startup.launchを上げている端末で

[WARN] [WallTime: 1416920570.727185] Speech recognition already started. Restarting.

というのがまず出て、

[ERROR] [WallTime: 1416908039.407949] Error processing request: close
['Traceback (most recent call last):\n', ' File "/opt/ros/hydro/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 623, in handle_request\n response = convert_return_to_response(self.handler(request), self.response_class)\n', ' File "/home/nao/catkin_ws/src/nao_robot/nao_apps/nodes/nao_speech.py", line 363, in start\n self.srw.close()\n', ' File "/home/nao/pynaoqi/inaoqi.py", line 219, in \n __getattr_ = lambda self, name: _swig_getattr(self, module, name)\n', ' File "/home/nao/pynaoqi/inaoqi.py", line 55, in _swig_getattr\n raise AttributeError(name)\n', 'AttributeError: close\n']

というエラーが出ました。

rostopic echo /nao_speech/parameter_updates

をすると、

strs: 
  - 
    name: language
    value: Japanese
  - 
    name: vocabulary
    value: こんにちは / さようなら / Pepper / あれ / ぼく / げんき / ろぼっと / しんぼう
  - 
    name: voice
    value: maki_n16

となっているので、言葉の登録はできています。

実行時の画面についても書きます。

1.irteusgl$ demo1
[ INFO] [1416902364.072500476]: wait for face_detection/enable
[ERROR] [1416902364.268371194]: Service call failed: service [/nao_vision/face_detecti\
on/enable] responded with an error: service cannot process request: service handler re\
turned None
[ERROR] [1416902364.268498025]: attempted to call service /nao_vision/face_detection/\
enable, but failed
[ INFO] [1416902364.279458148]: Detecting.... nil
[ INFO] [1416902364.777320551]: imu #f(0.022211 -0.026847 0.999393) 0.999393
[ INFO] [1416902364.777727586]: Detecting.... nil
[ INFO] [1416902365.277518306]: imu #f(0.02156 -0.027763 0.999382) 0.999382
[ INFO] [1416902365.277957957]: Detecting.... nil
[ INFO] [1416902365.779276526]: imu #f(0.022039 -0.026637 0.999402) 0.999402
[ INFO] [1416902365.785049816]: Detecting.... nil
(省略)
[ INFO] [1416902387.282910962]: imu #f(0.013057 -0.026445 0.999565) 0.999565
[ INFO] [1416902387.283442035]: Detecting.... nil
[ INFO] [1416902387.782963937]: imu #f(0.012097 -0.026554 0.999574) 0.999574
[ INFO] [1416902387.785415366]: Detected 4 (0.757)
[ INFO] [1416902387.785533398]: Detecting.... nil
[ INFO] [1416902388.286589572]: wait for face_detection/disable
[ERROR] [1416902388.320630074]: Service call failed: service [/nao_vision/face_detection/disable] responded with an error: service cannot process request: service handler returned None
[ERROR] [1416902388.320866976]: attempted to call service /nao_vision/face_detection/disable, but failed
[ INFO] [1416902388.321373465]: speech ???????????????
[ INFO] [1416902388.326761371]: wait for nao_speech/set_parameters
[ INFO] [1416902390.570041819]: wait for start_recognition
[ERROR] [1416902390.583148234]: Service call failed: service [/start_recognition] responded with an error: error processing request: close
[ERROR] [1416902390.583258304]: attempted to call service /start_recognition, but failed
[ INFO] [1416902390.592130382]: imu #f(0.013686 -0.026095 0.999566) 0.999566
[ INFO] [1416902390.595224909]: Recognizing.... ??????????????? / ??????????????? / Pepper / ?????? / ?????? / ????????? / ???????????? / ????????????
[ INFO] [1416902391.092385896]: imu #f(0.011167 -0.026651 0.999582) 0.999582
[ INFO] [1416902391.092905585]: Recognizing.... ??????????????? / ??????????????? / Pepper / ?????? / ?????? / ????????? / ???????????? / ????????????
[ INFO] [1416902391.593309931]: imu #f(0.0127 -0.026585 0.999566) 0.999566
[ INFO] [1416902391.593911265]: Recognizing.... ??????????????? / ??????????????? / Pepper / ?????? / ?????? / ????????? / ???????????? / ????????????
[ INFO] [1416902392.093267084]: imu #f(0.01258 -0.025617 0.999593) 0.999593
[ INFO] [1416902392.094125852]: Recognized (??????) (#f(0.3018))
[ INFO] [1416902392.094740455]: Recognizing.... ??????????????? / ??????????????? / Pepper / ?????? / ?????? / ????????? / ???????????? / ????????????
[ INFO] [1416902392.595660859]: wait for stop_recognition
[ INFO] [1416902392.599730720]: waitForService: Service [/stop_recognition] has not been advertised, waiting...

ここでずっと止まります。

garaemon commented 9 years ago

コードを貼り付けるときは```を使いましょう

https://guides.github.com/features/mastering-markdown/

garaemon commented 9 years ago

で、/stop_recognitionというサービスがないらしいので、grep -iIrn stop_recognition *とかやってみるとなにかわかるのではないでしょうか

kochigami commented 9 years ago

ご教示ありがとうございます。申し訳ございません。 jsk_pepper_startup.launchの中身を見ると、nao_speech.pyを参照しているのは、

 <node pkg="nao_apps" type="nao_speech.py" name="nao_speech" args="--pip=$(arg nao_ip) --pport=$(arg nao_port)" 

だったのですが、

nao@pepper:~$ grep -iIrn stop_recognition *

の結果。そのパッケージに/stop_recognitionは見つかりませんでした。 中身を見てみたらsotp_recognitionになっていたため、修正して rosrun roseus generate-all-msg-srv.sh nao_msgs をして動くようになりました。 ありがとうございました。