Main /

Using The Joystick

_____________________________

Getting Started in ModLab!

Information for Leaders

People

Lab Resources

Software Guides

Hardware Guides

Lab Website

Fun Stuff
_____________________________

edit SideBar

Using The Joystick

Using a Joystick

Modules may be controlled by using a joystick attached to a host PC or laptop. The joystick can then execute gaits at various speeds.

By entering the Preferences window (through the Options Menu) and navigating to the Controls tab, you can enable any joystick that is plugged in (with drivers properly installed). You can view all available joysticks by going into the Game Controllers window through Windows Control Panel (found under Hardware and Sound in non-advanced mode). There you can calibrate and test every installed game device.


In the Preferences window, under the Controls tab, click on the Com Port drop down menu. Select the joystick that you wish to use.

The Joystick Control window should then pop up. In the top left corner, you will find a graphical representation of the state of your joystick. This is supplemented by the bottom line in the window, which shows percent values of each axis of the joystick. To test which axis is which (and whether your device has that axis), move every axis. If an axis remains still then that axis is not available with your device.

To assign a node position to an axis, perform the following steps (use this if controling Motor Module velocity):

  • Select Module from the Type drop down menu.
  • Choose a node ID from the drop down menu labeled Node ID.
  • Select the axis with which you wish to control the module.
  • Select a multiplier (negative infinity to infinity).
    • This represents the range of the axis, for example:
      • A multiplier of 1 will have a range of 180 degrees (90 positive, 90 negative) from the offset.
      • A multiplier of .5 will have a range of 90 degrees (45 positive, 45 negative) from the offset.
      • A multiplier of 2 will have a range of 360 degrees (180 positive, 180 negative) from the offset (so long as it is within 9000 to -9000) .
      • All multipliers can be negative to reverse the direction.
  • Set an integer offset from 9000 to -9000.
    • This is the position of the module when the axis is at 0 (the default position).
  • Then click Add.
  • The node and the axis assignment can be viewed in the Existing Assignments drop down menu.

To assign the gait speed (lines per second) to an axis:

  • Select Speed from the Type drop down menu.
  • Select the axis that will control the speed.
  • Select the multiplier (this works similar to the sensitivity).
    • The default range is -10 to 10. A multiplier of 2 would make the range -20 to 20.
  • Select the offset (this is the default speed).

To assign the gait position to an axis:

  • Select Gait from the Type drop down menu.
  • Select the axis that will control the gait location.
  • Select the multiplier.
    • The default start position is -100% and the end is 100%.
  • Select the offset.
    • Only values of 1 and -1 are accepted. If a one of these are used, the multiplier should be 2.

To assign a module velocity to an axis (use this if controlling Motor Module acceleration):

  • Select Velocity from the Type drop down menu.
  • Choose a node ID from the drop down menu labeled Node ID.
  • Select the axis with which you wish to control the module.
  • Select a multiplier (negative infinity to infinity).
    • This represents the range of the axis, for example:
      • A multiplier of 1 will have a range of 180 degrees (90 positive, 90 negative) from the offset.
      • A multiplier of .5 will have a range of 90 degrees (45 positive, 45 negative) from the offset.
      • A multiplier of 2 will have a range of 360 degrees (180 positive, 180 negative) from the offset (so long as it is within 9000 to -9000) .
      • All multipliers can be negative to reverse the direction.
  • Set an integer offset from 9000 to -9000.
    • This is the position of the module when the axis is at 0 (the default position).
  • Then click Add.
  • The node and the axis assignment can be viewed in the Existing Assignments drop down menu.

To assign a Process Message to an axis:

  • Enter the Process Message number in the PM# box.
  • Select the axis from the axis box on the right.
  • Select the multiplier.
    • The default range is -1 to 1. A 9000 multiplier would make the range -9000 to 9000.
  • Select the offset.

To assign a button:

  • Select one of the following from the Type drop down menu.
    • Play/Pause Current, Loop, or Go Limp.
      • To use one of the above, select one, then press and hold the desired button combination on the joystick, and while holding the button(s), press Add.
    • Change Speed by Increment and Change FPS
      • To use one of the above, select one, then type the increment in the box above Type, then press and hold the desired button combination on the joystick, and while holding the button(s), press Add.
    • Load File
      • To use Load File, select it from the Type menu, type the filename in the box above Type, press and hold the desired button combination on the joystick, and while holding the button(s), press Add.
    • Go to Position
      • To use Go to Position, select it from the Type menu, type the desired gait in the box above Type, press and hold the desired button combination on the joystick, and while holding the button(s), press Add.
    • Send PM
      • To send a Process Message, select Send PM from the Type menu, type the following in the box above Type:
        • PM number in Hex, then separate by a comma
        • Value you wish to be sent, then separate by a comma
        • The integer representation of the value type that you are sending. The corresponding integers are as follows:
          • Bool: 0; Float: 1; Short: 2; String: 3; UShort: 4; Byte: 5
          • An example: 24e, 5000, 2
      • After the values are typed, press and hold the desired button combination on the joystick, and while holding the button(s), press Add.

To remove an assignment:

  • Select the assignment from the Existing Assignments drop down menu.
  • Click the remove button.

hz Vs. Motion:

  • hz sends motion commands on a fixed interval. The number specified above sets the frequency in hertz of the position commands
    • Recommended for slow connections (like ZigBee) or when using large numbers of modules.
    • This can result is slightly jerky movements.
  • Motion detects any movement in the joystick.
    • Recommended for fast connections (like USB to CAN) or using small numbers of modules.
    • This results is very smooth motion, but can lead to command backup (which leads to delayed motion).
Recent Changes (All) | Edit SideBar Page last modified on May 25, 2010, at 03:40 PM Edit Page | Page History
Powered by PmWiki