Main Content

isServerAvailable

Determine if ROS or ROS 2 service server is available

Since R2021b

Description

status = isServerAvailable(client) determines whether a service server with the same service name as client is available and returns a status accordingly.

example

Examples

collapse all

Connect to a ROS network.

rosinit
Launching ROS Core...
Status before launching ros core :0
result before launching ros core:     887 ?        Ssl   17:13 /usr/bin/python3 /usr/bin/mta-sts-daemon --config /etc/mta-sts-daemon.yml
   1157 ?        Ssl    0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
 568896 ?        Ss     0:00 /bin/sh /usr/bin/xvfb-run -a -s -screen 0 1280x1024x24 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568926 ?        S      0:00 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568927 ?        S      0:00 sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568960 ?        S      0:00 perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 570388 ?        Sl     0:00 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/bin/glnxa64/libmwros2server -mvmInputPipe 599 -1 -mvmOutputPipe -1 607
 571705 pts/3    S+     0:00 /bin/bash -c ps ax | grep -E 'ros|python'
 571707 pts/3    S+     0:00 grep -E ros|python

Done in 0.50876 seconds.
* Inside getProcessPID function *
Process Name: /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/bin/glnxa64 rosmaster --core -p 52835 -w 3
Status before getting PID :0
Result before getting PID :    887 ?        Ssl   17:13 /usr/bin/python3 /usr/bin/mta-sts-daemon --config /etc/mta-sts-daemon.yml
   1157 ?        Ssl    0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
 568896 ?        Ss     0:00 /bin/sh /usr/bin/xvfb-run -a -s -screen 0 1280x1024x24 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568926 ?        S      0:00 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568927 ?        S      0:00 sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568960 ?        S      0:00 perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 570388 ?        Sl     0:00 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/bin/glnxa64/libmwros2server -mvmInputPipe 599 -1 -mvmOutputPipe -1 607
 571710 pts/3    S      0:00 bash /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/mlroscpp/util/+ros/+internal/runroscmd.sh   /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1 /tmp/Bdoc25a_2974004_1596510/tp7ae2b024_15d5_467a_9010_85ca063d2592/ros1/glnxa64/venv /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/bin/glnxa64 rosmaster --core -p 52835 -w 3
 571722 pts/3    Sl     0:00 python3 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1/bin/rosmaster --core -p 52835 -w 3
 571730 pts/3    S+     0:00 /bin/bash -c ps ax | grep -E 'ros|python'
 571732 pts/3    S+     0:00 grep -E ros|python

Result:  571710 pts/3    S      0:00 bash /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/mlroscpp/util/+ros/+internal/runroscmd.sh   /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1 /tmp/Bdoc25a_2974004_1596510/tp7ae2b024_15d5_467a_9010_85ca063d2592/ros1/glnxa64/venv /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/bin/glnxa64 rosmaster --core -p 52835 -w 3

Status: 0
PID obtained: 571710
Status after getting PID :0
Result after getting PID :    887 ?        Ssl   17:13 /usr/bin/python3 /usr/bin/mta-sts-daemon --config /etc/mta-sts-daemon.yml
   1157 ?        Ssl    0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
 568896 ?        Ss     0:00 /bin/sh /usr/bin/xvfb-run -a -s -screen 0 1280x1024x24 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568926 ?        S      0:00 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568927 ?        S      0:00 sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568960 ?        S      0:00 perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 570388 ?        Sl     0:00 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/bin/glnxa64/libmwros2server -mvmInputPipe 599 -1 -mvmOutputPipe -1 607
 571710 pts/3    S      0:00 bash /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/mlroscpp/util/+ros/+internal/runroscmd.sh   /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1 /tmp/Bdoc25a_2974004_1596510/tp7ae2b024_15d5_467a_9010_85ca063d2592/ros1/glnxa64/venv /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/bin/glnxa64 rosmaster --core -p 52835 -w 3
 571722 pts/3    Sl     0:00 python3 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1/bin/rosmaster --core -p 52835 -w 3
 571737 pts/3    S+     0:00 /bin/bash -c ps ax | grep -E 'ros|python'
 571739 pts/3    S+     0:00 grep -E ros|python

