I am stuck at Unit 4 Understanding ROS Topics: Subscribers & Messages.
The subscriber code in example 4.1 has a callback function that prints “msg.data”, while the subscriber code in exercise 4.2 has a callback function that prints “msg”, not “msg.data”. When I try to print “msg.data” in exercise 4.2, I get an error of “AttributeError: ‘Odometry’ object has no attribute ‘data’”, which I do not understand.
What is this error and what is the difference between “msg” and “msg.data”?
So if you look at your message Odometry, is for other folder. The key is to remember where is the message and look for the structure that is based for, if you look for the odometry you will see it does not have a .data variable.