From 248d014b92276f5be49b3d0cd2bab2bcf2c995e0 Mon Sep 17 00:00:00 2001 From: Miguel Barro Date: Mon, 24 Apr 2023 16:46:11 +0200 Subject: [PATCH 1/2] Refs 18292. Fixing Integration-Service dockerfile and FIWARE-SH example Signed-off-by: Miguel Barro --- docs/aux_files/Dockerfile | 13 +++--- .../pubsub/fiware-ros2.rst | 40 +++++++++---------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/docs/aux_files/Dockerfile b/docs/aux_files/Dockerfile index de45a52..d597ddf 100644 --- a/docs/aux_files/Dockerfile +++ b/docs/aux_files/Dockerfile @@ -38,17 +38,19 @@ COPY --from=foxy_overlay /ros_entrypoint.sh /ros2_entrypoint.sh RUN apt-get update && apt-get install -f -y git \ libyaml-cpp-dev \ libboost-program-options-dev libboost-system-dev \ - libwebsocketpp-dev + libwebsocketpp-dev \ + libcurlpp-dev libasio-dev libcurl4-openssl-dev # Prepare Integration Service workspace RUN mkdir -p /is_ws/src \ && cd /is_ws/src \ - && git clone https://github.com/eProsima/Integration-Service.git is -b bugfix/ros1_examples_installation \ - && git clone https://github.com/eProsima/xtypes.git --recursive xtypes \ + && git clone https://github.com/eProsima/Integration-Service.git is \ + && git clone https://github.com/eProsima/xtypes.git -b feature/cross_platform --recursive xtypes \ && git clone https://github.com/eProsima/WebSocket-SH.git \ && git clone https://github.com/eProsima/ROS1-SH.git \ && git clone https://github.com/eProsima/ROS2-SH.git \ - && git clone https://github.com/eProsima/FastDDS-SH.git + && git clone https://github.com/eProsima/FastDDS-SH.git \ + && git clone https://github.com/eProsima/FIWARE-SH.git # Compile the Integration Service WORKDIR /is_ws @@ -62,7 +64,8 @@ RUN /ros2_entrypoint.sh \ colcon build --event-handler=console_direct+ \ --packages-skip-regex is-ros1 \ --cmake-args -DBUILD_FASTDDS_EXAMPLES=ON -DBUILD_ROS1_EXAMPLES=OFF \ - -DBUILD_WEBSOCKET_EXAMPLES=ON -DMIX_ROS_PACKAGES="example_interfaces" --install-base /opt/is + -DBUILD_WEBSOCKET_EXAMPLES=ON \ + -DMIX_ROS_PACKAGES="example_interfaces" --install-base /opt/is RUN sed -e 's?ros/noetic?is?g' /ros1_entrypoint.sh > /is_entrypoint.sh && \ chmod +x /is_entrypoint.sh diff --git a/docs/examples/different_protocols/pubsub/fiware-ros2.rst b/docs/examples/different_protocols/pubsub/fiware-ros2.rst index 0dc7acc..8a31735 100644 --- a/docs/examples/different_protocols/pubsub/fiware-ros2.rst +++ b/docs/examples/different_protocols/pubsub/fiware-ros2.rst @@ -99,16 +99,16 @@ To enable communication from *ROS 2* to *FIWARE*, open three terminals: * In the second terminal, create the corresponding entities in the *FIWARE’s Context Broker*: - .. code-block:: bash + .. code-block:: json - curl 172.17.0.1:1026/v2/entities -s -S -H 'Content-Type: application/json' -d @* < Date: Fri, 28 Apr 2023 16:01:33 +0200 Subject: [PATCH 2/2] Refs 18292. Updating the example according to fix in FIWARES-SH #36 Signed-off-by: Miguel Barro --- .../pubsub/fiware-ros2.rst | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/docs/examples/different_protocols/pubsub/fiware-ros2.rst b/docs/examples/different_protocols/pubsub/fiware-ros2.rst index 8a31735..1759eec 100644 --- a/docs/examples/different_protocols/pubsub/fiware-ros2.rst +++ b/docs/examples/different_protocols/pubsub/fiware-ros2.rst @@ -77,7 +77,7 @@ Below we explain how to deploy an example of this communication in both directio ROS 2 pub to FIWARE ----------------------- -To enable communication from *ROS 2* to *FIWARE*, open three terminals: +To enable communication from *ROS 2* to *FIWARE*, open two terminals: * In the first terminal, go to the :code:`is-workspace` folder, source the *ROS 2* and local installations, and execute *eProsima Integration Service* with the :code:`integration-service` command followed by the @@ -97,32 +97,16 @@ To enable communication from *ROS 2* to *FIWARE*, open three terminals: source install/setup.bash integration-service src/Integration-Service/examples/basic/ros2_fiware__helloworld.yaml -* In the second terminal, create the corresponding entities in the *FIWARE’s Context Broker*: - - .. code-block:: json - - curl 172.17.0.1:1026/v2/entities -s -S -H 'Content-Type: application/json' -d @- <`_. -You should see the context broker entity named **hello_fiware** previously created. - -* In the third terminal, source the *ROS 2* installation and launch the *ROS 2* :code:`pub`: +* In the second terminal, source the *ROS 2* installation and launch the *ROS 2* :code:`pub`: .. code-block:: bash source /opt/ros/$/setup.bash - ros2 topic pub /hello_fiware std_msgs/msg/String “{data: Hello FIWARE}” + ros2 topic pub /hello_fiware std_msgs/msg/String "{data: Hello FIWARE}" -Now, if you press `F5` in the browser, you should see that the entity has been correctly updated. +Now, in your browser, go to `http://172.17.0.1:1026/v2/entities `_. +You should see a context broker entity named **hello_fiware**. +Now, if you press `F5` in the browser, you should see that the entity is updated with the ROS provided values. FIWARE to ROS 2 echo