* Exiting getProcessPID function *
Status after launching ros core :0
result after launching ros core:     887 ?        Ssl   17:13 /usr/bin/python3 /usr/bin/mta-sts-daemon --config /etc/mta-sts-daemon.yml
   1157 ?        Ssl    0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
 568896 ?        Ss     0:00 /bin/sh /usr/bin/xvfb-run -a -s -screen 0 1280x1024x24 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568926 ?        S      0:00 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568927 ?        S      0:00 sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568960 ?        S      0:00 perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 570388 ?        Sl     0:00 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/bin/glnxa64/libmwros2server -mvmInputPipe 599 -1 -mvmOutputPipe -1 607
 571710 pts/3    S      0:00 bash /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/mlroscpp/util/+ros/+internal/runroscmd.sh   /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1 /tmp/Bdoc25a_2974004_1596510/tp7ae2b024_15d5_467a_9010_85ca063d2592/ros1/glnxa64/venv /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/bin/glnxa64 rosmaster --core -p 52835 -w 3
 571722 pts/3    Sl     0:00 python3 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1/bin/rosmaster --core -p 52835 -w 3
 571740 pts/3    S+     0:00 /bin/bash -c ps ax | grep -E 'ros|python'
 571742 pts/3    S+     0:00 grep -E ros|python

Status before deleting node :0
Result before deleting node :    887 ?        Ssl   17:13 /usr/bin/python3 /usr/bin/mta-sts-daemon --config /etc/mta-sts-daemon.yml
   1157 ?        Ssl    0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
 568896 ?        Ss     0:00 /bin/sh /usr/bin/xvfb-run -a -s -screen 0 1280x1024x24 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568926 ?        S      0:00 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568927 ?        S      0:00 sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568960 ?        S      0:00 perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 570388 ?        Sl     0:00 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/bin/glnxa64/libmwros2server -mvmInputPipe 599 -1 -mvmOutputPipe -1 607
 571710 pts/3    S      0:00 bash /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/mlroscpp/util/+ros/+internal/runroscmd.sh   /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1 /tmp/Bdoc25a_2974004_1596510/tp7ae2b024_15d5_467a_9010_85ca063d2592/ros1/glnxa64/venv /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/bin/glnxa64 rosmaster --core -p 52835 -w 3
 571722 pts/3    Sl     0:00 python3 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1/bin/rosmaster --core -p 52835 -w 3
 571743 ?        Sl     0:00 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/bin/glnxa64/libmwros1server -mvmInputPipe 597 -1 -mvmOutputPipe -1 609
 571758 pts/3    S+     0:00 /bin/bash -c ps ax | grep -E 'ros|python'
 571760 pts/3    S+     0:00 grep -E ros|python

Status after deleting node :0
Result after deleting node :    887 ?        Ssl   17:13 /usr/bin/python3 /usr/bin/mta-sts-daemon --config /etc/mta-sts-daemon.yml
   1157 ?        Ssl    0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
 568896 ?        Ss     0:00 /bin/sh /usr/bin/xvfb-run -a -s -screen 0 1280x1024x24 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568926 ?        S      0:00 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568927 ?        S      0:00 sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568960 ?        S      0:00 perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 570388 ?        Sl     0:00 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/bin/glnxa64/libmwros2server -mvmInputPipe 599 -1 -mvmOutputPipe -1 607
 571710 pts/3    S      0:00 bash /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/mlroscpp/util/+ros/+internal/runroscmd.sh   /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1 /tmp/Bdoc25a_2974004_1596510/tp7ae2b024_15d5_467a_9010_85ca063d2592/ros1/glnxa64/venv /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/bin/glnxa64 rosmaster --core -p 52835 -w 3
 571722 pts/3    Sl     0:00 python3 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1/bin/rosmaster --core -p 52835 -w 3
 571764 pts/3    S+     0:00 /bin/bash -c ps ax | grep -E 'ros|python'
 571766 pts/3    S+     0:00 grep -E ros|python

Initializing ROS master on http://172.20.144.70:52835.
Initializing global node /matlab_global_node_24859 with NodeURI http://dcc959649glnxa64:37427/ and MasterURI http://localhost:52835.

Set up a service server. Use structures for the ROS message data format.

server = rossvcserver('/test', 'std_srvs/Empty', @exampleHelperROSEmptyCallback,...
                      'DataFormat','struct');
client = rossvcclient('/test','DataFormat','struct');

Check whether the service server is available. If it is, wait for the service client to connect to the server.

if(isServerAvailable(client))
    [connectionStatus,connectionStatustext] = waitForServer(client)
end
connectionStatus = logical
   1

connectionStatustext = 
'success'

Call service server with default message.

response = call(client)
response = struct with fields:
    MessageType: 'std_srvs/EmptyResponse'

If the call function above fails, it results in an error. Instead of an error, if you would prefer to react to a call failure using conditionals, return the status and statustext outputs from the call function. The status output indicates if the call succeeded, while statustext provides additional information.

