Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 1 (최근 30일)
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
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:

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by