segmentation fault when trying to fill up a msg
I'm building a JointState publisher for my custom Robot. Its almost all done. But when i try to fill the message i get a segmentation fault. I was investigating it for hours, but found nothing that seems to be wrong. Either i had not been able to debut the node with gdb.
Actually this is the code that crashes.
//create a JointState message
sensor_msgs::JointState msg = sensor_msgs::JointState();
//doing that end up in a seg fault:
msg.header.stamp = ros::Time::now();
//doing that also up in a seg fault:
msg.name[0] = "joint1";
I had not compilation errors or warnings, added to sensor_msgs as dependences in package.xml and CMakeLists.txt.
Maibe its a silly error and i was to many hour working on that for today. Hope someone could point me to fix it.
Thanks in advance.