Auslesen einer IMU in Visual Bsasic

  • VB.NET

Es gibt 10 Antworten in diesem Thema. Der letzte Beitrag () ist von chris_2091.

    Auslesen einer IMU in Visual Bsasic

    Hallo zusammen,

    ich möchte eine IMU, genauer die FSM-9 von Hillcrest Labs, in einem Programm, das ich in visual basic geschrieben habe, auslesen.
    Die IMU ist normal per USB am Rechner angeschlossen.

    Leider habe ich in diesem Bereich nicht viel Ahnung.

    Kann mir jemand ein paar Tipps geben?

    Neben dem Sensor bietet Hillcrest Labs eine kostenlose Software names Freespace MotionStudio an, durch die man die Daten angezeigt bekommt.
    Kann man vielleicht hierrüber an die Daten kommen?
    Entsprechende Optionen und Möglichkeiten habe ich nicht gesehen.

    Vielen Dank schonmal!!
    Hallo @chris_2091!

    chris_2091 schrieb:

    Leider habe ich in diesem Bereich nicht viel Ahnung.
    Bezogen auf das spezielle Problem oder im Allgemeinen? Falls zweiteres, dann versuch dich doch erst einmal an was einfacherem. Sollte der Erste Fall eintreten, was du suchst ist ist warscheinlich Code zum Auslesen einer USB Schnittstelle mit VB.NET. Geh ich recht in der Annahme?

    chris_2091 schrieb:

    ich möchte eine IMU, genauer die FSM-9 von Hillcrest Labs, in einem Programm, das ich in visual basic geschrieben habe, auslesen.
    Wie gesagt: USB mit VB.NET auslesen.

    Um dein Vorhaben umsetzen zu können, wirst du doch ein wenig mit der WinAPI, P/Invoke und der Dokumentation, WIE genau die Steuerung WAS überträgt, sowie ein paar Basics der Hardwareprogrammierung (Hexadezimal System, Bytes) beschäftigen müssen.

    Ich war mal so frei und hab dir hier ein paar Links zusammen gesucht. Disclamer hierbei: Ich hab das hier nur gesucht und per C&P eingefügt, selber nicht getestet.
    social.msdn.microsoft.com/Foru…ia-vbnet?forum=vblanguage
    vb-magazin.de/forums/forums/t/6194.aspx
    planetsourcecode.com/vb/script…p?txtCodeId=4967&lngWId=1
    xtremevbtalk.com/tech-discussions/194925-usb.html

    Lg Radinator
    In general (across programming languages), a pointer is a number that represents a physical location in memory. A nullpointer is (almost always) one that points to 0, and is widely recognized as "not pointing to anything". Since systems have different amounts of supported memory, it doesn't always take the same number of bytes to hold that number, so we call a "native size integer" one that can hold a pointer on any particular system. - Sam Harwell
    @chris_2091 Da sollte es eine oder mehrere DLLs geben, die das tun, die sind gewiss bei diesem Freespace MotionStudio dabei.
    Allerdings brauchst Du dafür eine spezielle Beschreibung, die sollte auch dabei sein oder Du bekommst sie von der Firma, wenn Du dort mal anfragst.
    Falls Du diesen Code kopierst, achte auf die C&P-Bremse.
    Jede einzelne Zeile Deines Programms, die Du nicht explizit getestet hast, ist falsch :!:
    Ein guter .NET-Snippetkonverter (der ist verfügbar).
    Programmierfragen über PN / Konversation werden ignoriert!
    sehr vielen Dank @Radinator für die zahlreichen Links.

    Ich habe mich noch nie mit Hardwareprogrammierung beschäfigt, daher lese ich mich gerade in die ganze Thematik ein.
    Schlussendlich suche ich Code mit dem man den USB Port auslesen kann.

    @RodFromGermany gute Idee mit den DLLs. Vielen Dank für den Tipp. Ich suche mal danach.
    Diese DLLs muss man dann ins Programm laden und ist dann am gleichen Punkt, als würde man den USB Port auslesen?

    Ja zu das Freespace MotionStudio gibt es umfangreiche Dokumentation, auch zu der Protokollart die verwendet wird.

    chris_2091 schrieb:

    Diese DLLs muss man dann ins Programm laden und ist dann am gleichen Punkt, als würde man den USB Port auslesen?
    Wenn sie alle da sind, musst Du sie einbinden und entsprechend Doku ansprechen.
    Von allein geht da nix.
    Falls Du diesen Code kopierst, achte auf die C&P-Bremse.
    Jede einzelne Zeile Deines Programms, die Du nicht explizit getestet hast, ist falsch :!:
    Ein guter .NET-Snippetkonverter (der ist verfügbar).
    Programmierfragen über PN / Konversation werden ignoriert!
    also es gibt eine open source Software names libfreespace github.com/hcrest/libfreespace, die eine Ansteuerung des Sensors ermöglicht in viusal studio.
    Allerdings habe ich eine Frage zur Installation, ja ich weiss da bin ich hier im falschen Forum, aber das offizielle Forum ist nicht sehr aktiv groups.google.com/forum/#!forum/libfreespace, da ansonsten niemand Probleme hatte, scheine ich etwas grundsätzlich nicht zu verstehen. Hier mal der Anfang der Readme-Datei:

    die daten sind auf der Seite github.com/hcrest/libfreespace zu sehen
    General Information
    ===================

    This document describes the build process for libfreespace.

    Required Tools
    ===================

    The tools required to fully build libfreespace are:

    1) git - Use a stable release.
    Windows: git-scm.com/download/win
    Ubuntu: sudo apt-get install git

    2) Python v2.7
    Windows: python.org/download/releases/2.7.5/
    Update the environment variable PATH to include the folder that
    contain python.exe.
    Ubuntu: sudo apt-get install python

    3) Doxygen v1.8.0 (older versions will have formatting problems)
    Windows: stack.nl/~dimitri/doxygen/download.html
    Ubuntu: You cannot use apt-get for doxygen because the version is too
    old. Instead, get it from the Doxygen download page.

    4) Graphviz v2.30.1
    Windows: graphviz.org/Download_windows.php
    Ubuntu: sudo apt-get install graphviz

    5) CMake v2.8 cmake.org/
    Windows: cmake.org/cmake/resources/software.html
    Ubuntu: sudo apt-get install cmake
    sudo apt-get install cmake-gui

    If using Microsoft Windows:

    6) MS Visual Studio 10 (2010) or above
    The "Express" versions work just fine, although they lack 64-bit compilers.
    Only the Visual C/C++ parts are necessary.

    7) Windows Driver Development Kit (WinDDK) 7.1.0
    The WDK can be obtained from Microsoft by following the instructions at:
    msdn.microsoft.com/en-us/libra…ws/hardware/gg487428.aspx

    CMake will automatically look for the DDK at C:\WinDDK\7600.16385.1.
    If you install the DDK elsewhere, you can either point to it during the
    configuration process, or you can point the environment variable
    "WINDDK_DIR" to it and CMake will find it.

    At the moment, the newest WDK 8.0 is not supported.

    If using Linux:

    6) GNU Make and GNU G++
    The best way to get these is to get the build-essential package.
    This should be available for most Linux distros.
    Ubuntu: sudo apt-get install build-essential

    7) libusb libusb.org/
    Ubuntu: sudo apt-get install libusb-1.0-0-dev

    Getting the files
    ===================

    To correctly check out all of the repositories, navigate to the <base>
    directory and use the following command:
    git clone github.com/hcrest/libfreespace.git

    Building
    ===================

    Launch cmake-gui.

    Fill in the "Where is the source code:" entry. This will be the location of the
    libfreespace directory. (e.g. c:\Hillcrest\libfreespace or
    ~\Hillcrest\libfreespace)

    Fill in the "Where to build the binaries" entry. This can be anywhere but a
    reasonable location is c:\Hillcrest\build\libfreespace or
    ~\Hillcrest\build\libfreespace

    If some configuration data opens up when you enter the build directory, it means
    that the directory already had a build in it. You can reset the build directory
    by selecting File > Delete Cache.

    Click "Configure". You will be prompted to select a generator for this project.
    Choose any of the supported generators:

    Windows:
    Visual Studio 10 (2010)
    Visual Studio 11 (2012)
    Visual Studio 12 (2013)


    Ich verstehe nicht wirklich was unter getting the Files gemeint ist ?
    Wo kann man den command geben, außerden gibt es in den Dateien keine cmake-gui Datei, habe unter dem cmake Ordner alle Dateien in Visual Studio geöffnet, aber da kommt nicht beirum
    Sieht so aus als würde etwas fehlen(nämlich die Gui Datei)

    Ich hoffe jemand hat Erbarmen mit mir und weiß weiter ;)

    chris_2091 schrieb:

    getting the Files gemeint ist
    dass du eine lokale Kopie des Projektes auf deinem Rechner brauchst. Also Git installieren und ab geht die Luzi :D

    chris_2091 schrieb:

    Wo kann man den command geben
    Dafür, wie gesagt, Git installieren. Dann die Git-Bash (is wie die Windows Console) aufmachen und den Befehl eingeben

    chris_2091 schrieb:

    keine cmake-gui Datei
    Die cmake-gui-Datei ist ja auch keine Datei im Eigentlichen Sinne, also nicht wie die ganzen EULA Dateien, sonder es ist eine Exe, welche du ausführen musst. Sofern du CMake installiert hast (und die Umgebungsvariable PATH auf das Installationverzeichnis zeigt), kannst du mit der CMD von Windows das Programm start.
    In general (across programming languages), a pointer is a number that represents a physical location in memory. A nullpointer is (almost always) one that points to 0, and is widely recognized as "not pointing to anything". Since systems have different amounts of supported memory, it doesn't always take the same number of bytes to hold that number, so we call a "native size integer" one that can hold a pointer on any particular system. - Sam Harwell
    habe git und cmake installiert und entsprechend der Readme Anleitung durch geführt, klappte auch gut.
    Allerdings weiß ich nicht wie man Einstellungen bei Cmake ändert. Dazu poste ich mal den weiteren Verlauf der Readme-Datei, die genau an der Stelle ansetzt, die weiter oben als letztes zu sehen war. Habe mal aus Übersichtsgründen das obere Teilstück mit kopiert.


    Click "Configure". You will be prompted to select a generator for this project.
    Choose any of the supported generators:


    Windows:
    Visual Studio 10 (2010)
    Visual Studio 11 (2012)
    Visual Studio 12 (2013)


    Linux:
    Unix Makefiles

    At this point, all the configuration settings will be red. This is the time to
    make any changes to the settings that are displayed. Not all settings are
    required, however some important ones are:
    Windows:

    The WINDDK_DIR variable. If your WinDDK is installed in a typical location then
    cmake should be able to detect it for you. A typical setting is:
    C:\WinDDK\7600.16385.1

    Linux:

    The LIBUSB_1_INCLUDE_DIR and LIBUSB_1_LIBRARY variables. These should be
    automatically detected by cmake but if they are not you may need to point
    them at your libusb installation.

    There are other configuration settings available:

    CMAKE_INSTALL_PREFIX :
    The installation directory where the CMake install project will install to.
    This is initiated by building the "INSTALL" project in the VS solution.
    Default is typically "C:\Program Files (x86)\libfreespace"
    LIBFREESPACE_BACKEND :
    Specify an alternate backend on some paltforms. On Linux, valid values are
    'hidraw' and 'libusb'
    LIBFREESPACE_CODECS_ONLY : (ON/OFF)
    Build only the libfreespace codecs
    LIBFREESPACE_CUSTOM_INSTALL_RULES :
    CMake file to customize install rules when libfreespace is built as part of
    a larger project
    LIBFREESPACE_DOCS_ENABLED : (ON/OFF)
    Enabled doxygen docs as build target
    LIBFREESPACE_DOCS_INTERNAL : (ON/OFF)
    Generate doxygen for src files (in addition to API)
    LIBFREESPACE_HIDRAW_THREADED_WRITES : (ON/OFF)
    Enable writes in a backend thread when using hidraw
    LIBFREESPACE_LIB_TYPE : (SHARED/STATIC)
    The type of library to create
    LIBFREESPACE_ADDITIONAL_MESSAGE_FILE :
    Reserved for Hillcrest use. An additional HID message definition file.

    Set whatever configuration settings you wish, then click "Configure" until all
    red bars are gone. If a red bar persists, it means that setting will need to
    be set manually.


    Sorry das ich hier sowas frage, weiß aber nicht weiter

    Ich habe beim Konfigurieren Visual Studio 2015 genommen, dann wurde es wie laut Anleitung alles rot und eine Fehlermeldung ploppte auf ('Error in configuration process, project files may be invalid'). So weit so gut alles nach Plan.


    Also habe jetzt WINDDK installiert und bekomme die anderen Optionen angezeigt sobald man bei Advanced ein Hacken setzt, da steht bei mir jetzt bei CMAKE LINKER: CMAKE LINKER NOTFOUND
    Was musst dort hin?

    Dieser Beitrag wurde bereits 6 mal editiert, zuletzt von „chris_2091“ ()

    Also ich hab's auch grad mal versucht, bin drauf gekommen, dass man als Compiler am besten den Eintrag Visual Studio 14 2015 auswählt. Was auch wichtig ist, ist dass du das WinDDK istalliert hast (Windows Driver Developement Kit).
    In general (across programming languages), a pointer is a number that represents a physical location in memory. A nullpointer is (almost always) one that points to 0, and is widely recognized as "not pointing to anything". Since systems have different amounts of supported memory, it doesn't always take the same number of bytes to hold that number, so we call a "native size integer" one that can hold a pointer on any particular system. - Sam Harwell
    Danke scheint geklappt zu haben !!
    Danke @Radinator!!
    Auf die Idee wäre ich nicht gekommen.

    Sorry, das ich deine Antwort nicht früher gesehen habe, irgendwie hat er mir deine Antwort nicht angezeigt :(
    War ganze Zeit am bearbeiten des vorherigen Eintrages

    @Radinator hast du schon versucht die Datei libfreespace.sln in Visual Studio zu öffnen und dann zu bauen?
    Bei mir kommt wenn ich ALL_BUILD bauen lassen, kommt der Fehler Severity Code Description Project File Line Suppression State
    Error MSB6006 "cmd.exe" exited with code 9009. freespace C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets 171

    Hast du den auch?
    Hab gelesen das die exe nicht gefunden wird


    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „chris_2091“ ()