LoyVanBeek / wit_ros

Wrapper for the wit.ai natural language API
MIT License
10 stars 4 forks source link

Error while launch start.launch #4

Closed pabiq closed 6 years ago

pabiq commented 7 years ago

@LoyVanBeek Thank you for wit_ros package

I got some error while launching start.launch it got something like this.

 File "/home/tarin/tubby_ws/src/wit_ros/src/wit_ros/wit_node.py", line 70, in <module>
    wit.init()
AttributeError: 'module' object has no attribute 'init'
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/core.py", line 401, in signal_shutdown
    h()
  File "/home/tarin/tubby_ws/src/wit_ros/src/wit_ros/wit_node.py", line 63, in shutdown
    wit.close()
AttributeError: 'module' object has no attribute 'close'
REQUIRED process [wit_node-2] has died!
process has died [pid 19489, exit code 1, cmd /home/tarin/tubby_ws/src/wit_ros/src/wit_ros/wit_node.py __name:=wit_node __log:=/home/tarin/.ros/log/76e2c5ca-04ba-11e7-8621-74e543a019e5/wit_node-2.log].
log file: /home/tarin/.ros/log/76e2c5ca-04ba-11e7-8621-74e543a019e5/wit_node-2*.log
Initiating shutdown!

any advice to solve this problem will be very appreciated

Thank you.

LoyVanBeek commented 7 years ago

Hi @pabiq, I haven't touched this code in quite some time. It might very well be that the wit-module by now has a newer version that does not have an init and close function anymore.

In that case, there are 2 options:

A pull request is welcome in either case.

JonarJr commented 7 years ago

Hi, I was wondering if @pabiq has found a solution to this issue? I'm currently trying to run it now and it's giving me the same error.

Thanks!

LoyVanBeek commented 7 years ago

Oh boy, the Wit.ai API completely changed since I originally wrote this.

According to the current docs, There is no more init-call, you just pass the API key to the Wit-class. There is no shutdown/close needed.

The text_query is replaced by message AFAICT, making for this essential diff:

-    response = json.loads(wit.text_query(sentence, APIKEY))
+    response = json.loads(wit.message(sentence))

I don't have ROS at work right now, maybe this helps to fix the basics.

LoyVanBeek commented 7 years ago

@JonarJr @pabiq A fix is on branch fix/4 so please give that a try.