From e4b1ab830aa841491e20963eb8f8433c2fd188b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20Pal=C3=A9ologue?= Date: Thu, 26 Oct 2023 08:53:43 +0000 Subject: [PATCH] Update README --- README.md | 94 ++++++++++++++++++++++++++++++++++++++++++++++ README.rst | 108 ----------------------------------------------------- 2 files changed, 94 insertions(+), 108 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/README.md b/README.md new file mode 100644 index 000000000..aa59f002e --- /dev/null +++ b/README.md @@ -0,0 +1,94 @@ +# ROS 2 port for libQi + +libQi is a C++ middleware that provides RPC, type-erasure, +cross-language interoperability, OS abstractions, logging facilities, +asynchronous task management, dynamic module loading. + +## Compilation + +Clone this project in your ROS 2 workspace (under `src/`), +and run `colcon build`. + +## C++ Example + +The following example shows some features of the framework, please refer to the +documentation for further details. + +```cpp +#include +#include +#include +#include + +qiLogCategory("myapplication"); + +class MyService +{ +public: + void myFunction(int val) { + qiLogInfo() << "myFunction called with " << val; + } + qi::Signal eventTriggered; + qi::Property angle; +}; + +// register the service to the type-system +QI_REGISTER_OBJECT(MyService, myFunction, eventTriggered, angle); + +void print() +{ + qiLogInfo() << "print was called"; +} + +int main(int argc, char* argv[]) +{ + qi::ApplicationSession app(argc, argv); + + // connect the session included in the app + app.start(); + + qi::SessionPtr session = app.session(); + + // register our service + session->registerService("MyService", boost::make_shared()); + + // get our service through the middleware + qi::AnyObject obj = session->service("MyService").value(); + + // call myFunction + obj.call("myFunction", 42); + + // call print in 2 seconds + qi::async(&print, qi::Seconds(2)); + + // block until ctrl-c + app.run(); +} +``` + +You can then run the program with: + +```bash +./myservice --qi-standalone # for a standalone server +./myservice --qi-url tcp://somemachine:9559 # to connect to another galaxy of sessions +``` + +## Links + +Upstream repository: +http://github.com/aldebaran/libqi + +Documentation: +http://doc.aldebaran.com/libqi/ + +IRC Channel: +#qi on freenode. + +Upstream Maintainers: + +- Joël Lamotte +- Jérémy Monnon +- Matthieu Paindavoine +- Vincent Palancher + +See the [`package.xml`](package.xml) for the ROS 2 maintainers. diff --git a/README.rst b/README.rst deleted file mode 100644 index 9e93f5145..000000000 --- a/README.rst +++ /dev/null @@ -1,108 +0,0 @@ -libqi -===== - -libqi is a middle-ware framework that provides RPC, type-erasure, -cross-language interoperability, OS abstractions, logging facilities, -asynchronous task management, dynamic module loading. - -Compilation ------------ - -To compile libqi you need qibuild which give some cmake functions used -in libqi's CMakeLists.txt. - -.. code-block:: sh - - pip2 install --user qibuild - - git clone git@github.com:aldebaran/libqi.git - cd libqi - - mkdir BUILD && cd BUILD - cmake .. -DQI_WITH_TESTS=OFF - make - make install DESTDIR=./output - -Example -------- - -The following example shows some features of the framework, please refer to the -documentation for further details. - -.. code-block:: cpp - - #include - #include - #include - #include - - qiLogCategory("myapplication"); - - class MyService - { - public: - void myFunction(int val) { - qiLogInfo() << "myFunction called with " << val; - } - qi::Signal eventTriggered; - qi::Property angle; - }; - - // register the service to the type-system - QI_REGISTER_OBJECT(MyService, myFunction, eventTriggered, angle); - - void print() - { - qiLogInfo() << "print was called"; - } - - int main(int argc, char* argv[]) - { - qi::ApplicationSession app(argc, argv); - - // connect the session included in the app - app.start(); - - qi::SessionPtr session = app.session(); - - // register our service - session->registerService("MyService", boost::make_shared()); - - // get our service through the middleware - qi::AnyObject obj = session->service("MyService").value(); - - // call myFunction - obj.call("myFunction", 42); - - // call print in 2 seconds - qi::async(&print, qi::Seconds(2)); - - // block until ctrl-c - app.run(); - } - -You can then run the program with: - -.. code-block:: console - - ./myservice --qi-standalone # for a standalone server - ./myservice --qi-url tcp://somemachine:9559 # to connect to another galaxy of sessions - -Links ------ - -git repository: -http://github.com/aldebaran/libqi - -Documentation: -http://doc.aldebaran.com/libqi/ - -IRC Channel: -#qi on freenode. - -Maintainers: - -- Joël Lamotte -- Jérémy Monnon -- Matthieu Paindavoine -- Vincent Palancher