Connecting Xbox Controller to Simulink Real-Time

조회 수: 30 (최근 30일)
Ethan
Ethan 2024년 7월 25일
답변: Diego Kuratli 2024년 10월 16일
Hi,
Im trying to add a xbox controller to my simulink Real-Time. However the only blocks I could find and use only work for normal simulink. I tried using Gamepad Simulator block and the Joystick Input block and I tested and worked only for normal Simulink. When I try to use them in Simulink Real-Time, it doesnt take the values. When I use the the JoyStick input block in simulink real-time, it gives me an error and says "Error:Unable to find S-function module 'joyinput'. S-function modules must exist as either source files or pre-compiled object files on the MATLAB path.".
Is there a way to get around this?
Thanks

답변 (2개)

Ayush
Ayush 2024년 7월 31일
편집: Ayush 2024년 7월 31일
Hello Ethan,
It seems that the error that you are getting is because the "Joystick Input" block was not able to create an S-function module properly which is crucial for Simulink Real-time applications. You can try re-building the application to check if the S-function module associated with the block is fixed or you can also try leveraging the following community file exchange that might suit your use case:
Additionally, you can also check out the documentation for "Gamepad Joystick" block for an alternative:
Hope it helps!

Diego Kuratli
Diego Kuratli 2024년 10월 16일
The gamepad and joystick blocks are not supported with Simulink Real-Time.
As a workaround, you could have a model running on the host computer with the Joystick Input block from Simulink 3D Animation, and sending the data via UDP to the Speedgoat real-time target computer. I.e., the joystick is connected to the host computer and send the data to the target computer via the host-target communication link. Here is an example of similar setup with host and target models exchanging data via UDP.

카테고리

Help CenterFile Exchange에서 Target Computer Setup에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by