remote standard gamepad SLI for TXT

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
Antworten
vleeuwen
Beiträge: 1560
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

remote standard gamepad SLI for TXT

Beitrag von vleeuwen » 17 Feb 2020, 00:18

I created a SLI (RoboPro extension elements) which add gamepad functionality to the TXT.
This based on the recent W3C gamepad API,
The client is a web application, that's run in a modern browser (which implements the gamepad API).
The application supports a virtual joystick (2) and a standard gamepad like the XBOX360 or XBOX-one (1).
The web application (ECMAScript (Jscript), HTML5, CSS) is OS independent but the gamepad drivers need to support the interface standard.
The value range for the joysticks is the same as for the fischertechnik joysticks [-15..0..+15]

All required files (img, js, css) are provide by the TXT (3).
SS.JPG
The virtual joystick (2) will be overruled by the left joystick of the gamepad.
ro.JPG
The communication between the TXT and the web browser is based on websocket and JSON and is bi-directional.
It is also possible to send information from the TXT to the browser. Beside the joystick data it is also possible to send data from HTML elements on the web pages.

This is part of my project for the coming Ft-North-convention

The embedded Civetweb server runs under the RoboPro account and is using the user data area. It is also offering a light SQL server functionality.
Two examples:
wwwroot.JPG
ExampleWebPage.JPG

hamlet
Beiträge: 332
Registriert: 12 Jan 2011, 21:41

Re: remote standard gamepad SLI for TXT

Beitrag von hamlet » 17 Feb 2020, 17:22

Hi vleeuwen,
So by taking a Windows PC or an Android Pad supporting the Game Controller and using the installed Browser as platform independent relay station you connect any common Game Controller wirelessly to the TXT, and the Gamepad status is available in RoboPro via the SLI interface.
That's really cool!

