Can I use simulink to control a robot in Webbots 2019a? - matlab

I have made a robot in webots 2019a and it can run with c controller. But if I want control the robot in simulink, how to do it? I can't find any Tutorials from Official document.

The first option is to take a look at the MATLAB support: https://cyberbotics.com/doc/guide/using-matlab
Moreover, an alternative option might be using the ROS Webots controller and the ROS support of Simulink.
Another option is to use a messaging library such as ZeroMQ, for example, to send the data from Simulink to the Webots. This blog article outlines the procedure: https://blogs.mathworks.com/simulink/2018/05/01/communicating-with-an-external-application-for-co-simulation/

Related

How do I implement matlab code on hardware device to make it run?

My question is quite basic to most appropriate levels on consideration. I lack the perception of how can I dump or implement my matlab code on a hardware component like processors or fpga? For eg:
Suppose I create an image processing matlab (object classification/detection) code which needs to detect real time images from drone and identify whether object is human or animal while its one air through the vision of camera, how shall I proceed to implement this matlab code onto a processor or controller and make it run while the drone is on air?
For consideration, take the matlab code is in its raw form for processing any input data and put out an output classified data. What should I do next? Do I need to convert the matlab code to any hdl or .exe format to run it across the hardware platform or is it possible to implement matlab code(.m format) directly into a device for processing and classification. Basically I am not getting how to practically use matlab code and put it into a system. Do I need to use some sort of toolbox or extension code ?
Could you please list down the steps for this process or share some link of website or youtube videos where it has been shown in detail how to harbour this mechanism.
You could use MATLAB Coder to convert your MATLAB code to an executable that can run on your hardware.
Here are a couple of articles from the official MathWorks documentation regarding Code Generation for Image Processing to get you started:
https://www.mathworks.com/help/images/code-generation-for-image-processing.html
https://www.mathworks.com/help/images/code-generation-with-cell-detection.html

How to connect an external sensor to Zynq-7000 module?

I'm currently working on a project to be implemented on a Xilinx Zedboard, using Simulink Embedded Coder methodology.
i need to interface an analog sensor (Electret Microphone) with the Zynq,i know that the XADC need to be instanciated in the PL then linked to the PS with the AXI, the DATA will be in the SDRAM that i need in my algorithm, but i don't know how to do it actually.
Thank you
Sami, there are many things you have to do. Instantiation of XADC is the first one. Then, you need to instantiate DMA and connect it properly in the FPGA part. Then, you have to write driver for DMA initialization. These isues are described (but not solved anyway) also e.g. here. After these steps you can use Simulink Embedded Coder methodology.
Check at the PDF with the link, section: 2.5.1 I/O Peripheral (IOP) Interface Routing
http://www.xilinx.com/support/documentation/user_guides/ug585-Zynq-7000-TRM.pdf
Good luck.

WSN Packages in Matlab

I want to simulate my protocol in Matlab. I do not know about any toolbox nor i get any information about WSN coding in Matlab.
I want to know about it.
regards,
You can use Low Energy Adaptive Clustering Hierarchy (LEACH) cluster based routing protocol in WSN:
http://www.mathworks.com/matlabcentral/fileexchange/25853-wireless-networks
And you can write your own simulator using the MATLAB scripting language. Examples:
SimEvents, Prowler, TrueTime and Complex Networks Package
Hope this helps.

MATLAB code for object detection using a webcam?

I am using an Arduino to control a car and I want to make it autonomous by using a webcam to see the object I want and make the car move to this location. I need several things:
MATLAB code
Interface between MATLAB and Arduino
How do I connect between them (software, not hardware)
I need any tutorial to learn or any instructions to make my project. I see many people have done this before, but unfortunately they did not mention how to start these kind of projects.
This question is fairly broad, so I apologize in advance for my somewhat general response.
The easiest way to interface a webcam with MATLAB is to make use of the Image Acquisition Toolbox. This link provides documentation detailing how to do this.
There is a good chance that you'll also want to make use of the Image Processing toolbox in MATLAB to be able to process the acquired images to determine where to go. See this doc. Though, after you've determined more specifically how you plan to process these images, there are probably numerous algorithms that you could find online that would not explicitly require this toolbox.
As far as interfacing with Arduino is concerned, there is a support package from the MathWorks that allows you to interface MATLAB code and Simulink models with Arduino. See this link
The only other general suggestion that I have is to consider using Simulink for this project rather than MATLAB. I feel that the model based approach of Simulink is a much better fit when designing control systems.
I hope that this helps you get things started.

TMS320C64x Quick start reference for programmers

Is thare any quickstart guide for programmers for writing DSP-accelerated appliations for TMS320C64x?
I have a program with custom algorythm (not the fft, or usial filtering) and I want to accelerate it using multi-DSP coprocessor. So, how should I modify source to move computation from main CPU to DSPs? What limitations are there for DSP-running code?
I have some experience with CUDA. In CUDA I should mark every function as being host, device, or entry point for device (kernel). There are also functions to start kernels and to upload/download data to/from GPU. There are also some limitations, for device code, described in CUDA Reference manual. I hope, there is an similar interface and a documentation for DSP.
Please consider doing a search "TMS320C64x programmer's guide" - here is what I think is the most appropriate link
focus.ti.com/lit/ug/spru565b/spru565b.pdf
Also check this book - to help you get started (uses the previous generation)
Embedded image processing on the TMS320C6000 DSP : examples in code composer studio and MATLAB