Screenshots     Download     Documentation     Tutorials     Partners     Resources     Contact     Forum     Search  

 
1 2 3 4 Next>>

Joystick Mapping

Below we see the RoboRealm Joystick mapping interface with the appropriate values mapped to RoboRealm variables. The interface shows all the elements that can be mapped into RoboRealm but we are only interested in left, right, up, down and fire. If you move your Joystick around and press the fire and other buttons you should see the appropriate values and indicators change in the interface. Note that we are using a Logitech Joystick for this project.

Joystick Module Settings

As you can see from the image we have assigned the joystick X coordinates to a variable called "joy_x", Y to "joy_y" and the fire button to the variable "fire".

The X values of the joystick vary from -1000 to 1000 with -1000 being extreme left and 1000 being extreme right. Likewise with the Y coordinate but for up and down. The "fire" button will be a 0 (false) unless it is pressed in which case it becomes a 1 (true). The issue now is how to map those values into values that the USB Missile Launcher understands.

The Launcher has uses the following command values that are sent over USB to the device.

0 = stop
1 = up
2 = down
4 = left
8 = right
16 = fire

These are bit values meaning that if you want to move up and to the left you would send a 5 to the Launcher.

Below is the module interface for the Launcher. Note the one variable field that we can use to tell the Launcher module which variable will contain the value to send to the Launcher. For now we don't have such a variable since we have to create one using the values from the joystick. Note that you can immediately use the manual buttons to send commands to the Launcher to test that everything is connected and has power.

Missile Launcher Module Settings

To provide this mapping of joystick domain to the launcher domain we use a bit of VBScript ...

1 2 3 4 Next>>

© 2008 RoboRealm. All Rights Reserved. | Contact | Glossary | Privacy | Disclaimer | Link to Us | Resources | Site Map