robosoft-ai / SMACC_WG

SMACC Working Group
6 stars 1 forks source link

[FEATURE REQUEST] Add a client to perform web requests #12

Open yassiezar opened 2 years ago

yassiezar commented 2 years ago

It would be helpful to have a client that is able to deal with HTTP/S web requests in cases where robots need to be in contact with an remote server to receive commands or data. This can be similar to the existing subscriber clients which have onMessageReceived() callbacks and can be triggered from client behaviours. The major issues I expect are

  1. how to elegantly handle state changes during long-running requests where the original request caller may no longer be available, and
  2. how to avoid adding large amounts of additional external dependencies.

Are there any plans to add such functionality? I already have something we use which I can port and refine for use in the general library. However, I'm not sure what SMACC's policy on external dependencies is. We're currently using the CPR library for C++ and this JSON library to form the bodies, but if that's too much, I'll have to look into using the libjson and cURL libraries or something more accessible to users instead.

Any insights or ideas would be helpful.

┆Issue is synchronized with this Jira Task by Unito ┆Link To Issue: https://robosoft-ai.atlassian.net/browse/SWG-14

yassiezar commented 2 years ago

I opened up a PR for this on the SMACC1 repo here using the aforementioned CPR library and SMACC's existing client callback-attached-to-client-behavior structure

pabloinigoblasco commented 2 years ago

I have to analyze this in detail but I think it would be nice to add this functionality.