Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions docs/aux_files/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
52 changes: 18 additions & 34 deletions docs/examples/different_protocols/pubsub/fiware-ros2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:: bash

curl 172.17.0.1:1026/v2/entities -s -S -H 'Content-Type: application/json' -d @* <<EOF
{
"id": "hello_fiware",
"type": "HelloWorld",
"data": {
"value": "",
"type": "String"
}
}
EOF

Now, in your browser, go to `http://172.17.0.1:1026/v2/entities <http://172.17.0.1:1026/v2/entities>`_.
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/$<ROS2_DISTRO>/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 <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
Expand Down Expand Up @@ -150,16 +134,16 @@ To enable communication from *FIWARE* to *ROS 2*, 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 @- <<EOF
{
"id": "hello_ros2",
"type": "HelloWorld",
"data": {
"value": "",
"type": "String"
}
"id": "hello_ros2",
"type": "HelloWorld",
"data": {
"value": "",
"type": "String"
}
}
EOF

Expand All @@ -175,14 +159,14 @@ You should see the context broker entity named **hello_fiware** previously creat

* Again in the second terminal, update the *FIWARE* entity hosted in the *Context Broker*:

.. code-block:: bash
.. code-block:: json

curl 172.17.0.1:1026/v2/entities/hello_ros2/attrs?type=HelloWorld -s -S -H 'Content-Type: application/json' -X PUT -d @- <<EOF
{
"data": {
"value": "Hello, ROS 2",
"type": "String"
}
"data": {
"value": "Hello, ROS 2",
"type": "String"
}
}
EOF

Expand Down