zenoh: Default to 127.0.0.1 when using sitl/posix

Also improve error message when connection failed
This commit is contained in:
Peter van der Perk
2025-03-26 16:49:28 +01:00
committed by Beat Küng
parent a24b3a121c
commit 923257779a
3 changed files with 10 additions and 2 deletions
+5
View File
@@ -16,6 +16,11 @@ if MODULES_ZENOH
2: INFO + ERROR
3: DEBUG + INFO + ERROR
config ZENOH_DEFAULT_LOCATOR
string "Zenoh default mode"
default "tcp/127.0.0.1:7447" if PLATFORM_POSIX
default "" if !PLATFORM_POSIX
# Choose exactly one item
choice ZENOH_PUBSUB_SELECTION
prompt "Publishers/Subscribers selection"
+4 -1
View File
@@ -126,7 +126,10 @@ void ZENOH::run()
ret = z_open(&s, z_move(config), NULL);
if (ret < 0) {
if (ret == _Z_ERR_SCOUT_NO_RESULTS) {
if (ret == _Z_ERR_TRANSPORT_OPEN_FAILED) {
PX4_ERR("Unable to open session, make sure zenohd is running on %s", locator);
} else if (ret == _Z_ERR_SCOUT_NO_RESULTS) {
PX4_ERR("Unable to open session, scout no results");
} else {
+1 -1
View File
@@ -50,7 +50,7 @@
#include <uORB/topics/uORBTopics.hpp>
const char *default_net_config = Z_CONFIG_MODE_DEFAULT;
const char *default_net_config = Z_CONFIG_MODE_DEFAULT ";" CONFIG_ZENOH_DEFAULT_LOCATOR;
const char *default_pub_config = "";
const char *default_sub_config = ""; //TODO maybe use YAML