running = isNodeRunning(device,modelName)
determines if the ROS or ROS 2 node associated with the
specified Simulink® model is running on the specified rosdevice or
ros2device,
device.
Connect to a remote ROS device and start a ROS node. Run a ROS core so that ROS nodes can communicate via a ROS network. You can run and stop a ROS core or node and check their status using a rosdevice object.
Create a connection to a ROS device. Specify the address, user name, and password of your specific ROS device. The device already contains the available ROS nodes that can be run using runNode.
d =
rosdevice with properties:
DeviceAddress: '192.168.203.129'
Username: 'user'
ROSFolder: '/opt/ros/indigo'
CatkinWorkspace: '~/catkin_ws_test'
AvailableNodes: {'robotcontroller' 'robotcontroller2'}
Run a ROS core. Connect MATLAB® to the ROS master using rosinit. This core enables you to run ROS nodes on your ROS device.
runCore(d)
rosinit(d.DeviceAddress,11311)
Initializing global node /matlab_global_node_84497 with NodeURI http://192.168.203.1:56034/
Check the available ROS nodes on the connected ROS device. These nodes listed were generated from Simulink® models following the process in the Get Started with ROS in Simulink example.
d.AvailableNodes
ans = 1×2 cell
{'robotcontroller'} {'robotcontroller2'}
Run a ROS node and specify the node name. Check if the node is running.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: United States.
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.