Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maps thrift idl msg not working properly #2054

Closed
lrapetti opened this issue Jun 27, 2019 · 15 comments
Closed

Maps thrift idl msg not working properly #2054

lrapetti opened this issue Jun 27, 2019 · 15 comments
Assignees
Labels
Affects: YARP v3.2.0 This is a known issue affecting YARP v3.2.0 Component: IDL Component: Tool - yarpidl_thrift Fixed in: YARP v3.2.1 Issue Type: Bug Involves some intervention from a system administrator Resolution: Fixed

Comments

@lrapetti
Copy link
Member

lrapetti commented Jun 27, 2019

I'm trying to use a thrift message defined using maps (the msg I am using is the following https://github.com/robotology/wearables/blob/feature/ICub-device-impl/msgs/thrift/WearableData.thrift), but I am experiencing the following problem after moving to YARP 3.2.0 (where a major refactoring of idl thrift was done by @drdanz):
I can play the dataset with yarpdataplayer and with yarp read ... /portname I see the message beeing streamed correctly. However, when I try to access the port with a device implementing TypedReaderCallback (the I am using is: https://github.com/robotology/wearables/tree/feature/ICub-device-impl/devices/IWearRemapper), the onRead() method is called only once and the content of the message is empty. In fact:

  • printing the message with the following line in onRead()
yInfo() << logPrefix << " reading wearable data: " << receivedWearData.toString();
  • it return the following:
[INFO]IWearRemapper : reading wearable data:  "XsensSuit::" () () () () () () () () () () () () () () () () 

After talking with @diegoferigo, he pointed out that the problem is analogous to what experienced in #1802, and may be a problem related to the deserialization.

@drdanz
Copy link
Member

drdanz commented Jun 28, 2019

@lrapetti Sorry, just to be sure, this worked before the upgrade to YARP 3.2, right?

@drdanz drdanz self-assigned this Jun 28, 2019
@drdanz drdanz added Affects: YARP v3.2.0 This is a known issue affecting YARP v3.2.0 Component: IDL Component: Tool - yarpidl_thrift Issue Type: Bug Involves some intervention from a system administrator labels Jun 28, 2019
@lrapetti
Copy link
Member Author

Sorry, just to be sure, this worked before the upgrade to YARP 3.2, right?

@drdanz
I have never tested it on the very same machine, but in a different machine I am at 96bad84 and it is working fine.

@kouroshD
Copy link

kouroshD commented Jul 1, 2019

Also, I have the same problem to get the information of data inside the thrift message.

@traversaro
Copy link
Member

Even without directly investigating the issue, writing a simple unit test on this in https://github.com/robotology/yarp/blob/master/tests/yarpidl_thrift/demo/main.cpp can be extremely helpful for expert YARP users to debug the issue and ensure no regression in the future.

@lrapetti
Copy link
Member Author

lrapetti commented Jul 30, 2019

@drdanz is there any plan to handle this issue anytime soon? If needed I can help (e.g. what @traversaro suggested if you can give me some hints).

This issue is preventing us to upgrade to YARP 3.2 most of the software and the laptop in the context of An.Dy project, so it would be good to try to tackle it in order to remain up-to-date with the latest release of YARP.

@drdanz
Copy link
Member

drdanz commented Aug 1, 2019

I'm sorry, I'm currently busy with other stuff, therefore I don't think I will be able to look at this before september...
If you want to try and fix it (it would be really appreciated), you can find the code of the generator in src/idls/thrift/src/t_yarp_generator.cc
You can enable some extra comment for debugging the generator by adding debug_generator to the command line.
I think you will have to check if the functions doing serialization and de-serialization are doing it properly... Perhaps, you can also compare the code generated from 3.1 with the one generated by 3.2, even if it is quite different, most changes don't impact the actual code of the functions...

Let me know if you decide to try and fix it yourself, and if you need help...

@kouroshD
Copy link

@nunoguedelha

@drdanz
Copy link
Member

drdanz commented Sep 17, 2019

It would be really useful if you could give me a minimal thrift file to reproduce this issue

@lrapetti
Copy link
Member Author

lrapetti commented Sep 18, 2019

I have developed a minimal example in which I am having problem moving from YARP3.1 to YARP3.2.

The example can be found at https://github.com/lrapetti/test_thrift_map with the following content:

  • two messages are defined, with and without map
  • a transmitter that streams both the messages in two different ports.
  • a receiver_no_map that read and print the content of the port without map
  • a receiver that read and print both the ports

What I experience is that in YARP3.1 I am able to read both the ports with the receiver. With YARP3.2 instead, the receiver_no_map works, while when I run the receiver the port stop streaming until I stop the receiver device. (this is not exactly the behaviour described at the beginning of this issue, but probably related)

@drdanz
Copy link
Member

drdanz commented Sep 18, 2019

Thanks.
I will work on this ASAP

@drdanz
Copy link
Member

drdanz commented Sep 18, 2019

From an initial debugging, the issue seem to be in the receiving part, the transmitted part is correct...

@drdanz drdanz closed this as completed in 235871e Sep 18, 2019
@drdanz
Copy link
Member

drdanz commented Sep 18, 2019

@lrapetti It should be fixed now, can you please try and report back?
Many thanks for the example, it was really helpful.
It would be great to integrate it in the unit tests...

@drdanz
Copy link
Member

drdanz commented Sep 18, 2019

It would be great to integrate it in the unit tests...

Done in bfca0db 🎉

@lrapetti
Copy link
Member Author

@lrapetti It should be fixed now, can you please try and report back?

Both the transmitter/receiver example, and the thrift message mentioned in the first comment seems to be working fine. Thanks a lot @drdanz!

@GiulioRomualdi
Copy link
Member

cc @xEnVrE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects: YARP v3.2.0 This is a known issue affecting YARP v3.2.0 Component: IDL Component: Tool - yarpidl_thrift Fixed in: YARP v3.2.1 Issue Type: Bug Involves some intervention from a system administrator Resolution: Fixed
Projects
None yet
Development

No branches or pull requests

5 participants