Vehicle Gears (GenericControl)
Looking in the GenericControl.xml file, there are inputs with the names Toggle1 all the way through Toggle6, as well as inputs with the names FirstGear all the way through SixthGear and ReverseGear. However, it seems like these inputs don't actually do anything. When I create a vehicle and try to engage these inputs, either with the corresponding keyboard keys or with the corresponding joystick buttons, nothing happens. What's going on? A deeper explanation would be much appreciated. Eventually I hope to be able to use these inputs to control my vehicle directly to forward and reverse gears without having to use the upshift and downshift.
ANVEL Team last edited by
In the GenericControl.xml file, ANVEL has established controls for "keyboard only" control and several common gaming controllers. The "keyboard only" controls are defined towards the end of the GenericControl.xml file and outlined on https://wiki.anvelsim.com/index.php/Controlling_a_Vehicle
Are you able to place one of the included vehicles into a simulation and drive using the basic keyboard controls? Are you able to plug in one of the predefined gaming controllers and drive one of the included vehicles, such as the Generic 4x4?
Yes, I can drive fine; I was referring specifically to the Toggle and Gear inputs. I suppose I'm a little confused as to the meaning of the inputs Toggle1, Toggle2, etc.; what are these supposed to do? They don't appear to do anything when I try.
ANVEL Team last edited by
Great! I am glad to hear the basic controls are working for you.
The Toggle and Gear inputs will vary depending on the gaming controller you are using. Have you read https://wiki.anvelsim.com/index.php/Joystick_Controllers ?
It says, "Joysticks not listed above can be configured for ANVEL using a joystick calibrator application (e.g. Windows Game Controller and Linux AntiMicro) to identify the supported joystick controls to map to basic navigation and braking equivalents on the keyboard. If the calibration software does not explicitly label the joystick control names, some trial and error investigation may be required."
In the GenericControl.xml, there are several gears listed for the G29 because it is a multi-gear controller. Many other controllers simply have buttons to press (on/off toggles).
With the gaming controller plugged in and the Windows Game Controller application open, you can press the inputs on the controller and see which joystick button/axis/toggle that input maps to and then set it in the GenericControl.xml.
Yes, I have read the wiki but there is no explanation for what Toggle1-6 mean or what they are supposed to do. I have the buttons configured properly for the Logitech G27 in the GenericControl file (have checked the joystick and button numbers) and still it appears nothing happens. Normal driving works fine, but the toggle and gears are unresponsive. May I also ask why the clutch input happens to be commented out and why the HandBrake and Toggle3 share the same input joystick button? It seems a little odd.
ANVEL Team last edited by ANVEL Team
The toggles need to have corresponding functions in the respective vehicle definition xml. For example, if you go into the Generic 4x4 definition file, and search for the <transmission> tag under <motorController> you will see where those toggles are defined. Make sure that those match up with the <input> definitions in your control file for your respective peripheral.
Generic4x4 vehicle xml
<motorController type="standard"> <power input="Throttle"/> <steering input="Steering"/>
<input name="Throttle" type="Axis" lowKey="K" highKey="I"> <joystick axis="2" ratio ="0.5" invert="true"/> </input> <input name="Steering" type="Axis" lowKey="J" highKey="L"> <joystick axis="0" ratio="1" offset="0.0" invert="false" deadZone="0.00"/> </input>
Notice how in the vehicle definition file the input="XXX" matches up with the names of the inputs in the GenericControl.xml. It works the same way with toggles. As you can see, the purpose of the toggles in this particular case is to do things like front and back differential locks for the 4x4.
I see, that makes much more sense now. Thanks for the clarification!