Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

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

1 visualización (últimos 30 días)
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 comentario
MathWorks Student Competitions Team
MathWorks Student Competitions Team el 5 de Sept. de 2014
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:

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by