Skip to content

Commit

Permalink
Revert "Finish GraphCache implementation for Pub/Sub (#66)"
Browse files Browse the repository at this point in the history
This reverts commit fe77eef.
  • Loading branch information
Yadunund authored Nov 19, 2023
1 parent fe77eef commit c84e70d
Show file tree
Hide file tree
Showing 10 changed files with 364 additions and 693 deletions.
31 changes: 7 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Build `rmw_zenoh_cpp`

```bash
mkdir ~/ws_rmw_zenoh/src -p && cd ~/ws_rmw_zenoh/src
git clone https://github.com/ros2/rmw_zenoh.git
git clone git@github.com:ros2/rmw_zenoh.git
cd ~/ws_rmw_zenoh
source /opt/ros/<DISTRO>/setup.bash # replace <DISTRO> with ROS 2 distro of choice
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
Expand All @@ -34,42 +34,25 @@ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

## Test

Make sure to source the built workspace using the commands below prior to running any other commands.
Source workspace
```bash
cd ~/ws_rmw_zenoh
source install/setup.bash
```

### Start the zenoh router
> Note: Manually launching zenoh router won't be necessary in the future.
In a terminal launch Zenoh router:
```bash
# terminal 1
ros2 run rmw_zenoh_cpp init_rmw_zenoh_router
```
> Note: Manually launching zenoh router won't be necessary in the future.
> Note: Without the zenoh router, nodes will not be able to discover each other since multicast discovery is disabled by default in the node's session config. Instead, nodes will receive discovery information about other peers via the zenoh router's gossip functionality. See more information on the session configs [below](#config).
### Run the `talker`
```bash
# terminal 2
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
ros2 run demo_nodes_cpp talker
```
> Note: Ignore all the warning printouts.
In a different terminal source install folder and execute:

### Run the `listener`
```bash
# terminal 2
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
ros2 run demo_nodes_cpp listener
ros2 topic pub "/chatter" std_msgs/msg/String '{data: hello}'
```

The listener node should start receiving messages over the `/chatter` topic.
> Note: Ignore all the warning printouts.
### Graph introspection
Presently we only support limited `ros2cli` commands to introspect the ROS graph such as `ros2 node list` and `ros2 topic list`.

## Config
The [default configuration](rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5) sets up the zenoh sessions with the following main characteristics:

Expand All @@ -86,7 +69,7 @@ A custom configuration may be provided by setting the `RMW_ZENOH_CONFIG_FILE` en

## TODO Features
- [x] Publisher
- [x] Subscription
- [ ] Subscription
- [ ] Client
- [ ] Service
- [ ] Graph introspection
2 changes: 2 additions & 0 deletions rmw_zenoh_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ find_package(rcutils REQUIRED)
find_package(rosidl_typesupport_fastrtps_c REQUIRED)
find_package(rosidl_typesupport_fastrtps_cpp REQUIRED)
find_package(rmw REQUIRED)
find_package(yaml_cpp_vendor REQUIRED)
find_package(zenoh_c_vendor REQUIRED)
find_package(zenohc REQUIRED)

Expand Down Expand Up @@ -56,6 +57,7 @@ target_link_libraries(rmw_zenoh_cpp
rosidl_typesupport_fastrtps_c::rosidl_typesupport_fastrtps_c
rosidl_typesupport_fastrtps_cpp::rosidl_typesupport_fastrtps_cpp
rmw::rmw
yaml-cpp
zenohc::lib
)

Expand Down
3 changes: 1 addition & 2 deletions rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
/// This option does not make LowLatency transport mandatory, the actual implementation of transport
/// used will depend on Establish procedure and other party's settings
///
/// NOTE: Currently, the LowLatency transport doesn't preserve QoS prioritization.
/// NOTE: Currently, the LowLatency transport doesn't preserve QoS prioritization.
/// NOTE: Due to the note above, 'lowlatency' is incompatible with 'qos' option, so in order to
/// enable 'lowlatency' you need to explicitly disable 'qos'.
lowlatency: false,
Expand Down Expand Up @@ -258,5 +258,4 @@
write: false,
},
},

}
1 change: 1 addition & 0 deletions rmw_zenoh_cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<depend>rosidl_typesupport_fastrtps_c</depend>
<depend>rosidl_typesupport_fastrtps_cpp</depend>
<depend>rmw</depend>
<depend>yaml_cpp_vendor</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
Expand Down
Loading

0 comments on commit c84e70d

Please sign in to comment.