File tree Expand file tree Collapse file tree 5 files changed +776
-2
lines changed Expand file tree Collapse file tree 5 files changed +776
-2
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,11 @@ impl DynamicMessageMetadata {
257
257
let pkg = DynamicMessagePackage :: new ( package_name) ?;
258
258
pkg. message_metadata ( type_name)
259
259
}
260
+
261
+ /// Returns a description of the message structure.
262
+ pub fn structure ( & self ) -> & MessageStructure {
263
+ & self . structure
264
+ }
260
265
}
261
266
262
267
#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ edition = "2021"
8
8
path = " src/lib.rs"
9
9
10
10
[dependencies ]
11
- anyhow = {version = " 1" , features = [" backtrace" ]}
12
- test_msgs = {version = " *" }
11
+ test_msgs = " *"
13
12
14
13
[dependencies .rclrs ]
15
14
version = " *"
15
+ features = [" dyn_msg" ]
16
16
17
17
[dependencies .rosidl_runtime_rs ]
18
18
version = " *"
Original file line number Diff line number Diff line change
1
+ use std:: env;
2
+
3
+ const ROS_DISTRO : & str = "ROS_DISTRO" ;
4
+
5
+ fn get_env_var_or_abort ( env_var : & ' static str ) -> String {
6
+ if let Ok ( value) = env:: var ( env_var) {
7
+ value
8
+ } else {
9
+ panic ! (
10
+ "{} environment variable not set - please source ROS 2 installation first." ,
11
+ env_var
12
+ ) ;
13
+ }
14
+ }
15
+
16
+ fn main ( ) {
17
+ let ros_distro = get_env_var_or_abort ( ROS_DISTRO ) ;
18
+ println ! ( "cargo:rustc-cfg=ros_distro=\" {ros_distro}\" " ) ;
19
+ }
You can’t perform that action at this time.
0 commit comments