Connecting Xbox Controller to Simulink Real-Time

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 日

0 投票

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 日

0 投票

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.

カテゴリ

質問済み:

2024 年 7 月 25 日

回答済み:

2024 年 10 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by