What happens to constants in a .msg?
Hello,
If I have the following message:
uint8 val
uint8 a=0
uint32 b=0
string c=this is the string
Which I publish as follows:
#include "ros/ros.h"
#include "test_types/type33.h"
int main(int argc, char **argv)
{
ros::init(argc, argv, "test_types_publisher_type33");
ros::NodeHandle n;
ros::Publisher chatter_pub = n.advertise<test_types::type33>("/test_types/type33", 10);
ros::Rate loop_rate(1);
while (ros::ok())
{
test_types::type33 msg;
msg.val=10;
chatter_pub.publish(msg);
ros::spinOnce();
loop_rate.sleep();
}
return 0;
}
However when I echo the topic or I check with wireshark, I only see val
and the length of the messages in the header is also 1 byte: 01 00 00 00 0a
. So where are the constants transmitted?
Thanks.
is this a verbatim copy-paste? Because
string
constants should be enclosed in quotes.