Info

This question is closed. Reopen it to edit or answer.

Are there any demos which show how to deploy MATLAB or Simulink to a PC for robotics?

1 view (last 30 days)
I have a mobile robotics system that I am looking to control using a PC running MATLAB or Simulink. How can I do this? Are there any code examples showing how to do so?
-
What I would like to do:
  • Run MATLAB/Simulink on the PC in soft real-time
  • Acquire video from a USB camera at a specified rate (i.e. 10 fps)
  • Communicate using Serial/UDP/TCPIP to other hardware (i.e. micro-controllers, micro-computers, LIDAR)
  1 Comment
MathWorks Student Competitions Team
The MathWorks File Exchange entry called " Getting Started AUVSI " has examples showing how to run MATLAB and Simulink on a PC in soft real-time.
  • In MATLAB, you would use timer objects which execute callback functions at user specified rates.
  • In Simulink, the "Real-Time Synchronization" in Windows with Real-Time Windows Target will make Simulink models run in soft real-time.
To acquire video from a USB camera, use the Image Acquisition Toolbox's imaq.VideoDevice method in MATLAB and the "From Video Device" block in Simulink.
vidobj = imaq.VideoDevice('winvideo', 1);
function mytimercallback(~,~)
frame = step(vidobj);
// perform image processing on frame
end
-
To communicate using Serial/UDP/TCPIP to other hardware, you can use the Instrument Control Toolbox's communication methods and blocks.
s = serial('COM26'); // initialize serial object buffer
fread(s,1); // read 1 byte from the serial port buffer
fwrite(s,22); // transmit 1 byte, 22, to the serial port
-
For more information, feel free to reply to this post or take a look at the following resources:

Answers (0)

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!