User Tools

Site Tools


getting_started:tutorials:inputdev1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
getting_started:tutorials:inputdev1 [2020/12/03 12:07] ursgrafgetting_started:tutorials:inputdev1 [2021/03/31 17:17] (current) – [Reading from a Space Navigator] ursgraf
Line 4: Line 4:
 ===== Reading from a Mouse ===== ===== Reading from a Mouse =====
  
-In the EEROS library you will find a directory with examples. Open a shell in the build directory of your EEROS library and run ''examples/controlsystem/mouseTest''.+In the EEROS library you will find a directory with examples. For this example see [[https://github.com/eeros-project/eeros-framework/blob/master/examples/block/MouseTest.cpp|MouseTest.cpp]].  
 + 
 +Open a shell in the build directory of your EEROS library and run  
 +<code> 
 +$ sudo ./examples/block/mouseTest 
 +</code>
 This examples reads four axis of a mouse together with three buttons and outputs the results periodically. Further, the safety system checks for the middle button to be pressed. This causes a level change. As soon as the button is released the safety system changes back to the first level.\\ This examples reads four axis of a mouse together with three buttons and outputs the results periodically. Further, the safety system checks for the middle button to be pressed. This causes a level change. As soon as the button is released the safety system changes back to the first level.\\
 In order to read from the proper mouse events you can install and run the ''evtest'' program.  In order to read from the proper mouse events you can install and run the ''evtest'' program. 
Line 11: Line 16:
 $ sudo evtest $ sudo evtest
 </code> </code>
-This programm will list all connected devices together with the associated event number. Please adapt the program accordingly. It might be necessary to run it with root priveledges.+This programm will list all connected devices together with the associated event number. Please adapt the program accordingly. 
  
 ===== Reading from a Keyboard ===== ===== Reading from a Keyboard =====
 +In the EEROS library you will find a directory with examples. For this example see [[https://github.com/eeros-project/eeros-framework/blob/master/examples/block/KeyboardTest.cpp|KeyboardTest.cpp]].
  
-===== Reading from a XBox Controller or a Space Navigator ===== +Open a shell in the build directory of your EEROS library and run  
-In the EEROS library you will find a directory with examples. Open a shell in the build directory of your EEROS library and run ''examples/controlsystem/xBoxTest''.+<code> 
 +$ sudo ./examples/block/keyboardTest 
 +</code> 
 +Study the code of the example together with the code of the ''KeyboardInput'' block. 
 +===== Reading from a XBox Controller ===== 
 +In the EEROS library you will find a directory with examples. For this example see [[https://github.com/eeros-project/eeros-framework/blob/master/examples/block/XBoxTest.cpp|XBoxTest.cpp]]. 
 + 
 +Open a shell in the build directory of your EEROS library and run  
 +<code> 
 +$ sudo ./examples/block/xBoxTest 
 +</code>
 This examples reads and outputs periodically all 8 buttons and 8 axis of a XBox controller. Further, the safety system checks for the button 'X' to be pressed. This causes a level change. As soon as the button is released the safety system changes back to the first level. \\ This examples reads and outputs periodically all 8 buttons and 8 axis of a XBox controller. Further, the safety system checks for the button 'X' to be pressed. This causes a level change. As soon as the button is released the safety system changes back to the first level. \\
 If you connect several such controller you have to check in ''/dev/input/'' for the controller of your choice and adapt the program accordingly.  If you connect several such controller you have to check in ''/dev/input/'' for the controller of your choice and adapt the program accordingly. 
  
----- +===== Reading from a Space Navigator ===== 
-There is a second example demonstrating the use of space navigator. Open a shell in the build directory of your EEROS library and run ''examples/controlsystem/spaceNavigatorTest''.+In the EEROS library you will find directory with examplesFor this example see [[https://github.com/eeros-project/eeros-framework/blob/master/examples/block/SpaceNavigatorTest.cpp|SpaceNavigatorTest.cpp]]. 
 + 
 +Open a shell in the build directory of your EEROS library and run  
 +<code> 
 +$ sudo ./examples/block/spaceNavigatorTest 
 +</code>
 This examples reads and outputs periodically the 3 position and 3 rotation axis together with the state of the 2 buttons of a space navigator mouse. Further, the safety system checks for the left button to be pressed. This causes a level change. As soon as the button is released the safety system changes back to the first level.  This examples reads and outputs periodically the 3 position and 3 rotation axis together with the state of the 2 buttons of a space navigator mouse. Further, the safety system checks for the left button to be pressed. This causes a level change. As soon as the button is released the safety system changes back to the first level. 
getting_started/tutorials/inputdev1.1606993647.txt.gz · Last modified: 2020/12/03 12:07 by ursgraf