Execute system command on device
system(device,command)
system(device,command,'sudo')
response = system(___)
example
system(device,command) runs a command in the Linux® command shell on the ROS device. This function does not allow you to run interactive commands.
device
command
system(device,command,'sudo') runs a command with superuser privileges.
response = system(___) runs a command using any of the previous syntaxes with the command shell output returned in response.
response
collapse all
Connect to a ROS device and run commands on the Linux(R) command shell.
Connect to a ROS device. Specify the device address, user name, and password of your ROS device.
d = rosdevice('192.168.17.128','user','password');
Run a command that lists the contents of the Catkin workspace folder.
system(d,'ls /home/user/catkin_ws_test')
ans = 'build devel src '
rosdevice
ROS device, specified as a rosdevice object.
Linux command, specified as a character vector.
Example: 'ls -al'
'ls -al'
Output from Linux shell, returned as a character vector.
deleteFile | dir | getFile | openShell | putFile | rosdevice
deleteFile
dir
getFile
openShell
putFile
You have a modified version of this example. Do you want to open this example with your edits?