In ROS1 Noetic, I have the following custom message named Test.msg:
int32 did
string a
string b
And I have another custom message TestList.mgs: Test[] testList
In roscpp, when I publish TestList objects on a topic and call rostopic echo /myTopic
, the memory starts to have an increasing-decreasing pattern. Without rostopic echo
Very important: this memory pattern doesn't occur when Test.msg has only one string typed field:
int32 uid
string a
Any number of string typed fields more than 1 will reproduce the error. Tried adding any other types of members (float32, float64, time, int32, etc), any number of them, the strange memory pattern is not occurring.
Problematic work-around using uint8[]: Found a work-around to the problem by changing string type to uint8[], which resolves the issue, but leads to another issue: ROS1 Noetic Custom messages - Command line publish char[]/uint8[] support