Difference between revisions of "Matlab rest"

From RobotinoWiki
(Introduction)
(Example)
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
|This page describes how to access Robotino's sensors and actors from Matlab by making use of Robotino's [[Rest_api|REST-API]].
 
|This page describes how to access Robotino's sensors and actors from Matlab by making use of Robotino's [[Rest_api|REST-API]].
 
|}
 
|}
 +
==Installation==
 +
You do not need to install anything. See the examples below. But you might want to use the m-files from our [https://doc.openrobotino.org/download/RobotinoMatlab/REST/ REST-Toolbox].
 
==Example==
 
==Example==
 
<pre>
 
<pre>
Line 12: Line 14:
 
//Drive Robotino forward with 1m/s
 
//Drive Robotino forward with 1m/s
 
webwrite('http://192.168.0.1/data/omnidrive',[1 0 0])
 
webwrite('http://192.168.0.1/data/omnidrive',[1 0 0])
 +
 +
//Get image from Robotino's camera
 +
img=webread('http://192.168.0.1/cam0')
 +
imshow(img)
 
</pre>
 
</pre>

Revision as of 13:18, 18 March 2019

Introduction

Robotino matlab icon 64.png This page describes how to access Robotino's sensors and actors from Matlab by making use of Robotino's REST-API.

Installation

You do not need to install anything. See the examples below. But you might want to use the m-files from our REST-Toolbox.

Example

//Read the value of Robotino's bumper
webread('http://192.168.0.1/data/bumper')

//Drive Robotino forward with 1m/s
webwrite('http://192.168.0.1/data/omnidrive',[1 0 0])

//Get image from Robotino's camera
img=webread('http://192.168.0.1/cam0')
imshow(img)