Skip to content

Commit a7b2b47

Browse files
committed
Improve project with rosbags, zenoh and remove old files
1 parent 0b3da85 commit a7b2b47

18 files changed

+578
-316
lines changed

config/rosbag_topics.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Aerostack2
2+
/drone0/actuator_command/twist
3+
/drone0/motion_reference/pose
4+
/drone0/self_localization/pose
5+
/drone0/self_localization/twist
6+
/drone0/sensor_measurements/battery
7+
/drone0/sensor_measurements/imu
8+
/rosout
9+
/tf
10+
/tf_static
11+

config/zenoh_config_drone.json5

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
////
2+
//// This file presents the default configuration used by both the `zenoh-plugin-ros2dds` plugin and the `zenoh-bridge-ros2dds` standalone executable.
3+
//// The "ros2" JSON5 object below can be used as such in the "plugins" part of a config file for the zenoh router (zenohd).
4+
////
5+
{
6+
plugins: {
7+
////
8+
//// ROS2 related configuration
9+
//// All settings are optional and are unset by default - uncomment the ones you want to set
10+
////
11+
ros2dds: {
12+
////
13+
//// nodename: A ROS node name to be used by this bridge.
14+
//// Default: "zenoh_bridge_ros2dds"
15+
////
16+
// nodename: "zenoh_bridge_ros2dds",
17+
18+
////
19+
//// namespace: A ROS namespace which:
20+
//// - is used for the "zenoh_bridge_ros2dds" node itself
21+
//// - is added to all discovered interfaces when routed to Zenoh
22+
//// (i.e. a "cmd_vel" topic in the robot will be seen as "namespace/cmd_vel" outside the robot)
23+
//// Note that this also applies to topics with absolute path such as "/rosout", "/tf" and "/tf_static".
24+
//// Default: "/"
25+
////
26+
// namespace: "/",
27+
28+
////
29+
//// domain: The DDS Domain ID. By default set to 0, or to "$ROS_DOMAIN_ID" is this environment variable is defined.
30+
////
31+
// domain: 0,
32+
33+
////
34+
//// ros_localhost_only: If set to true, the DDS discovery and traffic will occur only on the localhost interface (127.0.0.1).
35+
//// By default set to false, unless the "ROS_LOCALHOST_ONLY=1" environment variable is defined.
36+
////
37+
// ros_localhost_only: true,
38+
39+
////
40+
//// shm_enabled: If set to true, the DDS implementation will use Iceoryx shared memory.
41+
//// Requires the bridge to be built with the 'dds_shm' feature for this option to valid.
42+
//// By default set to false.
43+
////
44+
// shm_enabled: false,
45+
46+
////
47+
//// allow / deny: Specify the lists of ROS 2 interfaces that are allowed or denied to be routed over Zenoh.
48+
//// Each element of the lists is a regular expression that must match the full interface name.
49+
//// You cannot set both 'allow' and 'deny' in the same configuration.
50+
//// If neither 'allow' nor 'deny' are set, all interfaces are allowed.
51+
//// Use 'allow' to allow only the specified interfaces. If an interface type is set to an empty list
52+
//// or is not specified at all, it means that NO such interface is allowed.
53+
//// Use 'deny' to allow all except the specified interfaces. If an interface type is set to an empty list
54+
//// or is not specified at all, it means that ALL such interface are allowed.
55+
allow: {
56+
publishers: ["*/mission_status"],
57+
subscribers: ["*/mission_update"],
58+
// service_servers: [".*/.*_parameters"],
59+
// service_clients: [],
60+
// action_servers: [".*/rotate_absolute"],
61+
// action_clients: [],
62+
},
63+
// deny: {
64+
// publishers: ["/rosout", "/parameter_events"],
65+
// subscribers: ["/rosout"],
66+
// service_servers: [".*/set_parameters"],
67+
// service_clients: [".*/set_parameters"],
68+
// action_servers: [],
69+
// action_clients: [],
70+
// },
71+
72+
////
73+
//// pub_max_frequencies: Specify a list of maximum frequency of publications routing over zenoh for a set of Publishers.
74+
//// The strings must have the format "<regex>=<float>":
75+
//// - "regex" is a regular expression matching a Publisher interface name
76+
//// - "float" is the maximum frequency in Hertz;
77+
//// if publication rate is higher, downsampling will occur when routing.
78+
// pub_max_frequencies: ["/tf=10", "/tf_static=10", ".*/debug/ref_traj_point=10", ".*/self_localization/pose=10"],
79+
80+
////
81+
//// pub_priorities: Specify a list of priorities of publications routing over zenoh for a set of Publishers.
82+
//// In case of high traffic, the publications with higher priorities will overtake
83+
//// the publications with lower priorities in Zenoh publication queues.
84+
//// The strings must have the format "<regex>=<integer>[:express]":
85+
//// - "regex" is a regular expression matching a Publisher topic name
86+
//// - "integer" is a priority value in the range [1-7]. Highest priority is 1, lowest is 7 and default is 5.
87+
//// (see Zenoh Priority definition here: https://docs.rs/zenoh/latest/zenoh/publication/enum.Priority.html)
88+
//// - ":express" is an option to indicate that the Zenoh express policy must be used for those publications.
89+
//// The express policy makes Zenoh to to send the message immediatly, not waiting for possible further messages
90+
//// to create a bigger batch of messages. This usually has a positive impact on latency for the topic
91+
//// but a negative impact on the general throughput, as more overhead is used for those topics.
92+
// pub_priorities: ["/scan=1:express", "/pose=2", "/rosout=7"],
93+
94+
////
95+
//// reliable_routes_blocking: When true, the publications from a RELIABLE DDS Writer will be
96+
//// routed to zenoh using the CongestionControl::Block option.
97+
//// Meaning the routing will be blocked in case of network congestion,
98+
//// blocking the DDS Reader and the RELIABLE DDS Writer in return.
99+
//// When false (or for BERST_EFFORT DDS Writers), CongestionControl::Drop
100+
//// is used, meaning the route might drop some data in case of congestion.
101+
////
102+
// reliable_routes_blocking: true,
103+
104+
////
105+
//// queries_timeout: Timeouts configuration for various Zenoh queries.
106+
//// Each field is optional. If not set, the 'default' timeout (5.0 seconds by default) applies to all queries.
107+
//// Each value can be either a float in seconds that will apply as a timeout to all queries,
108+
//// either a list of strings with format "<regex>=<float>" where:
109+
//// - "regex" is a regular expression matching an interface name
110+
//// - "float" is the timeout in seconds
111+
// queries_timeout: {
112+
// //// default timeout that will apply to all query, except the ones specified below
113+
// //// in 'transient_local_subscribers', 'services' and 'actions'
114+
// default: 5.0,
115+
// //// timeouts for TRANSIENT_LOCAL subscriber when querying publishers for historical publications
116+
// transient_local_subscribers: 1.0,
117+
// //// timeouts for Service clients calling a Service server
118+
// services: ["add_two_ints=0.5", ".*=1.0"],
119+
// //// timeouts for Action clients calling an Action server (send_goal, cancel_goal and get_result services)
120+
// actions: {
121+
// send_goal: 1.0,
122+
// cancel_goal: 1.0,
123+
// get_result: [".*long_mission=3600", ".*short_action=10.0"],
124+
// }
125+
// },
126+
127+
////
128+
//// This plugin uses Tokio (https://tokio.rs/) for asynchronous programming.
129+
//// When running as a plugin within a Zenoh router, the plugin creates its own Runtime managing 2 pools of threads:
130+
//// - worker threads for non-blocking tasks. Those threads are spawn at Runtime creation.
131+
//// - blocking threads for blocking tasks (e.g. I/O). Those threads are spawn when needed.
132+
//// For more details see https://github.com/tokio-rs/tokio/discussions/3858#discussioncomment-869878
133+
//// When running as a standalone bridge the Zenoh Session's Runtime is used and can be configured via the
134+
//// `ZENOH_RUNTIME` environment variable. See https://docs.rs/zenoh-runtime/latest/zenoh_runtime/enum.ZRuntime.html
135+
////
136+
137+
//// work_thread_num: The number of worker thread in the asynchronous runtime will use. (default: 2)
138+
//// Only for a plugin, no effect on a bridge.
139+
// work_thread_num: 2,
140+
141+
//// max_block_thread_num: The number of blocking thread in the asynchronous runtime will use. (default: 50)
142+
//// Only for a plugin, no effect on a bridge.
143+
// max_block_thread_num: 50,
144+
},
145+
146+
////
147+
//// REST API configuration (active only if this part is defined)
148+
////
149+
// rest: {
150+
// ////
151+
// //// The HTTP port number (for all network interfaces).
152+
// //// You can bind on a specific interface setting a "<local_ip>:<port>" string.
153+
// ////
154+
// http_port: 8000,
155+
// },
156+
},
157+
158+
////
159+
//// Zenoh related configuration.
160+
//// Only the most relevant sections are displayed here.
161+
//// For a complete view of configuration possibilities, see https://github.com/eclipse-zenoh/zenoh/blob/main/DEFAULT_CONFIG.json5
162+
////
163+
164+
/// The identifier (as unsigned 128bit integer in hexadecimal lowercase - leading zeros are not accepted)
165+
/// that zenoh runtime will use.
166+
/// If not set, a random unsigned 128bit integer will be used.
167+
/// WARNING: this id must be unique in your zenoh network.
168+
// id: "1234567890abcdef",
169+
170+
////
171+
//// mode: The bridge's mode (router, peer or client)
172+
////
173+
//mode: "router",
174+
175+
////
176+
//// Which endpoints to connect to. E.g. tcp/localhost:7447.
177+
//// By configuring the endpoints, it is possible to tell zenoh which remote router or other zenoh-bridge-ros2dds to connect to at startup.
178+
////
179+
connect: {
180+
endpoints: [
181+
// "<proto>/<ip>:<port>"
182+
]
183+
},
184+
185+
////
186+
//// Which endpoints to listen on.
187+
//// By configuring the endpoints, it is possible to tell zenoh which are the endpoints that other routers,
188+
//// peers, or client can use to establish a zenoh session.
189+
//// In 'router' mode (default) the zenoh-bridge-ros2dds is listening by default on `tcp/0.0.0.0:7447` (`0.0.0.0` meaning all the available network interfaces)
190+
////
191+
// listen: {
192+
// endpoints: [
193+
// // "<proto>/<ip>:<port>"
194+
// ]
195+
//},
196+
197+
////
198+
//// Configure the scouting mechanisms and their behaviours
199+
////
200+
//scouting: {
201+
// /// The UDP multicast scouting configuration.
202+
// multicast: {
203+
// /// Whether multicast scouting is enabled or not
204+
// enabled: true,
205+
// /// The socket which should be used for multicast scouting
206+
// address: "224.0.0.224:7446",
207+
// /// The network interface which should be used for multicast scouting
208+
// interface: "auto", // If not set or set to "auto" the interface if picked automatically
209+
// /// Which type of Zenoh instances to automatically establish sessions with upon discovery on UDP multicast.
210+
// /// Accepts a single value or different values for router, peer and client.
211+
// /// Each value is an array containing values "peer", "router" and "client".
212+
// autoconnect: { router: [], peer: ["router","peer"] },
213+
// /// Whether or not to listen for scout messages on UDP multicast and reply to them.
214+
// listen: true,
215+
// },
216+
// /// The gossip scouting configuration.
217+
// gossip: {
218+
// /// Whether gossip scouting is enabled or not
219+
// enabled: true,
220+
// /// When true, gossip scouting information is propagated multiple hops to all nodes in the local network.
221+
// /// When false, gossip scouting information is only propagated to the next hop.
222+
// /// Activating multihop gossip implies more scouting traffic and a lower scalability.
223+
// /// It mostly makes sense when using "linkstate" routing mode where all nodes in the subsystem don't have
224+
// /// direct connectivity with each other.
225+
// multihop: false,
226+
// /// Which type of Zenoh instances to automatically establish sessions with upon discovery on gossip.
227+
// /// Accepts a single value or different values for router, peer and client.
228+
// /// Each value is an array containing values "peer", "router" and "client".
229+
// autoconnect: { router: [], peer: ["router","peer"] },
230+
// },
231+
//},
232+
233+
}

0 commit comments

Comments
 (0)