Force-feedback joysticks in MSRS RRS feed

  • Question

  • Let's say that I want to drive a simulated robot manually with a force-feedback (FF) joystick. When the robot bumps into a wall/obstacle I want the operator to feel the collision through his joystick.


    How can MSRS be interfaced with such a joystick?


    Which FF joysticks are recommended to be used (joystick C#/C++ SDK is required of course)?



    Monday, December 24, 2007 5:40 AM


All replies

  • Hi Uri,


    We already support controlling the vibration "rumble" motors in an XBox 360 Controller with the XInputGamepad Service (the SetVibration message), but this only allows setting the speed of two motors, one with a heavier eccentric weight (for lower frequency), one with a lighter weight (for higher frequency)


    For other joysticks you could modify the GameController Service which supports devices that work with DirectInput.


    Hope this Helps




    Monday, December 24, 2007 5:18 PM
  • Sure it helps, Paul!


    Anyway, just if someone is interested, here is a list of several popular force feedback joysticks:


    1. Saitek Cyborg Evo Force Joystick


    2. Top Gun AfterBurner Force Feedback Joystick




    4. Logitech Force 3D Pro Joystick


    5. Logitech Wingman Force Feedback Pro-Joystick





    Wednesday, December 26, 2007 4:51 PM
  • I'd be interested in what progress you've made so far with this, seeing as how I too am working with integrating a force-feedback joystick and MSRS.
    Monday, February 18, 2008 7:32 PM
  • Update:  Successfully added force feedback capabilities to MSRS (specifically within DriveControl.cs, which is within SimpleDashboard).  Had to go about it in a clunky, funky way though; the code kept throwing errors when I'd try to load up a directinput device in the tried-and-true fashion, so instead of having the program fish about for the GUID of the joystick, I just hardcoded the GUID myself:

    "private Guid myguid = new Guid("019c2280-4f06-11dc-8002-444553540000");"

    obviously this isn't going to work for everyone, but it at least got the software to recognize the joystick as a device, upload an FF effect, and play it on command.  The effect is loaded up at start-time and then played everytime UpdateJoystickAxes is called (with the added proviso that the trigger button on the joystick is also being pressed).

    Going to work more with this, got it mostly optimized so that there is no slowdown in the program, just need to figure out a way to not have the GUID hardcoded... MSRS doesn't like managed C# from what the errors are telling me.  Sigh.
    Tuesday, February 19, 2008 7:51 PM
  • Actually we heavily use managed C#, did you mean to say managed C++? we love that too Smile most of our interop is written this way. MSRS does not actualy interfere with that layer at all.


    Now, interoping with native code, especial DShow is tricky, so please let us know the detailed error messages you get and maybe we can help.


    We already have added force feedback btw in some of our samples, we can post a new thread explaining how



    Friday, February 22, 2008 5:14 PM
  • I must have misinterpreted the error then, it was something along the lines of not liking the use of Manager to acquire Devices, something involving the "LoaderLock" making the program hang, if I recall. It definitely was C# though, I had cribbed the C# force-feedback code straight from the MSDN.  I'm not too concerned about the issue right now, seeing as how I found that workaround that works for me, but I would like to create a general solution (so that it works on any computer with any joystick) at some point.  I would love to see how you guys added FF though, so I would appreciate the samples.

    EDIT: Here's the exact error:

    "DLL 'C:\WINDOWS\assembly\GAC\Microsoft.DirectX.DirectInput\1.0.900.0__31bf3856ad364e35\Microsoft.DirectX.DirectInput.dll' is attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang."

    I had to go into the Exceptions menu and have it pay attention to loader lock again to generate that.
    Friday, February 22, 2008 5:36 PM
  • Sorry if I'm being late for the party, but I would like to have a glimpse at those samples.
    I'm trying to do the same thing (force feedback in MSRS), and I don't quite know where to start from.
    Wednesday, October 29, 2008 3:26 PM
  • Which one of these is the best?  Second best?


    Friday, November 28, 2008 6:31 PM
  • what joystick did you use for this?  Do you think the x52 pro (saitek) would be a good one to use for this? 

    Tuesday, May 18, 2010 4:25 PM
  • Can  you post the thread explaining the force feedback you were working on?  Also, what type of joystick were you using?
    Monday, May 24, 2010 9:37 PM
  • Force feedback joysticks have most of the same components as ordinary joysticks, with a few important additions -- an onboard microprocessor, a couple of electrical motors and either a gear train or belt system. The diagram below shows one simple design.



    Tuesday, October 16, 2018 7:42 PM