yarp icon indicating copy to clipboard operation
yarp copied to clipboard

Allow JoypadControlServer to run single thread

Open S-Dafarra opened this issue 1 year ago • 6 comments
trafficstars

I developed a device that can emulate a joypad using a GUI (https://github.com/ami-iit/yarp-device-keyboard-joypad). Since on macOS the GUIs can be opened only from the main thread, I needed to allow the possibility of avoiding running the JoypadControlServer in a single threaded mode.

In order to do so, I had to implement the IService interface on both JoypadControlServer and DeviceBundler. This PR also includes the modifications of https://github.com/robotology/yarp/pull/3100

cc @randaz81 @traversaro @Nicogene

S-Dafarra avatar Apr 08 '24 09:04 S-Dafarra

@S-Dafarra yarp already has a GUI with keybpord support to control the 2D direction of a robot: yarpmobilebasegui. Can you attach a screenshot and maybe highlight the differences?

randaz81 avatar Apr 08 '24 09:04 randaz81

Quality Gate Failed Quality Gate failed

Failed conditions
22.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Apr 08 '24 09:04 sonarqubecloud[bot]

@S-Dafarra yarp already has a GUI with keybpord support to control the 2D direction of a robot: yarpmobilebasegui. Can you attach a screenshot and maybe highlight the differences?

See https://github.com/ami-iit/yarp-device-keyboard-joypad/pull/3#issuecomment-2041073183

I was not really aware of yarpmobilebasegui. I needed a drop in replacement for the SDLJoypad with a good degree of customization on the axis and buttons order

S-Dafarra avatar Apr 08 '24 11:04 S-Dafarra

The main problem here is that yarp::dev::IService was marked in my notes: "critically flawed, to be deprecated". However, I currently do not remember the exact reason. Please allow me some time to think about this.

randaz81 avatar Apr 08 '24 13:04 randaz81

I realized that in the single thread case I was not updating the variable with the last run time. Fixed with https://github.com/robotology/yarp/pull/3101/commits/b060a6e42d4eca026e030fd57a549789799a9414

S-Dafarra avatar May 23 '24 08:05 S-Dafarra

Quality Gate Failed Quality Gate failed

Failed conditions
22.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

sonarqubecloud[bot] avatar May 23 '24 10:05 sonarqubecloud[bot]