h2r / rosTalker

code to send amazon echo speech to text information to a ros topic
11 stars 9 forks source link

roslib module is missing. #1

Open sradmard opened 7 years ago

sradmard commented 7 years ago

Hi,

I am trying to use your package to communicate with ROS, however I am getting the following error when I run the test on the AWS Lambda function on my Amazon account: "errorMessage": "Cannot find module 'roslib'"

I run my AWS Lambda test on the Amazon online platform after launching "roslaunch rosbridge_server rosbridge_websocket.launch", on my ROS platform, but it looks like it does not recognise the ROS communication. I wonder whether I had to include the roslib in the zip file when I was uploading it to the Lambda function, or am I providing the wrong url in the function.

I would really appreciate your help.

ericsantii commented 7 years ago

Hi, I am having the same problem. @sradmard Any luck on including the roslib file in the zip?

sradmard commented 7 years ago

Hi, When installing the roslibjs library with npm, make sure that you are doing it locally, in the src folder of rosTalker package. The local installation will create a "node_modules" folder in the src, that will contain all of the required libraries. $npm install roslib.

Then you need to create a zip file that contains, index.js, AlexaSkill.js, and node_modules folder. You need to upload this zip file into an AWS lambda function that you will set up under Amazon AWS. Good luck.

ericsantii commented 7 years ago

Thanks for your help! I noticed you had the following problem which is the one I am facing now: "I run my AWS Lambda test on the Amazon online platform after launching "roslaunch rosbridge_server rosbridge_websocket.launch", on my ROS platform, but it looks like it does not recognise the ROS communication."--Did you manage to solve this?

sradmard commented 7 years ago

Here is some further clarification on the documentation of this package:

You need to have a static ip address that is uniquely assigned either to your computer or your router. If you are using a router, in this case with ip address of 111.111.111.111, you need to set up port forwarding. To set up port forwarding, you need to access your router, then reserve the ip address that is assigned to your local computer, and then open up both TCP and UDP protocols of a port (the port that is also used by rosbridge_websocket server, in this case, 3000) without any filter.

saimouli commented 7 years ago

@sradmard were you able to connect to AVS using WebSocket recently? I am able to connect with node.js, but getting error connecting web socket when trying with AWS lambda

sradmard commented 7 years ago

Yes. You may need to re-upload your zip file to AWS online platform multiple times to get it to connect to your local server through rosbridge_websocket.

dottantgal commented 6 years ago

Hi @sradmard , i have an important question: I've uploaded my lambda function to the AWS, configured my skill and installed the sampleapp to make my Ubuntu UpBoard an amazon alexa device. Now, i want to start the rosbridge_websocket to have the chance to get the ros messages coming from my uploaded lambda function as results of my custom skill. I set a static ip for my upboard connected to the router, but i miss a step : how can i tell to the lambda function where is my custom alexa device? I mean, with the sampleapp installed on my upboard i can use my custom skill, but i cant get the ros message which the lambda function should return me, the avs understand what i say, but i dont have the resulting ros message coming from the voice recognition (it should return me string messages). thank you so much

sradmard commented 6 years ago

Hi @dottantgal, you need to have a static ip that is accessible to the outside world. You can check for your ip through : [(https://whatismyipaddress.com/)] Here are three potential scenarios based on your internet ip to the outside world, not the ip that you assign on your router: 1- If your internet provider has provided you with a static ip, then you are good, and you can connect your ros server machine directly to the internet port. 2- If your ros server machine is wirelessly connected to a router, but your router is still receiving the unique static ip, then you need to set up port forwarding on your router to your ros server machine (further instruction provided in previous comment). 3- If you have a dynamic ip, then I'm not sure. You may be able to connect but you need to change your ip address in the lambda function every time your ip changes.

Anyways, you need to provide the lambda function with the ip that you get from the aforementioned website. This ip will be used in the lambda function to communicate to your ros node on your local machine where the rosbridge_websocket server is running. This ip needs to be provided in the "src/index.js" file, as the url. Check the previous comments for further instruction.

dottantgal commented 6 years ago

Hi @sradmard I am in the case where the ros machine is connected to a router, so I have to set the port forwarding. Now, on the ros machine I've checked the ip though [(https://whatismyipaddress.com/)] and let say that it is 154.154.154.154 (it's an example). Later i run "ifconfig" on the ros machine to know the ip given by the router to the ros machine and it is, for ex., 100.100.100.100. At this point, what i have to set within the index.js?? About the port forwarding, I set it in the router for the address 100.100.100.100 opening the port 3000-3000 for both UDP/TCP enabling the mapping. Thank you, looking forward for an answer.

cesarenicholas commented 5 years ago

Hi @sradmard I'm trying to use rosTalker but when I run the Alexa test Simulator it says me: "There was a problem with the requested skill's response". I followed your tutorial and all the steps of the previous comments about Skill ID and IP. When I start the test I obtain the following JSON input:

{ "version": "1.0", "session": { "new": false, "sessionId": "amzn1.echo-api.session.[session ID]", "application": { "applicationId": "amzn1.ask.skill.[application ID]" }, "user": { "userId": "amzn1.ask.account.[user ID]" } }, "context": { "System": { "application": { "applicationId": "amzn1.ask.skill.[application ID]" }, "user": { "userId": "amzn1.ask.account.[user ID]" }, "device": { "deviceId": "amzn1.ask.device.[device ID]", "supportedInterfaces": {} }, "apiEndpoint": "https://api.amazonalexa.com", "apiAccessToken": "[apiAcessToken]" }, "Viewport": { "experiences": [ { "arcMinuteWidth": 246, "arcMinuteHeight": 144, "canRotate": false, "canResize": false } ], "shape": "RECTANGLE", "pixelWidth": 1024, "pixelHeight": 600, "dpi": 160, "currentPixelWidth": 1024, "currentPixelHeight": 600, "touch": [ "SINGLE" ] } }, "request": { "type": "SessionEndedRequest", "requestId": "amzn1.echo-api.request.[request ID]", "timestamp": "2019-02-13T13:20:36Z", "locale": "en-US", "reason": "ERROR", "error": { "type": "INVALID_RESPONSE", "message": "SpeechletResponse was null" } } }

The JSON output is 'null'.

Can you help me with this INVALID_RESPONSE error? Sorry for my english, Looking forward an answer, thank you for your time.

yjrab commented 5 years ago

Hi @cesarenicholas I hope you are doing well I am having the same problem as yours Did you solve this problem?

thank you.

sradmard commented 5 years ago

Hi everyone, You may want to check this project on, as we have explained in more details how you can connect your Alexa to ROS. https://github.com/LucasPorto/flask_ask_ros