Board index FlightGear Development New features

Force feedback support

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

Re: Force feedback support

Postby harbinger » Thu Sep 27, 2018 9:34 am

Is this thread still alive? I'm trying to get fg-haptics to work, but I'm struggling. I have what I think is all of the latest code, but I'm getting an error, indicating an error in the makefile. Not being a c developer, I'm not too sure how to proceed. The error is:

MAKE Version 5.41 Copyright (c) 1987, 2014 Embarcadero Technologies, Inc.
gcc -o fg-haptic ./fg-haptic.c -D_POSIX_C_SOURCE -g -O2 -Wall -std=c99 ,)) -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lm ,))
gcc.exe: error: ,)): No such file or directory

Please help! Or better still, let me know where I can download the pre-compiled binary for Windows 64-bit.

Thanks
harbinger
 
Posts: 3
Joined: Thu Sep 27, 2018 9:16 am

Re: Force feedback support

Postby wkitty42 » Thu Sep 27, 2018 11:15 am

harbinger wrote in Thu Sep 27, 2018 9:34 am:MAKE Version 5.41 Copyright (c) 1987, 2014 Embarcadero Technologies, Inc.
gcc -o fg-haptic ./fg-haptic.c -D_POSIX_C_SOURCE -g -O2 -Wall -std=c99 ,)) -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lm ,))
gcc.exe: error: ,)): No such file or directory


ummm... what are these things ,)) and where did they come from?
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5501
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Force feedback support

Postby harbinger » Thu Sep 27, 2018 1:28 pm

I have no idea. Well, I have a slight idea: In the makefile, there's this:

CFLAGS = -g -O2 -Wall -std=c99 $(foreach pkg,$(PKGS),$(shell pkg-config --cflags $(pkg)))
DEFS = -D_POSIX_C_SOURCE
LIBS = -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lm $(foreach pkg,$(PKGS),$(shell pkg-config --libs $(pkg)))

It looks like "$(shell pkg-config --cflags $(pkg))" and "$(shell pkg-config --libs $(pkg))" aren't returning anything, resulting in the empty list.

I'm relatively certain it's because I haven't installed the SDL developer libraries the way I should, but I have no idea where to put them or how to register them. I've tried just dumping the .lib and .dll files in the same folder as the fg-haptic source.
harbinger
 
Posts: 3
Joined: Thu Sep 27, 2018 9:16 am

Re: Force feedback support

Postby harbinger » Thu Sep 27, 2018 4:49 pm

So it turns out I was using the wrong Make.exe - I never realised that Delphi installs one as well. I've downloaded the GNUWin Make, and I'm getting further, but it's still complaining that it can't find the libs:

c:\Data\Dev\fg-haptic>"C:\Program Files (x86)\GnuWin32\bin\Make"
process_begin: CreateProcess(NULL, pkg-config --cflags sdl2, ...) failed.
process_begin: CreateProcess(NULL, pkg-config --cflags SDL2_net, ...) failed.
process_begin: CreateProcess(NULL, pkg-config --libs sdl2, ...) failed.
process_begin: CreateProcess(NULL, pkg-config --libs SDL2_net, ...) failed.
gcc -o fg-haptic fg-haptic.c -D_POSIX_C_SOURCE -g -O2 -Wall -std=c99 -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lm
fg-haptic.c:3:22: fatal error: SDL2/SDL.h: No such file or directory
#include <SDL2/SDL.h>
^
compilation terminated.
Make: *** [fg-haptic] Error 1

So how do we actually install SDL?
harbinger
 
Posts: 3
Joined: Thu Sep 27, 2018 9:16 am

Re: Force feedback support

Postby wkitty42 » Thu Sep 27, 2018 8:29 pm

i don't have a clue... i'm on linux and use the download_and_compile bash script... hopefully someone with building on winwhatever will be along soon and offer some assistance...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5501
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Force feedback support

Postby wlbragg » Tue Jun 25, 2019 6:28 pm

I was directed to this support application for force feedback devices after hooking up a Logitech Wingman Force usb/serial joystick. Everything checked out and appears to be on-line but I am getting inconsistent results.

I have only had the rumble test work and supply a rumble effect using the --test switch.It only works intermittently 1 out of several test attempts and usually only once if at all in any given test session. I don't think I have yet to feel the force feedback test on the stick , only rumble.
This is the terminal response during the test.

Code: Select all
root@wayne:/mnt/GDrive/fg-haptic# ./fg-haptic --test
fg-haptic version 0.5
Force feedback support for Flight Gear
Copyright 2011, 2014 Lauri Peltonen, released under GPLv2 or later

Test mode enabled.
1 Haptic devices detected.
   Device has 2 axis
   Supported effects [10 effects, 10 playing]:
      constant
      sine
      triangle
      sawtoothup
      sawtoothdown
      spring
      damper
   Supported capabilities:
      gain
      autocenter
Device 1 name is Logitech WingMan Force
Creating effects for device 1

Testing device number 1, Logitech WingMan Force.
HOLD FIRMLY TO YOUR JOYSTICK DURING THE TEST!

Press [enter] to start constant force test.

Press [enter] to start rumble test.


Test done!


Using FG and entering test mode or changing configuration in the GUI I get this error.

Code: Select all
Reading device setup from FG
Waiting for the command to go through...
Done
Creating effects for device 1
Update error: Haptic: Error updating the effect: Resource temporarily unavailable


I thought maybe it was a permission issue but no longer think that is the case. Anyone have any idea what might be going on and how to fix or even debug this?
I think this application is a good start to the whole force feedback application to FG.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4754
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Force feedback support

Postby wlbragg » Tue Jun 25, 2019 6:56 pm

Looking a bit closer at the code, the error is triggered when trying to update the device.

Code: Select all
if (SDL_HapticUpdateEffect(device->device, *effectId, effect) < 0)
      printf("Update error: %s\n", SDL_GetError());
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4754
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Force feedback support

Postby wkitty42 » Tue Jun 25, 2019 11:17 pm

maybe a timing issue?
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5501
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Previous

Return to New features

Who is online

Users browsing this forum: No registered users and 6 guests