Closed jgvictores closed 1 year ago
libserial
is not multiplatform (no LaserTowerOfDeath
connected to Windows?) and seems pretty stale:
0.6.0~rc2+svn122-4
looking at https://sourceforge.net/p/libserial/code/HEAD/tree/ is from 2015.Back in ECROnian times, we used a plain C approach:
pwmServer.ino
)The protocol allowed specifying individual motor movements, unlike contrast to the current one: https://github.com/asrob-uc3m/yarp-devices/blob/29965f0c296c07d0e0dc74e60a628566df00eaa0/libraries/YarpPlugins/LaserTowerOfDeathController/LaserTowerOfDeathController.cpp#L65-L77
What would you think about moving to this plain-C approach?
Isn't that plain-C approach heavily Linux-specific? I mean, check all those read
, write
and open
calls in this file (plus termios.h and so on). I've never bothered to learn IO on Windows, perhaps it's not that hard to adopt the C standard way - or just wrap platform-specific lines in their corresponding #ifdef
s: https://stackoverflow.com/a/13198670. Alternatively, we could manage serial comms with ACE, which is indeed multi-platform as already implemented in YARP's serialport
device.
Oh, ok!
Thanks for all this info. I guess https://github.com/asrob-uc3m/yarp-devices/issues/21 is the priority now, but it's great to have some pointers towards a multiplatform solution.
Within the 3 options presented (ACE, yarp device that uses ACE, preprocessor), I have no clear preferences.
It turns out libserial is not stale, the libserial-dev
package has been upgraded from 0.6 to 1.0 between Ubuntu bionic and focal (ref). These versions are not compatible. I'd strongly advise moving towards YARP's serialport
device, as suggested earlier.
I'd strongly advise moving towards YARP's
serialport
device, as suggested earlier.
Done at https://github.com/asrob-uc3m/yarp-devices/commit/e65ada4dca13977f1d4a547aea9f04a2abf99f04. It is necessary to install libace-dev
via apt, then compile YARP with -DSKIP_ACE=OFF
(this is the default) and -DENABLE_yarpmod_serialport=ON
.
From bottom of https://ubuntuforums.org/archive/index.php/t-896869.html (mujambee):