cannot declare variable to be of abstract type

asked 2014-07-31 21:44:31 -0500

manaXmizery gravatar image

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 <Messenger.h>
#include <ros.h>
#include <std_msgs/String.h>
#include <rosserial_arduino/easyvr.h>
#include <EasyVR.h>

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

edit retag flag offensive close merge delete