Can't compile my C++ ros_nxt publisher
I'm new in programming, so i'm trying to make my own publisher to the topic wich controls the motors of my NXT, so here is the code that i have written.I'm not sure if it is the correct thing that i need to control the motors, but i can't compile it.
#include <nxt_msgs/JointCommand.h>
#include <ros/ros.h>
template<class M> ros::Publisher ros::NodeHandle::advertise(const nxt_msgs::JointCommand, uint32_t, bool)
int main(int argc, char **argv)
{
ros::init(argc, argv, "JointCommand");
ros::NodeHandle n;
ros::Publisher pub = n.advertise<nxt_msgs::>("JointCommand", 1);
ros::Rate loop_rate(10);
int test=1;
nxt_msgs::JointCommand c;
c = nxt_msgs::JointCommand();
test = c.effort;
pub.publish(c);
ros::spinOnce();
loop_rate.sleep();
return 0;
}
when i try to make my package it gives me the following error :
/ros_workspace/NXT/src/rc.cpp:6:1: error: expected initializer before ‘int’