numCallFailures = 0;
[response,status,statustext] = call(client,"Timeout",3);
if ~status
    numCallFailures = numCallFailues + 1;
    fprintf("Call failure number %d. Error cause: %s\n",numCallFailures,statustext)
else
    disp(response)
end
    MessageType: 'std_srvs/EmptyResponse'

Shut down the ROS network.

rosshutdown
Shutting down global node /matlab_global_node_24859 with NodeURI http://dcc959649glnxa64:37427/ and MasterURI http://localhost:52835.
Status before deleting node :0
Result before deleting node :    887 ?        Ssl   17:13 /usr/bin/python3 /usr/bin/mta-sts-daemon --config /etc/mta-sts-daemon.yml
   1157 ?        Ssl    0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
 568896 ?        Ss     0:00 /bin/sh /usr/bin/xvfb-run -a -s -screen 0 1280x1024x24 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568926 ?        S      0:00 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568927 ?        S      0:00 sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568960 ?        S      0:00 perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 570388 ?        Sl     0:00 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/bin/glnxa64/libmwros2server -mvmInputPipe 599 -1 -mvmOutputPipe -1 607
 571710 pts/3    S      0:00 bash /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/mlroscpp/util/+ros/+internal/runroscmd.sh   /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1 /tmp/Bdoc25a_2974004_1596510/tp7ae2b024_15d5_467a_9010_85ca063d2592/ros1/glnxa64/venv /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/bin/glnxa64 rosmaster --core -p 52835 -w 3
 571722 pts/3    Sl     0:00 python3 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1/bin/rosmaster --core -p 52835 -w 3
 571767 ?        Sl     0:00 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/bin/glnxa64/libmwros1server -mvmInputPipe 597 -1 -mvmOutputPipe -1 609
 571811 pts/3    S+     0:00 /bin/bash -c ps ax | grep -E 'ros|python'
 571813 pts/3    S+     0:00 grep -E ros|python

Status after deleting node :0
Result after deleting node :    887 ?        Ssl   17:13 /usr/bin/python3 /usr/bin/mta-sts-daemon --config /etc/mta-sts-daemon.yml
   1157 ?        Ssl    0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
 568896 ?        Ss     0:00 /bin/sh /usr/bin/xvfb-run -a -s -screen 0 1280x1024x24 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568926 ?        S      0:00 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568927 ?        S      0:00 sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568960 ?        S      0:00 perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 570388 ?        Sl     0:00 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/bin/glnxa64/libmwros2server -mvmInputPipe 599 -1 -mvmOutputPipe -1 607
 571710 pts/3    S      0:00 bash /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/mlroscpp/util/+ros/+internal/runroscmd.sh   /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1 /tmp/Bdoc25a_2974004_1596510/tp7ae2b024_15d5_467a_9010_85ca063d2592/ros1/glnxa64/venv /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/bin/glnxa64 rosmaster --core -p 52835 -w 3
 571722 pts/3    Sl     0:00 python3 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1/bin/rosmaster --core -p 52835 -w 3
 571818 pts/3    S+     0:00 /bin/bash -c ps ax | grep -E 'ros|python'
 571820 pts/3    S+     0:00 grep -E ros|python

Shutting down ROS master on http://172.20.144.70:52835.
Status before deleting core :0
Result before deleting core :    887 ?        Ssl   17:13 /usr/bin/python3 /usr/bin/mta-sts-daemon --config /etc/mta-sts-daemon.yml
   1157 ?        Ssl    0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
 568896 ?        Ss     0:00 /bin/sh /usr/bin/xvfb-run -a -s -screen 0 1280x1024x24 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568926 ?        S      0:00 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568927 ?        S      0:00 sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568960 ?        S      0:00 perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 570388 ?        Sl     0:00 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/bin/glnxa64/libmwros2server -mvmInputPipe 599 -1 -mvmOutputPipe -1 607
 571710 pts/3    S      0:00 bash /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/mlroscpp/util/+ros/+internal/runroscmd.sh   /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1 /tmp/Bdoc25a_2974004_1596510/tp7ae2b024_15d5_467a_9010_85ca063d2592/ros1/glnxa64/venv /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/bin/glnxa64 rosmaster --core -p 52835 -w 3
 571722 pts/3    Sl     0:00 python3 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/sys/ros1/glnxa64/ros1/bin/rosmaster --core -p 52835 -w 3
 571821 pts/3    S+     0:00 /bin/bash -c ps ax | grep -E 'ros|python'
 571823 pts/3    S+     0:00 grep -E ros|python

