GithubHelp home page GithubHelp logo

rapp-project / rapp-api Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 4.0 16.84 MB

The Robotic Applications API

Home Page: http://rapp-project.eu

License: Other

CMake 2.68% C++ 33.01% JavaScript 25.68% Python 38.49% Shell 0.14%

rapp-api's People

Contributors

akintsakis avatar alexge233 avatar alexsermolaev avatar athallas avatar etsardou avatar gitter-badger avatar klpanagi avatar lpenteri avatar maciek-slon avatar mszlenk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rapp-api's Issues

path_planning example test fails

Hi @alexge233, @klpanagi!

  1. Path_planning example of rapp-api ends with error:
asio error: End of file

full client log concerning path_planning service:

POST /hop/path_planning_plan_path_2d HTTP/1.1
Host: 155.207.19.229:9001
User-Agent: rapp_api/cpp/0.6.0
Connection: close
Accept: */*
Accept-Token: rapp_token
Content-Length: 476
Content-Type: multipart/form-data; boundary=bnEqpWAK5fONDmfE

--bnEqpWAK5fONDmfE
Content-Disposition: form-data; name="json"

{"map_name":"empty","robot_type":"NAO","algorithm":"dijkstra","":{"header":{"seq":"0","frameid":"frame_x","stamp":{"sec":"0","nsec":"10"}},"pose":{"position":{"x":"1","y":"1","z":"0"},"orientation":{"x":"1","y":"2","z":"2","w":"3"}}},"":{"header":{"seq":"1","frameid":"frame_x","stamp":{"sec":"0","nsec":"10"}},"pose":{"position":{"x":"2","y":"2","z":"0"},"orientation":{"x":"5","y":"6","z":"6","w":"7"}}}}

asio error: End of file
  1. I found a bug in the request also. Client requested:
    start orientation: 1 2 3 4
    goal orientation 5 6 7 8

, but the log above shows:

start orientation: 1 2 2 3
goal orientation 5 6 6 7.

  1. There is wrong upload_map HOP service name in here. Following commit resolves this bug: ( 7a333d4 ).

[cpp] add plan_path_2d cloud API implementation

Current plan_path_2d cloud API implementation is copy-paste of a speech API method. Proper plan_path_2d method implementation is required to the incoming release. Could you help me with the issue?

After merge of the cpp_merge branch into cpp branch, the API doesn't build

After applying the merge that I mention in the tittle, I tried to build the API along with the tests:
cmake .. -DBUILD_TESTS=ON
make

Make failed with the following output:
Scanning dependencies of target lrapp [ 9%] Building CXX object CMakeFiles/lrapp.dir/includes/config/config.cpp.o [ 36%] Building CXX object CMakeFiles/lrapp.dir/includes/cloud/asio/asio_http/asio_http.cpp.o [ 18%] Building CXX object CMakeFiles/lrapp.dir/includes/cloud/asio/asio_handler/asio_handler.cpp.o [ 27%] Building CXX object CMakeFiles/lrapp.dir/includes/cloud/asio/asio_https/asio_https.cpp.o [ 36%] Built target lrapp Scanning dependencies of target rapp.0.6 [ 45%] Linking CXX shared library librapp.0.6.so [ 45%] Built target rapp.0.6 Scanning dependencies of target serialise_test Scanning dependencies of target service_test Scanning dependencies of target object_test [ 54%] Building CXX object CMakeFiles/service_test.dir/tests/service_test.cpp.o [ 63%] Building CXX object CMakeFiles/object_test.dir/tests/object_test.cpp.o [ 72%] Building CXX object CMakeFiles/serialise_test.dir/tests/serialise.cpp.o In file included from /home/leizer/rapp-api/cpp/includes/objects.hpp:13:0, from /home/leizer/rapp-api/cpp/tests/serialise.cpp:5: /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp:21:27: error: ‘msg_metadata’ in namespace ‘rapp::object’ does not name a type const rapp::object::msg_metadata header, ^ /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp:50:16: error: ‘msg_metadata’ in namespace ‘rapp::object’ does not name a type rapp::object::msg_metadata header; ^ /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp: In constructor ‘rapp::object::pose_stamped::pose_stamped(int, rapp::object::pose)’: /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp:24:7: error: class ‘rapp::object::pose_stamped’ does not have any field named ‘header’ : header(header), pose(pose) ^ /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp: In member function ‘bool rapp::object::pose_stamped::operator==(const rapp::object::pose_stamped&) const’: /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp:36:17: error: ‘const struct rapp::object::pose_stamped’ has no member named ‘header’ return (this->header == rhs.header) && ^ /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp:36:31: error: ‘const struct rapp::object::pose_stamped’ has no member named ‘header’ return (this->header == rhs.header) && ^ /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp: In member function ‘boost::property_tree::ptree rapp::object::pose_stamped::treefy() const’: /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp:44:34: error: ‘header’ was not declared in this scope tree.add_child("header", header.treefy()); ^ /home/leizer/rapp-api/cpp/tests/serialise.cpp: In function ‘int main(int, char**)’: /home/leizer/rapp-api/cpp/tests/serialise.cpp:32:45: error: no matching function for call to ‘rapp::object::pose_stamped::pose_stamped(rapp::object::pose_metadata&, rapp::object::pose&)’ rapp::object::pose_stamped ps(meta, pose); ^ In file included from /home/leizer/rapp-api/cpp/includes/objects.hpp:13:0, from /home/leizer/rapp-api/cpp/tests/serialise.cpp:5: /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp:31:5: note: candidate: constexpr rapp::object::pose_stamped::pose_stamped(const rapp::object::pose_stamped&) pose_stamped(const rapp::object::pose_stamped &) = default; ^ /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp:31:5: note: candidate expects 1 argument, 2 provided /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp:28:5: note: candidate: constexpr rapp::object::pose_stamped::pose_stamped() pose_stamped() = default; ^ /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp:28:5: note: candidate expects 0 arguments, 2 provided /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp:20:2: note: candidate: rapp::object::pose_stamped::pose_stamped(int, rapp::object::pose) pose_stamped( ^ /home/leizer/rapp-api/cpp/includes/objects/pose_stamped/pose_stamped.hpp:20:2: note: no known conversion for argument 1 from ‘rapp::object::pose_metadata’ to ‘int’ [ 81%] Linking CXX executable object_test [ 81%] Built target object_test CMakeFiles/serialise_test.dir/build.make:62: recipe for target 'CMakeFiles/serialise_test.dir/tests/serialise.cpp.o' failed make[2]: *** [CMakeFiles/serialise_test.dir/tests/serialise.cpp.o] Error 1 CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/serialise_test.dir/all' failed make[1]: *** [CMakeFiles/serialise_test.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 90%] Linking CXX executable service_test [ 90%] Built target service_test Makefile:138: recipe for target 'all' failed make: *** [all] Error 2

Error in sample codes for Python documentation

The sample is:

from RappCloud.CloudMsgs import OntologySubclasses
from RappCloud import RappPlatformService

svc = RappPlatformService()
msg = OntologySubclasses()
# Ontology subclasses of Oven query
msg.ontology_class = 'Oven'
msg.recursive = False

response = svc.call(msg)

But the respective ROS service gets no input (ontology_class=""). If transformed to the one below it works:

from RappCloud.CloudMsgs import OntologySubclasses
from RappCloud import RappPlatformService

mesg= OntologySubclasses(ontology_class='Oven', recursive=False)
svc = RappPlatformService(msg=mesg)

response = svc.call()

[generic] path_upload_map question

@klpanagi

Is the path_upload_map upload files or simply using string names?
I see a png_file param and a yaml_file param: is the first a PNG file or just the name of it?
Same with yaml file, is it a file or a file name?

A.

[cpp] API example face_detect not working

I've tried to run example face_detect application from both devel and cpp branch. I have platform compiled today, from the setup scripts, on clean machine. When running python tests, web service shows this output on terminal:

40 ACCEPT: localhost [Mon, 25 Jul 2016 15:26:01 +0200]
40 REQUEST.serv: POST *://anonymous@localhost:9001 /hop/face_detection HTTP/1.1
40 INVOKE.svc (face_detection . #|JsObject [__proto__: JsObject] [extensible: #t] [properties: ()] [cmap: JsConstructMap] [elements: vector]|)

But when running C++ example, output is a little bit different:

41 ACCEPT: localhost [Mon, 25 Jul 2016 15:37:07 +0200]
41 REQUEST.serv: POST *://anonymous@localhost:9001 /hop/face_detection HTTP/1.1
41 INVOKE.svc (face_detection)

Output from the face_detect is:

face detect: /home/rapp/rapp_platform/rapp-platform-catkin-ws/src/rapp-platform/rapp_testing_tools/test_data/face_samples/etsardou_close_angle.jpg
found 0 faces!

And application is not finishing, it hangs instead (must be killed by CTRL+C).

Given test file, when passed directly to ROS service (by rosservice call), produces expected output (one face).

asio_service_http not handling long response

I've just created C++ example for speech_to_text service (see post_builder branch f78efef). Service is called properly on platform side, but on the API side there is a bug with handling long responses, sent in multipile TCP packets. Class asio_service_http treats every packet independently, which results in error:

no double return after header

when second part of data is retrieved. As a result for request to say "test" in english "en", first packet received by asio_service_http is:

Content-Length: 39940
Connection: close
Content-type: application/json; charset=UTF-8
Server: Hop

{"payload":"UklGRsR0AABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YaB0AAD//wAAAAD//wAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAP////8AAAEAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAAAQAAAAAAAQAAAAAA//8AAAAA/////wAA
AAABAAAAAQD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAD//wAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAEA//8AAAAAAAAAAAAAAAA

and then next packet comes, obviously without the header (as it is just continuation of previous data):

AAAAAAAAAAAAAAAABAAAA/////wEAAAABAAAAAAAAAAAAAAD//wAAAAD//wEAAAAAAP////8AAAAAAAAAAA
EAAQAAAAAAAAAAAAAAAAD//wAAAAABAP//AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAP//AQAAAAAA//8AAAAAAAAAAAEA
AAD//wAAAAAAAAAAAAABAP//AAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAD//wAAAAAAAAAA/////wAA/////wAAAAAAAP//AAABAAAAAA
D//wEA//8AAAAAAAAAAP//AAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAD//wAA//8AAAAAAQAAAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAEAAQAAAAAAAAAAAAAAAAD//wEAAAAAAAAAAAABAAEAAQAAAAAAAAAAAP//AAAAAAAAAAD//wAAAAD//wAAAAD//wAAAQD//w
EAAQA

which triggers before-mentioned exception.

[cpp] assignment and copy constructor socket objects throw error: Operation canceled

Re-using same objects (via pointers) throws a boost error:

error: Operation canceled

This is because protected members such as content_length_ and others are not reset.
Currently the only solution is to not re-use cloud objects, but to allocate new ones.

FIX:

Manually implement an assignment or copy constructor which resets those fields.

Gitter badge wrong link

The Gitter badge in the master branch points to the wrong link: link

Also it seems misplaced, probably due to erroneous merging of the pull request.

[cpp] rapp::object::time has erroneous logic and usage

@dudekw The implementation of rapp::object::time is dangerous and flawed:

  1. it requires bot seconds and nanoseconds (no need, either should suffice)
  2. it uses int32_t

I suggest it becomes a wrapper around either std::crhono or boost::posix_time
In the test directory you can see how I instantiate it:
https://github.com/rapp-project/rapp-api/blob/cpp/cpp/tests/serialise.cpp

Furthermore, implicit casting to int32_t is tricky and potentially very dangerous.

[cpp] Example data for `plan_path_2d`

Hi,

Can we please have a valid data example for the service call plan_path_2d?
We tried using arbitrary values and we didn't get an error but no response either.

@MariaRamos89 has committed d49882f to branch cpp_dev , and tried using the python example which returns nothing.
The example that did work was the default values in the path planning example in branch cpp-wut.

  1. If the coordinates are outside the boundaries, shouldn't we get an error?
    Preferably with the actual boundaries of the map?
  2. If the pose is illegal, shouldn't we get an error?
  3. How do you create those PNG map images, and do they have some kind of metric/distance embedded, or is the yaml descriptor that does that? The yaml does not seem to indicate much about the size of the map

Many thanks,
A.

[cpp] Wrong includes install directory

In branch cpp, CMakeLists.txt has wrong install target for headers. It should be:

# Header install dir
install (DIRECTORY ${INCLUDES}/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME} FILES_MATCHING PATTERN "*.hpp" PATTERN "*.ihh")

# Install Global header
install (FILES ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}) 

[js] API tests not working

When running npm test in js subdirectory, following output is produced (all errors looks similar):

  #ontology_superclasses_of()
{ [Error: socket hang up] code: 'ECONNRESET' }

For this call, web service prints following output:

1 ACCEPT: localhost [Wed, 27 Jul 2016 14:07:29 +0200]
1 ABORT:  &hop-method-error
*** ERROR:request-line-grammar:
Method not implemented -- ���������Xv�);����V�rW�,h�f1W�Yt����9��J���/�+�0�,��'g�(k�$���
����jih9876�2�.�*�&���=5�#��� ���@?>3210�1�-�)�%����</�����
��f
    localhost
                 ����
���������



    1. &pool-scheduler1070, 

API branch: devel
Platform branch: devel

Face detection service enhancement

The face_detection service should have one more parameter: A bool called "fast". If true it provides fast face detection suitable for tracking.

  • C++
  • JS
  • Python

This feature exists in the devel branch of rapp-platform

path_upload_map service does not save maps in the cloud

Hi @alexge233, @klpanagi !
I tied to run the path_planner example and it failed. We've tested it with our cloud also. Python API call works well.

The map files are not being saved in the cloud.

Client log:

png: /home/wojciech/rapp/rapp-platform/rapp_path_planning/rapp_map_server/maps/empty.png
yaml: /home/wojciech/rapp/rapp-platform/rapp_path_planning/rapp_map_server/maps/empty.yaml
m_name: my_map
upload status: 


pose_goal: 0.2 0.2 0 0 0 0 1 
asio error: End of file

Cloud log:

No map image file received

Empty response in Current Weather - Python API

Request in ROS node:

city: Athens
weather_reporter: ''
metric: 0

Response in ROS node:

{'wind_speed': '0.32', 'temperature': '59.53', 'wind_direction': '', 'visibility': '9.05', 'humidity': '0.88', 'pressure': '1022.65', 'date': '1464173287', 'weather_description': 'Clear', 'wind_temperature': ''}

Response of Python API call:

{'wind_speed': '', 'temperature': '', 'wind_direction': '', 'visibility': '', 'humidity': '', 'pressure': '', 'error': u'', 'date': '', 'weather_description': '', 'wind_temperature': ''}

[cpp] rapp::object::header should be renamed

@dudekw

I propose that rapp::object::header to be renamed to rapp::object::meta or similar.
Header implies TCP/IP and since we have similar usage, it could be confusing.

Furthermore, it is unclear what seq is, and what frameid is.
Please update documentation via Doxygen comments.

Also, is there a reason why all those objects are struct and not class ?

Please see latest cpp code before refactoring, I will solve conflicts based on new name.

Error in python package

RappCloud/ServiceController/Adapters.py", line 35, in
ImportError: No module named packages.urllib3.poolmanager

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.