... If you ever face a performance issue in the SLI interface – I guess the 13 calls in your example will take about 8ms – there is a really dirty and by no means platform independent hack available in this forum that might speed this up a litle bit (-;
Kind Regards,
Helmut

vleeuwen
Beiträge: 1560
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: remote standard gamepad SLI for TXT

Beitrag von vleeuwen » 18 Feb 2020, 00:52

Hi Hamlet,
Interesting response, thanks.
1. For me is the TXT and the fischertechnik firmware a given. It is a good quality toy.
Also very suitable to use as support for education with the focused on mechatronics.
The moderate speed and real-time behavior are not that important here.
The TXT with the fischertechnik firmware offers sufficient possibilities to illustrate many principles and it makes these possibilities practically accessible for hobbyists and students in educational programs.
2.
If you really want a good real-time system, then you better opt for NI (National Instruments) products, for example. They provide beautiful add-on boards for MS-Windows.
But systems such as the Siemens SIMATIC will also be in the spotlight.
3. I have already indicated that the laptop has the function of coordinating dashboard. So much more than just a relay-function between the gamepad and the TXT
One or more models (autonomous TXT systems) can send data to the laptop and receive control information back. The quickly closed control activities are performed locally on the TXT (black boxes).
This stratification can also often be found in industrial automation.
4. The response time of the human eye-hand system is on average between 190 and 320 msec.
The delay time of the web socket communication and the internal TXT speed is slightly lower.
5. This web socket interface offers schools many opportunities to introduce students to RoboPro and C/C++, as well as asynchronous communication, HTML, ECMAscript, XML technology, JSON versus binary protocols, SVG, etc.
6. RoboPro lacked the ability to communicate with the outside world in a simple and semi-standard way. Possible websocket solution as well as the other possibilities of Civetweb and Mosquitto MQTT have solved this problem.

The 8 ms that you measured is still reasonably within the 10 ms sampling rate of the TXT controller.
Less dirty then what you are writing.
I see no real problem with that.


============Google translate, for what it is =====================================================
Interessante reactie, bedankt.
1. Voor mij is de TXT en de fischertechnik-firmware een gegeven. Het is speelgoed van goede kwaliteit.
Ook zeer geschikt om te gebruiken als ondersteuning voor onderwijs gericht op mechatronica.
De gematigde snelheid en de beperkingen in realtime gedrag zijn hier niet zo belangrijk.
De TXT met de fischertechnik-firmware biedt voldoende mogelijkheden om veel principes en mogelijkheden praktisch toegankelijk te maken voor hobbyisten en studenten in het onderwijs.
2.
Als je echt een goed realtime systeem wil hebben, dan kan je beter voor bijvoorbeeld de producten van NI (National Instruments) kiezen. Zij leveren mooie add-on boards voor MS-Windows.
Maar ook systemen zoals de Siemens SIMATIC komen dan in de schijnwerpers te staan.
3. Ik heb al aangegeven dat de laptop de functie van coördinerende besturing heeft. Dus meer dan alleen een verbinding tussen de gamepad en de TXT
Een of meer modellen (autonome TXT-systemen) kunnen hun gegevens naar de laptop verzenden en besturingsinformatie ontvangen. De snel gesloten besturingsactiviteiten worden lokaal op de TXT uitgevoerd (black boxes).
Deze gelaagdheid is vaak ook te vinden in industriële automatisering.
4. De responstijd van het menselijk oog-hand systeem ligt gemiddeld tussen 190 en 320 msec.
De vertragingstijd van de web-socketcommunicatie en de interne TXT-snelheid is iets lager.
5. Deze web-socketinterface biedt scholen veel mogelijkheden om studenten kennis te laten maken met RoboPro en C/C ++, evenals asynchrone communicatie, HTML, ECMAscript, XML-technologie, JSON versus binaire protocollen, SVG, enz.
6. RoboPro ontbrak de mogelijkheid om op een eenvoudige en semi-standaard manier met de buitenwereld te communiceren. Zowel deze websocket-oplossing als ook de andere mogelijkheden van Civetweb en Mosquitto MQTT hebben dit probleem opgelost.
De 8 ms die u hebt gemeten, ligt nog redelijk binnen de bemonsteringssnelheid van 10 ms van de TXT-controller.
Ik zie daar geen echt probleem mee.
=============================================================================
Interessante Antwort, danke.
1. Für mich ist die TXT- und die fischertechnik-Firmware eine Selbstverständlichkeit. Es ist ein Spielzeug von guter Qualität.
Auch sehr gut geeignet, um als Unterstützung für die Bildung mit dem Schwerpunkt Mechatronik zu verwenden.
Die moderate Geschwindigkeit und das Echtzeitverhalten sind hier nicht so wichtig.
Das TXT mit der Firmware der fischertechnik bietet ausreichend Möglichkeiten, um viele Prinzipien zu veranschaulichen, und macht diese Möglichkeiten für Bastler und Studenten in Bildungsprogrammen praktisch zugänglich.
2.
Wenn Sie wirklich ein gutes Echtzeitsystem wünschen, entscheiden Sie sich beispielsweise besser für NI-Produkte (National Instruments). Sie bieten wunderschöne Zusatzkarten für MS-Windows.
Aber auch Systeme wie die Siemens SIMATIC stehen im Rampenlicht.
3. Ich habe bereits angegeben, dass der Laptop die Funktion hat, das Dashboard zu koordinieren. So viel mehr als nur eine Relaisfunktion zwischen Gamepad und TXT
Ein oder mehrere Modelle (autonome TXT-Systeme) können Daten an den Laptop senden und Steuerinformationen zurückerhalten. Die schnell geschlossenen Steuerungsaktivitäten werden lokal auf dem TXT (Black Boxes) ausgeführt.
Diese Schichtung findet sich häufig auch in der industriellen Automatisierung.
4. Die Reaktionszeit des menschlichen Auge-Hand-Systems liegt im Durchschnitt zwischen 190 und 320 ms.
Die Verzögerungszeit der Web-Socket-Kommunikation und die interne TXT-Geschwindigkeit sind etwas geringer.
5. Diese Web-Socket-Oberfläche bietet Schulen viele Möglichkeiten, den Schülern RoboPro und C / C ++ sowie asynchrone Kommunikation, HTML, ECMAscript, XML-Technologie, JSON im Vergleich zu binären Protokollen, SVG usw. vorzustellen.
6. RoboPro war nicht in der Lage, auf einfache und halbstandardisierte Weise mit der Außenwelt zu kommunizieren. Mögliche Websocket-Lösungen sowie die anderen Möglichkeiten von Civetweb und Mosquitto MQTT haben dieses Problem gelöst.

Die von Ihnen gemessenen 8 ms liegen immer noch angemessen innerhalb der Abtastrate von 10 ms des TXT-Controllers.
Ich sehe kein wirkliches Problem damit.
=============================================================================
Réponse intéressante, merci.
1. Pour moi, le TXT et le firmware fischertechnik sont une donnée. C'est un jouet de bonne qualité.
Également très approprié pour être utilisé comme support pour l'éducation avec l'accent mis sur la mécatronique.
La vitesse modérée et le comportement en temps réel ne sont pas si importants ici.
Le TXT avec le firmware fischertechnik offre des possibilités suffisantes pour illustrer de nombreux principes et rend ces possibilités pratiquement accessibles aux amateurs et aux étudiants dans les programmes éducatifs.
2.
Si vous voulez vraiment un bon système en temps réel, il vaut mieux opter pour les produits NI (National Instruments), par exemple. Ils fournissent de belles cartes d'extension pour MS-Windows.
Mais des systèmes tels que le SIMATIC de Siemens seront également à l'honneur.
3. J'ai déjà indiqué que l'ordinateur portable a pour fonction de coordonner le tableau de bord. Bien plus qu'une simple fonction de relais entre la manette de jeu et le TXT
Un ou plusieurs modèles (systèmes TXT autonomes) peuvent envoyer des données à l'ordinateur portable et recevoir des informations de contrôle. Les activités de contrôle rapidement fermées sont effectuées localement sur le TXT (boîtes noires).
Cette stratification se retrouve aussi souvent dans l'automatisation industrielle.
4. Le temps de réponse du système œil-main humain se situe en moyenne entre 190 et 320 ms.
Le temps de retard de la communication du socket Web et la vitesse TXT interne sont légèrement inférieurs.
5. Cette interface de socket Web offre aux écoles de nombreuses opportunités d'initier les étudiants à RoboPro et C / C ++, ainsi qu'à la communication asynchrone, HTML, ECMAscript, la technologie XML, JSON par rapport aux protocoles binaires, SVG, etc.
6. RoboPro n'avait pas la capacité de communiquer avec le monde extérieur d'une manière simple et semi-standard. Une solution Websocket possible ainsi que les autres possibilités de Civetweb et Mosquitto MQTT ont résolu ce problème.

Les 8 ms que vous avez mesurés sont encore raisonnablement dans la fréquence d'échantillonnage de 10 ms du contrôleur TXT.
Je ne vois aucun problème réel avec cela.

hamlet
Beiträge: 332
Registriert: 12 Jan 2011, 21:41

Re: remote standard gamepad SLI for TXT

Beitrag von hamlet » 18 Feb 2020, 18:33

Hi vleeuwen,
Of course your web socket based access framework is much more than just a relay functionality. I just tried to outline the information path to make sure that I got it correctly. Your framework is really impressing and I'm looking forward to see more applications based on this!

And please don't take my statement "If you ever … really dirty … hack … (-;" too serious. I agree that here those 8ms are absolutely negligible and I would also reject spoiling a good design by some potentially hazardous backdoor hack, but as you said, the TXT is a toy and tweaking it was real fun.
Kind Regards,
Helmut

vleeuwen
Beiträge: 1560
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: remote standard gamepad SLI for TXT

Beitrag von vleeuwen » 19 Feb 2020, 01:33

Hi Hamlet,
Thanks, and maybe to meet you at the North Ft-convention.
Certain the your information about the timing is welcome.

Antworten