Why do I get ampersand characters in my strings?
I'm trying to fix an issue that appeared on ROS Melodic, I cannot reproduce this on ROS Kinetic.
In short
- I'm using
QCheckBox
objects and setting the text to a ROS topic name. - I then retrieve this topic name (from the
QCheckBox
) but ampersand characters randomly appear in the strings.
Details
Use the ampersand branch to reproduce this bug:
- Compile / launch with command line (
roslaunch rqt_bag_exporter gui.launch
) - Open this bag file
- Tick
/topic/dog
topic to be exported - Export
On my machine it fails with:
The service fails because the topic name has an extra ampersand (&
) character after the first slash (/
), I cannot find where this character comes from.
More info
It is in the fillTopicsToExport
member that the ampersand first appear, before that all ROS_INFO output display the correct topic name.
[ WARN] [1529331726.714089119]: Service server listTopics:
[ INFO] [1529331726.714882690]: /rosout
[ INFO] [1529331726.714903216]: /rosout_agg
[ INFO] [1529331726.714919695]: /topic/dog
[ WARN] [1529331726.715075880]: Topic list retrieved from the service server:
[ INFO] [1529331726.716353318]: /rosout
[ INFO] [1529331726.716371703]: /rosout_agg
[ INFO] [1529331726.716381502]: /topic/dog
[ WARN] [1529331726.716421088]: Display topics
[ INFO] [1529331726.716500749]: /rosout
[ INFO] [1529331726.716593479]: /rosout_agg
[ INFO] [1529331726.716648656]: /topic/dog
[ WARN] [1529331732.194335365]: fillTopicsToExport
"/&topic/dog"
[ INFO] [1529331732.194412935]: /&topic/dog
Platform:
- Kubuntu 18.04
- ROS Melodic (up to date as of today)
- Qt 5.9.5
- g++ 7.3.0
I have failed to reproduce this behavior in a simple Qt program.