Skip to content

Commit

Permalink
Merge branch 'rolling' into print_router_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Yadunund committed Jun 6, 2024
2 parents e78d3ee + 66ec842 commit 329cc10
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ cd ~/ws_rmw_zenoh
source install/setup.bash
```

### Start the zenoh router
> Note: Manually launching zenoh router won't be necessary in the future.
### Start the Zenoh router
> Note: Manually launching Zenoh router won't be necessary in the future.
```bash
# terminal 1
ros2 run rmw_zenoh_cpp rmw_zenohd
```

> 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).
> 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).
### Terminate ROS 2 daemon started with another RMW
```bash
Expand Down Expand Up @@ -119,3 +119,15 @@ In this example, the `Zenoh router` will connect to the `Zenoh router` running o
```

> Note: To connect multiple hosts, include the endpoints of all `Zenoh routers` in the network.
### Logging

The core of Zenoh is implemented in Rust and uses a logging library that can be configured via a `RUST_LOG` environment variable.
This variable can be configured independently for each Node and the Zenoh router.
For instance:
- `RUST_LOG=zenoh=info` activates information logs about Zenoh initialization and the endpoints it's listening on.
- `RUST_LOG=zenoh=info,zenoh_transport=debug` adds some debug logs about the connectivity events in Zenoh.
- `RUST_LOG=zenoh=info,zenoh::net::routing::queries=trace` adds some trace logs for each query (i.e. calls to services and actions).
- `RUST_LOG=zenoh=debug` activates all the debug logs.

For more information on the `RUST_LOG` syntax, see https://docs.rs/env_logger/latest/env_logger/#enabling-logging.
7 changes: 4 additions & 3 deletions rmw_zenoh_cpp/src/detail/liveliness_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,10 @@ std::string zid_to_str(const z_id_t & id)
{
std::stringstream ss;
ss << std::hex;
size_t i = 0;
for (; i < (sizeof(id.id)); i++) {
ss << static_cast<int>(id.id[i]);
for (std::size_t i = 0; i < sizeof(id.id); i++) {
// By Zenoh convention a z_id_t is a little endian u128.
const std::size_t le_idx = sizeof(id.id) - 1 - i;
ss << static_cast<int>(id.id[le_idx]);
}
return ss.str();
}
Expand Down

0 comments on commit 329cc10

Please sign in to comment.