Can I use readArUcoMarker in real-time with Simulink?
    13 views (last 30 days)
  
       Show older comments
    
I am trying to use the built-in readArucoMarker function within Simulink to estimate the pose of an object in real-time. However, I get the following error. Is there a way to implement this correctly? I am running MATLAB R2024a connected with a Quanser QArm with camera attached.


0 Comments
Accepted Answer
  Aravind
      
 on 13 Mar 2025
        From your question, it appears you are using MATLAB R2024a with a Quanser arm and are attempting to run Simulink for real-time control. When Simulink interfaces with Quanser, it generates code to create an executable that deploys the model for real-time control.
According to the documentation at https://www.mathworks.com/help/releases/R2024a/vision/ref/readarucomarker.html, the "readArucoMarker" function does not support code generation in MATLAB R2024a. Therefore, when you use this function in a "MATLAB Function" block and attempt to run it with the Quanser arm, Simulink tries to generate code for the block. Since "readArucoMarker" does not support code generation in R2024a, this leads to the error you encountered.
However, the "readArucoMarker" function supports code generation starting from MATLAB R2024b. This is indicated in the R2024b documentation: https://www.mathworks.com/help/vision/ref/readarucomarker.html. To resolve this issue, you can upgrade to MATLAB R2024b, where the "readArucoMarker" function has code generation support.
I hope this answers your question.
2 Comments
  Aravind
      
 on 14 Mar 2025
				The "readAprilTag" function supports code generation, but only for the host system, not for a target system. This is detailed in the documentation at https://www.mathworks.com/help/releases/R2024a/vision/ref/readapriltag.html#refsect-extended-capabilities. When using Simulink with Quanser, Simulink considers Quanser as a target system as the system target file is typically set to a tlc file provided by Quanser. This incompatibility can potentially lead to the error you are encountering.
As a workaround, you could implement the process of reading the April tag or the ArUco marker manually using MATLAB functions that support code generation for target systems as well. This approach should allow you to generate the necessary code without encountering errors.
More Answers (0)
See Also
Categories
				Find more on Simulink Coder in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!