* Inside killProcessByPID function *
PID of core to be killed: 571710
Status after Child Process Killed: 0
Result after Child Process Killed: 
Status after deleting core :0
Result after deleting core :    887 ?        Ssl   17:13 /usr/bin/python3 /usr/bin/mta-sts-daemon --config /etc/mta-sts-daemon.yml
   1157 ?        Ssl    0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
 568896 ?        Ss     0:00 /bin/sh /usr/bin/xvfb-run -a -s -screen 0 1280x1024x24 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568926 ?        S      0:00 /bin/sh -c export TMPDIR=/tmp/Bdoc25a_2974004_1596510 COMPONENT=examples/ros ;   cd /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/matlab/examples/ros ; //mathworks/hub/bat/common/bin/mw   sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568927 ?        S      0:00 sh ../../tools/build_using_mlpath/mlenv --use-scoped-paths 1 --scoped-cppms-file /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c/scoped_cppms_modules.txt --scoped-cppms-envvar MW_SCOPED_CPPMICROSERVICES_MODULES --tag bml --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --paths /mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MATLAB_LOG_DIR=/mathworks/devel/bat/Bdoc25a/logs/2974004/build.glnxa64.2974004.r000/examples/ros/build.glnxa64.2974004.r000.bml.1b2cf5d6e3975ccf240066d07cb1ec5c MAKEFLAGS= DISPLAY=:0 MESA_BACK_BUFFER=Pixmap perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 568960 ?        S      0:00 perl ../../tools/build_using_matlab/mlrun --verbose --runnable /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab --display mwtools.liveCodeToDocbook ../../derived/glnxa64/examples/ros/mlx_to_docbook1.txt ../../derived/glnxa64/examples/ros examples/ros ../../help/examples/ros/glnxa64 //mathworks/hub/3rdparty/R2021a/6299939/glnxa64/pngquant 1
 570388 ?        Sl     0:00 /mathworks/devel/bat/filer/batfs2566-0/Bdoc25a.2974004/build/runnable/matlab/toolbox/ros/bin/glnxa64/libmwros2server -mvmInputPipe 599 -1 -mvmOutputPipe -1 607
 571828 pts/3    S+     0:00 /bin/bash -c ps ax | grep -E 'ros|python'
 571830 pts/3    S+     0:00 grep -E ros|python

* Exiting killProcessByPID function *

Create a sample ROS 2 network with two nodes.

node_1 = ros2node('node_1_service_server');
node_2 = ros2node('node_2_service_client');

Set up a service server and attach it to a ROS 2 node. Specify the callback function flipstring, which flips the input string. The callback function is defined at the end of this example.

server = ros2svcserver(node_1,'/test','test_msgs/BasicTypes',@flipString);

Set up a service client of the same service type and attach it to a different node.

client = ros2svcclient(node_2,'/test','test_msgs/BasicTypes');

Wait for the service client to connect to the server.

[connectionStatus,connectionStatustext] = waitForServer(client)
connectionStatus = logical
   1

connectionStatustext = 
'success'

Create a request message based on the client. Assign the string to the corresponding field in the message, string_value.

request = ros2message(client);
request.string_value = 'hello world';

Check whether the service server is available. If it is, send a service request and wait for a response. Specify that the service waits 3 seconds for a response.

if(isServerAvailable(client))
    response = call(client,request,'Timeout',3);
end

The response is a flipped string from the request message which you see in the string_value field.

response.string_value
ans = 
'dlrow olleh'

If the call function above fails, it results in an error. Instead of an error, if you would prefer to react to a call failure using conditionals, return the status and statustext outputs from the call function. The status output indicates if the call succeeded, while statustext provides additional information.

numCallFailures = 0;
[response,status,statustext] = call(client,request,"Timeout",3);
if ~status
    numCallFailures = numCallFailues + 1;
    fprintf("Call failure number %d. Error cause: %s\n",numCallFailures,statustext)
else
    disp(response.string_value)
end
dlrow olleh

The callback function used to flip the string is defined below.

function resp = flipString(req,resp)
% FLIPSTRING Reverses the order of a string in REQ and returns it in RESP.
resp.string_value = fliplr(req.string_value);
end

Input Arguments

collapse all

ROS or ROS 2 service client, specified as a ros.ServiceClient or ros2serviceclient object handle, respectively. This service client enables you to send requests to the service server.

Output Arguments

collapse all

Status of service server availability, returned as a logical scalar. If a server of the same name and type as client is not available, status will be false.

Extended Capabilities

expand all

Version History

Introduced in R2021b