Yarp: In the devel branch launching `serial` device with `serialport` subdevice results in the `serial` device launched twice

Created on 25 May 2018  路  7Comments  路  Source: robotology/yarp

Describe the bug
Launching serial device with serialport subdevice results in the serial device launched twice

To Reproduce
Steps to reproduce the behavior:
~
yarpdev --device serial --subdevice serialport --comport /dev/ttyACM0
~

where /dev/ttyACM0 is a valid serial device

Expected behavior
The serial device should be launched only once.
This is what happens for example if you launch yarpdev --device inertial --subdevice fakeIMU .

Configuration (please complete the following information):

Additional context
Behaviour on the master branch:
~bash
straversaro@iiticublap103:~/src/robotology-superbuild/robotology/YARP$ yarpdev --device serial --subdevice serialport --comport /dev/ttyACM0
[DEBUG]Subdevice serialport
[INFO]Starting Serial Port in /dev/ttyACM0
[INFO]created device . See C++ class yarp::dev::SerialDeviceDriver for documentation.
yarp: Port /serial/in active at tcp://10.255.111.14:10002/
yarp: Port /serial/out active at tcp://10.255.111.14:10003/
[INFO]created wrapper . See C++ class yarp::dev::ServerSerial for documentation.
[INFO]Server Serial starting
yarp: Port /serial/quit active at tcp://10.255.111.14:10004/
~

Behaviour on the devel branch:
~bash
straversaro@iiticublap103:~/src/robotology-superbuild/robotology/YARP$ yarpdev --device serial --subdevice serialport --comport /dev/ttyACM0
[DEBUG]Subdevice serialport
[DEBUG]Subdevice serialport
[INFO]Starting Serial Port in /dev/ttyACM0
[INFO]created device . See C++ class yarp::dev::SerialDeviceDriver for documentation.
yarp: Port /serial/in active at tcp://10.255.111.14:10002/
yarp: Port /serial/out active at tcp://10.255.111.14:10003/
[INFO]Server Serial starting
[INFO]created device . See C++ class yarp::dev::ServerSerial for documentation.
yarp: Port /serial/in failed to activate at tcp://10.255.111.14:10002/ (address conflict)
yarp: Port /serial/out failed to activate at tcp://10.255.111.14:10003/ (address conflict)
[INFO]created device . See C++ class yarp::dev::ServerSerial for documentation.
[INFO]Server Serial starting
yarp: Port /serial/quit active at tcp://10.255.111.14:10004/
[INFO]device active in background...
~

Devices YARP v3.0.0 Bug Fixed

All 7 comments

Note: this affects all the iCub robots when launching the faceExpressions device.

If you try to replicate this issue, remember to delete every time the build/install directory of YARP, as the different configuration of yarp/share/plugins/serial.ini and yarp/share/plugins/serialport.ini will confuse the YARP plugin framework a lot.

I think this was introduced in https://github.com/robotology/yarp/commit/16d8ad30799c47fe1eb2a0486d32bcf508558c3d , but I did not checked this.

@drdanz @barbalberto any idea?

cc @hu-yue @GiulioRomualdi @DanielePucci

Try to modify ServerSerial.cpp in order to have

yarp::dev::DriverCreator *createServerSerial() {
    return new yarp::dev::DriverCreatorOf<yarp::dev::ServerSerial>("serial",
                                                                   "serial",
                                                                   "yarp::dev::ServerSerial");

Putting the itself as wrapper makes it a network wrapper.
Not sure this fix it, but it is the only difference from other wrappers.

That's great @Nicogene , this fixes it.

Was this page helpful?
0 / 5 - 0 ratings