Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 84

cannot declare variable to be of abstract type

$
0
0
Hi , I am trying to use the following code , and I am getting the error : LED2_pub:7: error: cannot declare variable ‘easyvr_msg’ to be of abstract type ‘rosserial_arduino::easyvr’ /home/sp/arduino-1.0.1/libraries/ros_lib/rosserial_arduino/easyvr.h:13: note: because the following virtual functions are pure within ‘rosserial_arduino::easyvr’: /home/sp/arduino-1.0.1/libraries/ros_lib/ros/msg.h:44: note: virtual int ros::Msg::serialize(unsigned char*) const /home/sp/arduino-1.0.1/libraries/ros_lib/ros/msg.h:47: note: virtual const char* ros::Msg::getMD5() The code I am trying to use is : #include #include #include #include #include ros::NodeHandle nh; rosserial_arduino::easyvr easyvr_msg; ros::Publisher pub_easyvr("easyvr" ,&easyvr_msg); EasyVR easyvr(); void setup() { Serial.begin(57600); Serial.print("Starting...\n"); nh.initNode(); nh.advertise(pub_easyvr); } void loop() { pub_easyvr.publish(&easyvr_msg); nh.spinOnce(); delay(1000); } Can anyone try to explain to me what I am doing wrong? i have made easyvr msg file and put the easyvr.h under rosserial_arduino too. Thanks in advance. Regards, Steve

Viewing all articles
Browse latest Browse all 84


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>