{"id":13506122,"url":"https://github.com/eProsima/FIROS2","last_synced_at":"2025-03-30T03:30:35.219Z","repository":{"id":76916690,"uuid":"88967869","full_name":"eProsima/FIROS2","owner":"eProsima","description":"eProsima FIROS2 is a ROS2 integrable tool focused in the intercommunication between ROS2 and FIWARE","archived":false,"fork":false,"pushed_at":"2019-10-15T07:21:45.000Z","size":824,"stargazers_count":8,"open_issues_count":3,"forks_count":1,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-11-01T04:35:03.449Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eProsima.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-04-21T09:36:42.000Z","updated_at":"2024-08-12T19:29:15.000Z","dependencies_parsed_at":"2023-03-11T23:24:52.091Z","dependency_job_id":null,"html_url":"https://github.com/eProsima/FIROS2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eProsima%2FFIROS2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eProsima%2FFIROS2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eProsima%2FFIROS2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eProsima%2FFIROS2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eProsima","download_url":"https://codeload.github.com/eProsima/FIROS2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246273533,"owners_count":20750904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T01:00:35.010Z","updated_at":"2025-03-30T03:30:33.837Z","avatar_url":"https://github.com/eProsima.png","language":"C++","funding_links":[],"categories":["Open-Source FIWARE from third parties","Packages"],"sub_categories":["Robotics","Driver layer"],"readme":"# eProsima FIROS2\n![http://www.eprosima.com](https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSd0PDlVz1U_7MgdTe0FRIWD0Jc9_YH-gGi0ZpLkr-qgCI6ZEoJZ5GBqQ)\n\n*eProsima FIROS2* is an application that allows intercommunication between *ROS2* and *NGSIv2* protocol.\nSince *FIROS2* is powered by *eProsima Integration Service*, it makes possible the creation of bidirectional\ncommunication bridges with customized routing, to map between input and output attributes, and perform data\nmodification between *ROS2* and *NGSIv2* from *FIWARE-Orion contextBroker*.\n\n\u003cp align=\"center\"\u003e \u003cimg src=\"doc/Firos_main.png\" alt=\"Default behavior\"/\u003e \u003c/p\u003e\n\n\u003chr\u003e\u003c/hr\u003e\n\n### **Table Of Contents**\n\n[Installation](#installation-of-firos2)\n\n[Configuration](#firos2-configuration)\n\n[Transformation, mapping and communication](#transformation-mapping-and-communication)\n\n[Types and interfaces](#types-and-interfaces)\n\n[Dynamic Types](#dynamic-types)\n\n\u003chr\u003e\u003c/hr\u003e\n\n### Installation of FIROS2\n\nBefore using *FIROS2*, it has to be installed along with the rest of *ROS2 Crystal* packages of your system.\nIf you have followed the *ROS2*\n\u003ca href=\"https://index.ros.org/doc/ros2/Installation\" target=\"_blank\"\u003einstallation manual\u003c/a\u003e,\nyou only need to clone this repository on your *ROS2* workspace.\n\n`NOTE: Only ROS2 Crystal is currently supported by FIROS2.`\n\nFor cloning this project and update its submodules at the same time, don't forget to add the *--recursive* option.\n\nIn Linux, these are the steps:\n\n``` bash\n    $ cd ~/ros2_ws/src/ros2/\n    $ git clone --recursive https://github.com/eProsima/firos2\n    $ cd ~/ros2_ws\n```\n\nIn the case of Windows:\n\n``` bash\n    \u003e cd C:\\dev\\ros2\\src\\ros2\n    \u003e git clone --recursive https://github.com/eProsima/firos2\n```\n\nOn windows you must compile [*cURL Library*](https://github.com/curl/curl) as a thirdpary submodule:\n\n``` bash\n    \u003e cd C:\\dev\\ros2\\src\\ros2\\firos2\\thirdparty\\curl\n    \u003e buildconf.bat\n    \u003e cd winbuild\n    \u003e nmake /f Makefile.vc mode=dll VC=14\n    \u003e cd C:\\dev\\ros2\n```\n\nOnce done, *FIROS2* is compiled like any other *ROS2* package.\n\nFor example:\n\n``` bash\n    $ colcon build --cmake-args -DTHIRDPARTY=ON --packages-select firos\n```\n\nThere are several examples to show the behavior under the [examples folder](examples).\n\n### FIROS2 configuration\n\n*FIROS2* offers different parameters that the user can configure. For setting-up a *bridge*,\nthe user has to define a configuration file with the information about input and output protocols.\nThere is a generic example on [**config.xml**](resource/config.xml)\n\nIn this template is it possible to set different bridges between topics and entities.\n*FIROS2's* *bridges* subscribe to a topic and update data of the related entity and subscribe to entities and\npublish data to the related topic.\nThe parameters that have to be defined are (only shown a *bridge* section of the *config.xml* file):\n\n    \u003c!-- Declares a custom bridge named 'bridge_ngsiv2' --\u003e\n    \u003cbridge name=\"bridge_ngsiv2\"\u003e\n        \u003c!-- Path to the NGSIv2 library --\u003e\n        \u003clibrary\u003e/path/to/ngsiv2bridge.so\u003c/library\u003e\n\n        \u003creader name=\"sub_ngsiv2\"\u003e\n            \u003cproperty\u003e\n                \u003cname\u003eid\u003c/name\u003e\n                \u003cvalue\u003eentity_idPattern\u003c/value\u003e\n            \u003c/property\u003e\n            \u003cproperty\u003e\n                \u003cname\u003ehost\u003c/name\u003e\n                \u003cvalue\u003econtext_broker_host\u003c/value\u003e\n            \u003c/property\u003e\n            \u003cproperty\u003e\n                \u003cname\u003eport\u003c/name\u003e\n                \u003cvalue\u003econtext_broker_port\u003c/value\u003e\n            \u003c/property\u003e\n            \u003cproperty\u003e \u003c!-- optional --\u003e\n                \u003cname\u003etype\u003c/name\u003e\n                \u003cvalue\u003eentity_type\u003c/value\u003e\n            \u003c/property\u003e\n            \u003cproperty\u003e \u003c!-- optional, comma separated values --\u003e\n                \u003cname\u003eattrs\u003c/name\u003e\n                \u003cvalue\u003eattr1[,attr2...]\u003c/value\u003e\n            \u003c/property\u003e\n            \u003cproperty\u003e \u003c!-- optional --\u003e\n                \u003cname\u003eexpression\u003c/name\u003e\n                \u003cvalue\u003econdition_expression\u003c/value\u003e\n            \u003c/property\u003e\n            \u003cproperty\u003e \u003c!-- optional, comma separated values --\u003e\n                \u003cname\u003enotif\u003c/name\u003e\n                \u003cvalue\u003enotif_attr1[,notif_attr2...]\u003c/value\u003e\n            \u003c/property\u003e\n            \u003cproperty\u003e\n                \u003cname\u003elistener_host\u003c/name\u003e\n                \u003cvalue\u003eour_listener_host\u003c/value\u003e\n            \u003c/property\u003e\n            \u003cproperty\u003e\n                \u003cname\u003elistener_port\u003c/name\u003e\n                \u003cvalue\u003eour_listener_port\u003c/value\u003e\n            \u003c/property\u003e\n            \u003cproperty\u003e\n                \u003c!-- optional. In KB, if not specified, 2KB --\u003e\n                \u003cname\u003elistener_buffer_size\u003c/name\u003e\n                \u003cvalue\u003eour_listener_buffer_size\u003c/value\u003e\n            \u003c/property\u003e\n            \u003cproperty\u003e \u003c!-- optional --\u003e\n                \u003cname\u003eexpiration\u003c/name\u003e\n                \u003cvalue\u003esubscription_expiration_time\u003c/value\u003e\n            \u003c/property\u003e\n            \u003cproperty\u003e \u003c!-- optional --\u003e\n                \u003cname\u003ethrottling\u003c/name\u003e\n                \u003cvalue\u003esubscription_throttling\u003c/value\u003e\n            \u003c/property\u003e\n            \u003cproperty\u003e \u003c!-- optional --\u003e\n                \u003cname\u003edescription\u003c/name\u003e\n                \u003cvalue\u003esubscription_description\u003c/value\u003e\n            \u003c/property\u003e\n        \u003c/reader\u003e\n\n        \u003cwriter name=\"pub_ngsiv2\"\u003e\n            \u003cproperty\u003e\n                \u003cname\u003ehost\u003c/name\u003e\n                \u003cvalue\u003econtext_broker_host\u003c/value\u003e\n            \u003c/property\u003e\n            \u003cproperty\u003e\n                \u003cname\u003eport\u003c/name\u003e\n                \u003cvalue\u003econtext_broker_port\u003c/value\u003e\n            \u003c/property\u003e\n        \u003c/writer\u003e\n    \u003c/bridge\u003e\n\n### Transformation, mapping and communication\n\nAs said before, when a *bridge* is connecting two nodes with different protocols,\nthe user has to provide a library with a function to transform and to map the attributes from one protocol to another.\nTo make this step easier, there is an empty code template in **templatelib.cpp**.\n\nThis function will be compiled apart and loaded in *FIROS2* at runtime.\n\nIn this way, the user can map attributes from the input to the output message and at the same time apply changes\nover the data. The serialization and deserialization functions are generated with provided tools,\nso the *IDL* files used are the only thing that the user has to put in the bridge.\n\n*FIROS2* provides a built-in *NGSIv2 bridge library* named *libisbridgengsiv2lib.so* that implements an\n*ISBridgeNGSIv2* with *NGSIv2Publisher* and *NGSIv2Subscriber* that allows communicating RTPS and NGSIv2,\nimplementing the interfaces *ISBridge*, *ISWriter*, and *ISReader* respectively.\n\nYou can, of course, implement and use your *bridge libraries* to define other behaviors.\n\nYou can learn more about *Bridge Libraries* and *Transformation Libraries* in the documentation of\n*[eProsima Integration Service](https://integration-services.readthedocs.io/)*.\n\n### Types and interfaces\n\nFor interaction with *NGSIv2* entities exists an *IDL* file (and generated files).\nThis *IDL* is named **JsonNGSIv2.idl** and contains a structure composed of two strings, *entityId*, and *data*.\n\nOn receiving messages from *NGSIv2* protocol, it only fills the *data* field.\nIn this case, it ignores the *entityId* field, and it's better to keep it empty.\n*Integration Service* will fill *data* with the complete JSON string sent to our listener by the\n*contextBroker* server (this is, the subscription result).\n\nFor sending messages to the *contextBroker* to update entities from changes received from *RTPS* subscriber,\n*JsonNGSIv2\" must fill *entityId* with the *entityId* of the entity modified and *data* with a composed JSON\ncontaining the attributed to being updated.\n\nThe user must implement the interaction with the *NGSIv2* entities in the *transformation library*.\n\nIn the example **TIS_NGSIv2** the *transformation library* shows examples of both transformations using the\ndescribed behavior.\n\nYou can create your *IDL* files to define the required behavior and management of the data.\nTo get a deeper comprehension of the relation between *ROS2* and *Fast RTPS* IDL definitions,\nyou can see [this article](http://design.ros2.org/articles/mapping_dds_types.html).\n\n## Dynamic Types\n\nAn example of integration with **Dynamic Types** can be found in the *Dyn_TIS_NGSIv2* example.\n*RobotExample* executable uses static types (to show compatibility),\nbut *ROS2* publisher/subscriber uses *DynamicTypes*, as well as *NGSIv2* that uses a dynamic version of the\n*NGSIv2 JSON* library.\nAll *Dynamic Types* related files are under *DynNGSIv2* folder,\nthat generates an additional dynamic library to be used with *dynamic types transformation libraries*.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FeProsima%2FFIROS2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FeProsima%2FFIROS2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FeProsima%2FFIROS2/lists"}