data.data does not name a type
i create a node in order to publish topic, so i choose std_msgs::Float64 as a type of message sent by my publisher. then i wrote those lines to publish a random message :
std_msgs::Float64 test;
test.data=0.500785;
pub.publish(test);
and that gives me an error : 'test' does not name a type
and : pub.publish(test) does not name a type.
any ideas to solve that? PS: i'm coding in c++ can anyone help me?
Hi! I ran into the same problem, so how did you solve this problem?