Interaction XBOX Controller with Simulink Model - simulink

I'm working in a project where i have to control a Robot (I have it already as a Simulink Model) with an XBOX Controller.
Until now I couldn't find a good Example or a good Idea to let these two interact.
I want to change some variables (INPUTs) with the buttons of the XBOX Controller and then get a feedback (Example: a vibration feedback) (OUTPUT).
Is it possible to do that with ROS and Simulink ? So that i can work with ros_joy, and then implement it in my Simulink model ?
It'll be very helpful when i get some advises here.
Thanks a lot.

I can't test this, but I know from ubuntu <= 16 that jstest and jstest-gtk (the nicer gui interface) can be installed via apt, to check & configure any joysticks/gamepads, and it works well. Then you will have your gamepad as a device under /dev/. (Ex: /dev/js0, /dev/input/js0). And that file handle is easy to use, with many supporting 3rd party/one-off libraries (you don't have to use all of ros if you don't want/need to).
And I know from matlab that there are ways to hack up a solution, but their own 1st party solution is vrjoystick, which takes in a 1-based numeric id. This should mean your gamepad shows up as js0, and the id should then be 1: id = 1; joy = vrjoystick(id,'forcefeedback');.

Related

Calibrating a resistive touchscreen for libinput

I'm using a GUI application framework (EGT) on an ATMEL/ Microchip SAMA5D4. The framework features
DRM/KMS and X11 backends.
I've looked at using tslib to calibrate a restive touchscreen for the device but due to EGT limitations it looks like I'm going to have to use libinput for the moment.
Is there a calibration mechanism (equivalent of tslib) available for libinput? I've looked at xlibinput_calibrator & it seems like it could be a solution but I'll have to sort out the dependencies in the Yocto build.
Thanks,
For anyone looking at this xlibinput_calibrator looks like it requires X11 & was not an option.
I eventually ended up using a startup script to prevent EGT capturing raw events (deleted /dev/event0 or similiar) from the touchscreen & instead use the calibrated source from ts_input.

Building a desktop app using ParaView API under the hood

I have this workflow with ParaView where I
1) load a dicom,
2) load a state where I perform actions on the dicom (sources, filters, custom filters, etc).
3) apply a custom macro where I initialize everything.
Then I have some custom macros that moves lines in the final result.
I would like to make a desktop app with a simple UI where a I have one button that executes the 3 necessary steps to initialize everything. And then I have three buttons that executes the custom macros.
So I'm basically making a simpler ParaView.
I have used the trace function that ParaView has to make a python script with all the steps and then executing them in the pvpython shell to test if I reach the same result that in the ParaView GUI.
But a simple script that just load the dicom makes the windows (Visualization Toolkit - Win320OpenGL) not responding.
What do you think is the best approach to do this?
This is fully supported by ParaView, as ParaView is not only an application but also a framework.
This is documented here : https://www.paraview.org/Wiki/Writing_Custom_Applications
Examples are in ParaView code : https://gitlab.kitware.com/paraview/paraview/tree/master/Examples/CustomApplications
For follow-up questions, I would suggest asking on the ParaView Discourse : https://discourse.paraview.org/

Is it possible to send HTTP GET Requests from a Simulink Block?

basically the title says it all. I'm working on a model that needs (there is no way around it) to load data from a website, parse it and pass it onto another block. I thought I could use an S-Function written in C++, which didn't properly work, then I tried to use webread()
which also didn't work in Simulink because I can't use extrinsic functions on the device this will run on.
I thought I could work around it by downloading the file externally and then reading it through fscanfbut it turned out that Matlab CODER doesn't support that as well.
After putting 2 1/2 days into this now, I'm asking myself whether it is even possible to do something like an HTTP Request through a Simulink block. That's why I went here to ask that question. Thanks for every answer!
I figured out a way to do it with a C++ S-Function by now.
I also created a GitHub Repo for it. If you're stuck with the same problem as I was, try to take a look at this. I'm pretty sure it will help you.

Simulate input of a 3D Mouse in autohotkey

I want to use autohotkey to control a program, which relys on the input of a 3D-Mouse (3DConnexion SpaceNavigator). How can I simulate a axis in autohotkey?
Maybe 3DConnexion SpaceNavigator uses same axeses as joystick? So check joystic controls here: http://ahkscript.org/docs/KeyList.htm#Joystick
If it does not helps, you can try to get the name of the control with that guide: http://ahkscript.org/docs/KeyList.htm#SpecialKeys (some explanations here: Macro Keys not Detected AutoHotkey)
By the way please write your impressions about 3D-Mouse (3DConnexion SpaceNavigator) in comments.
I think you need to get the SDK and write your own intigration...seems to be the only option, unless you figure out a way to communicate with the device by watching the usb signal

Localhost arduino pincontrol

I want to make a browser-controlled Arduino, that can control 2 motors. The requrements for this, is that i want to be able to click on a button on the server that the Arduino hostes, and handle that input as if there was a button connected directly on the Arduino. Is that even possible ?
I have looked at the example called TempretureWebPanel(Arduino Tutorial), but that makes no sense to me..
Can someone please tell me where to find a tutorial for this, or even better, give an example of this.
Thanks in advice.
This example shows how to control an Arduino from a PC.
It uses C# on the PC side but you could drive it with any code you want as long as it supports writing to a USB/com port.
http://playground.arduino.cc/Csharp/SerialCommsCSharp#.UzK-F_l_t2c