[Fiware-robotics] CB-Proxy

Colombatto Davide davide.colombatto at telecomitalia.it
Mon Apr 27 16:49:53 CEST 2015


Hi Inigo,

the new JavaScript seems to work correctly now; I 've done some tests and I don't see the delay of the first demo starting FIROS on my PC, so I think it is resolved.
Did you have seen the modification in the document https://docs.google.com/document/d/1eWO5MYYkjJEo1xLLm2YsX_bhCnET5eX4dm4_cL9MFg0/edit ? In particular what concern the example json that you send us some months ago.

Thank you,
Davide


________________________________
Da: Iñigo Gonzalez [igonzalez at ikergune.com]
Inviato: lunedì 27 aprile 2015 10.05
A: Colombatto Davide
Cc: fiware-robotics at lists.fi-ware.org
Oggetto: Re: CB-Proxy
I send you the file compressed to avoid your mail server reject the file.

The password is: etxetar

Regards,
Iñigo

On 27/04/15 10:01, Iñigo Gonzalez wrote:
Hi Davide,

here you have a new etxetar.js file. I have done several trials and I hope this one works for you.

Regards,
Iñigo


On 22/04/15 14:41, Colombatto Davide wrote:
Hi Inigo,

I have some troubles with the web-app code you sent me (that with the ip address of the CB and not of the old CB-Proxy).
Below there are the steps I did:

1) Start chrome with the security flag disabled; the CB response is:
<orionError>
  <code>415</code>
  <reasonPhrase>Unsupported Media Type</reasonPhrase>
  <details>not supported content type: application/x-www-form-urlencoded</details>
</orionError>

2) In the etxetar.js - Add to the ajax request contentType:"application/json; charset=utf-8"; the response from CB is:
<orionError>
  <code>406</code>
  <reasonPhrase>Not Acceptable</reasonPhrase>
  <details>acceptable MIME types: 'application/xml, application/json'. Accept header in request: 'undefined'</details>
</orionError>

3) In the etxetar.js - Remove accepts:"application/json; charset=utf-8" (or changing it to accepts: {text: "application/json; charset=utf-8"}); the response of CB is:
<updateContextResponse>
  <errorCode>
    <code>400</code>
    <reasonPhrase>Bad Request</reasonPhrase>
    <details>JSON Parse Error: <unspecified file>(1): expected object</details>
  </errorCode>
</updateContextResponse>

It seems it is related to encoding (charset). The Request sent by ajax is serialized as:
1.        contextElements%5B0%5D%5Bid%5D=turtle1&contextElements%5B0%5D%5Btype%5D=ROBOT&contextElements%5B0%5D%5BisPattern%5D=false&contextElements%5B0%5D%5Battributes%5D%5B0%5D%5Bname%5D=COMMAND&contextElements%5B0%5D%5Battributes%5D%5B0%5D%5Btype%5D=COMMAND&contextElements%5B0%5D%5Battributes%5D%5B0%5D%5Bvalue%5D%5B%5D=cmd_vel&contextElements%5B0%5D%5Battributes%5D%5B1%5D%5Bname%5D=cmd_vel&contextElements%5B0%5D%5Battributes%5D%5B1%5D%5Btype%5D=NotYet&contextElements%5B0%5D%5Battributes%5D%5B1%5D%5Bvalue%5D=%7B'linear'%3A%7B'x'%3A0.5%2C'y'%3A0%2C'z'%3A0%7D%2C'angular'%3A%7B'x'%3A0%2C'y'%3A0%2C'z'%3A0%7D%2C'firosstamp'%3A1429705669659%7D&updateAction=APPEND

Do you know how to resolve this problem in order to use that web-app (avoiding to implement the other two solutions you proposed) to do my test?
Maybe the CB-Proxy you used in the past modify the requests before sending it to the CB..


I remember you that we (Telecom) don't receive attached files of scripts if they aren't in a zip file protected by password.
Thank you,
Davide



Da: fiware-robotics-bounces at lists.fi-ware.org<mailto:fiware-robotics-bounces at lists.fi-ware.org> [mailto:fiware-robotics-bounces at lists.fi-ware.org] Per conto di Iñigo Gonzalez
Inviato: giovedì 16 aprile 2015 16:59
A: Colombatto Davide
Cc: fiware-robotics at lists.fi-ware.org<mailto:fiware-robotics at lists.fi-ware.org>
Oggetto: Re: [Fiware-robotics] CB-Proxy

Hi Davide,

I have to say that the proxy isn't available. As we said some time ago that proxy was a temporary solution to try firos with a control panel we had, and we are not using it anymore, so we deleted it. Anyway, as we have changed from office we haven't got our own Internet connection yet, so my PC cannot be accessed from outside the network, making me impossible to help you with this.

All I can do is send you the html code of the demo.

I have been thinking about possible solutions with our current environment (since the only reason of using the proxy was the CORS policy with the context broker):

  1.  Edit the javascript code I have sent you (app.js) change there the proxy's address with the one of the context broker (the one that you have configured in your firos instance) and launch chrome without the security flag so the CORS policy will be avoided.
  2.  Create a little server application that allows CORS and redirects all the requests to another url (the cb one).
  3.  Don't use the demo page, and use native code (java python, c++...) to make requests to the context broker.


Also I have read the documentation you sent about firos and RCM integration, and we are agree with what it is said on it, but I want to add some changes:

  1.  We should add namespaces to the topics, in firos we already had a topic for robot connection and disconnection and the namespace was firos: /firos/connect, /firos/disconnect So we think is interesting that topics to which firos publishes to should be in the "firos" namespace and the ones of rcm in "rcm" namespace for example. This is a way to have the topics well organized.
  2.  The CB_Event object is defined as string instance_name, int16 entity_status. We think both must be instances or entities (same name), but not one instance and the other one entity. As in this case we are talking about the context broker, we think is better to call both entity.
What do you think about these changes? Should I add them to the document?

We have been developing in firos what is said in the document. The communication defined in the document is developed and working, and we have also created a service that emulates what RCM sends to firos to try the full proccess and it seems to work. And this process seems to have sense.

Regards,
Iñigo

On 16/04/15 12:16, Colombatto Davide wrote:
Hi Inigo,

I need to use the web-app of first Robotics LiveDemo (http://130.206.127.115/demo1/) where the FORWARD button requires to switch on the CB-Proxy on your PC.
Can you tell me when I can use it?

Thank you,
Davide
Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone indicate. La diffusione, copia o qualsiasi altra azione derivante dalla conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate ricevuto questo documento per errore siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione, Grazie.

This e-mail and any attachments is confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail, Thanks.
Rispetta l'ambiente. Non stampare questa mail se non è necessario.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fiware.org/private/fiware-robotics/attachments/20150427/d128b6ca/attachment.html>


More information about the Fiware-robotics mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy