File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -92,3 +92,15 @@ pub fn check_rmw_zenoh_available() -> bool {
9292 . map ( |status| status. success ( ) )
9393 . unwrap_or ( false )
9494}
95+
96+ /// Check if demo_nodes_cpp package is available
97+ #[ allow( dead_code) ]
98+ pub fn check_demo_nodes_cpp_available ( ) -> bool {
99+ Command :: new ( "ros2" )
100+ . args ( [ "pkg" , "prefix" , "demo_nodes_cpp" ] )
101+ . stdout ( Stdio :: null ( ) )
102+ . stderr ( Stdio :: null ( ) )
103+ . status ( )
104+ . map ( |status| status. success ( ) )
105+ . unwrap_or ( false )
106+ }
Original file line number Diff line number Diff line change @@ -150,6 +150,14 @@ fn test_ros2_server_ros_z_client() {
150150 panic ! ( "ros2 CLI not available" ) ;
151151 }
152152
153+ if !check_demo_nodes_cpp_available ( ) {
154+ panic ! (
155+ "demo_nodes_cpp package not found!\n \
156+ Please install it with: apt install ros-$ROS_DISTRO-demo-nodes-cpp\n \
157+ Or ensure ROS environment is sourced: source /opt/ros/$ROS_DISTRO/setup.bash"
158+ ) ;
159+ }
160+
153161 ensure_zenohd_running ( ) ;
154162
155163 println ! ( "\n === Test: ROS2 server <-> ros-z client ===" ) ;
You can’t perform that action at this time.
0 commit comments