Comments (11)
Both png_file
and yaml_file
arguments are expected to be files. The combination of these files form a map that will be later used to perform path_planning on, by calling the /path_planning_plan_path_2d
service
from rapp-api.
is it OK if I expect an std::string
in place of the yaml? (assuming a serialised file rather than a parsed object).
from rapp-api.
If you mean the C++ API to send a serialized file in the web service, no, since the web service and the python/JS API are already implemented this way.
If you mean for the user to provide your implemented C++ call a std::string (instead of a yaml), why is it a problem for the developer to provide the path of the yaml file? The two-files format (yaml & png) is the standard way in ROS to parse maps.
from rapp-api.
This is what I don't get: do I have to upload those files, or are they assumed already on the platform, and I simply have to state which one to use?
Am I sending parameters, or files? If the latter, then I need to serialise the PNG (done via class picture
) and the YAML (which is in essence an std::string
for my intents and purposes).
from rapp-api.
This is what I don't get: do I have to upload those files, or are they assumed already on the platform, and I simply have to state which one to use?
The path_planning_upload_map
web service has been developed in order to upload map files which will be later used to perform path-planning (e.g. path_planning_plan_path_2d
).
This way, clients can (ONCE) upload a map and perform multiple path_planning_plan_path_2d
service calls.
The Web Service expects both files
to be uploaded. Those files are stored on the Platform.
Am I sending parameters, or files? If the latter, then I need to serialise the PNG (done via class picture) and the YAML (which is in essence an std::string for my intents and purposes).
Both yaml_file
and png_file
are expected to be file uploads in a multipart/form-data .POST request
from rapp-api.
I am sorry but this is still confusing me.
You say:
Both yaml_file and png_file are expected to be file uploads in a multipart/form-data .POST request
But you have a png_file
parameter. I am guessing this is the name of the image file being uploaded?
Same with the yaml
you have a yaml_file
parameter, which I am also guessing this is refering to the yaml file being uploaded?
If this is the case, then my constructor is:
path_upload_map(
const rapp::object::picture png_file,
const std::string png_filename,
const rapp::object::yaml yaml_file,
const std::string yaml_name,
const std::string map_name,
std::function<void(std::string)> callback
)
Thus when you receive the call, you will get a multipart/form data POST, with a JSON referencing the multipart form binary and text data of the files.
Is this what you want?
from rapp-api.
If the path_upload_map
is the API function the developer has to call, then he must not create rapp::object::picture
objects. He just needs to give as input parameters the following:
path_upload_map(
const std::string png_filename,
const std::string yaml_name,
const std::string map_name,
std::function<void(std::string)> callback)
Its the C++ API's job to take these files (specified by their path only), internally create any object necessary and make the call to the platform Web service.
I guess you have implemented face detection, qr detection (and all other calls requiring to upload an image) the same way.
from rapp-api.
@etsardou no I have done the exact opposite throughout the entire rapp api. In fact its the other way around, normally every API takes object params (e.g., STL, OpenCV, Boost) since those are libraries.
The responsibility of loading and manipulating the files lies with the developer, as well as dealing with their memory management.
Have a look at the following:
- face_detection: https://github.com/rapp-project/rapp-api/blob/cpp/cpp/includes/cloud/vision/face_detection/face_detection.hpp
- qr_detection: https://github.com/rapp-project/rapp-api/blob/cpp/cpp/includes/cloud/vision/qr_detection/qr_detection.hpp
- speech_to_text_sphing4: https://github.com/rapp-project/rapp-api/blob/cpp/cpp/includes/cloud/speech/speech_detection_sphinx4/speech_detection_sphinx4.hpp
- same with path planning, human, hazard or object detection and so on.
and their respective examples:
- https://github.com/rapp-project/rapp-api/blob/cpp/cpp/examples/speech_to_text.cpp
- https://github.com/rapp-project/rapp-api/blob/master/cpp/examples/face_detect.cpp
Of course I can provide helper functions so that the files are loaded from a location, but I honestly see little benefit in doing so (other than some minor error checking).
Back to the discussion at hand:
- I am correct in assuming that both a JSON and the multipart/form-data are expected?
- Should the file names refer to the multipart boundary binary data?
from rapp-api.
Then I see no point in giving file names at all. Just proceed with the files themselves.
from rapp-api.
@etsardou thats what I thought too, hence why I kept asking
EDIT:
Just to be clear:
- the JSON will contain ONLY a
map_name
- the POST multipart/form-data will contain the binary data of the PNG and the string data of the YAML.
from rapp-api.
Hi,
I've done some major refactoring:
- renamed a class (
header
topose_metadata
since I useheader
in asio for TCP/IP). - broke down de-serialization from a JSON/Boost propetry tree, as struct/class constructors (UNTESTED)
- changed
struct time
to work withstd::chrono
(feel free to remove membersec
).
Can somebody please write a simple test for the navigation/path planning and test it? I'll write individual unit tests (especially with the JSON params), but as of yet branch cpp
has untested code.
from rapp-api.
Related Issues (20)
- [python] Add links in home README for the language specific READMEs
- Update main README.md
- [cpp] add plan_path_2d cloud API implementation HOT 37
- TextToSpeech Python API: No error returned if destination file is invalid (e.g. '') HOT 1
- Error in python package
- [cpp] rapp::object::time has erroneous logic and usage HOT 3
- [cpp] rapp::object::header should be renamed HOT 1
- [cpp] rapp::object::point should be renamed
- Update master branch for release HOT 6
- Create C++ / JS API calls documentation HOT 1
- [cpp] API example face_detect not working HOT 31
- [js] API tests not working HOT 4
- path_upload_map service does not save maps in the cloud HOT 2
- path_planning example test fails HOT 12
- [cpp] rapp::object::time is using partial time deserialisation
- [cpp] Example data for `plan_path_2d` HOT 10
- [c++] Missing geolcoation JSON field HOT 1
- add asio timer to c++ 0.7.1
- After merge of the cpp_merge branch into cpp branch, the API doesn't build HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rapp-api.