when I run my subscriber, there is error: ‘argc’ was not declared in this scope [closed]

asked 2016-02-16 08:20:11 -0600

ZYS gravatar image

when I run my subscriber, there is error: ‘argc’ was not declared in this scope this is my code about the subscriber and publisher:

//Initialized the node, setup the NodeHandle

ros::init(argc, argv, "pose_listener");

ros::NodeHandle nh1;

//Define the subscriber

ros::Subscriber position_sub = nh1.subscribe("/uwsim/girona500_odom", 1, vehiclePoseCallback);

//Initialized the node, setup the NodeHandle

ros::init(argc, argv, "girona500_target");

//Define the subscriber

ros::NodeHandle nh2;

ros::Subscriber sub = nh2.subscribe("chatter", 1, chatterCallback);

//Initialized the node, setup the NodeHandle

ros::init(argc, argv, "girona500_t1");

//Define the publisher

ros::NodeHandle nh3;

ros::Publisher chatter_pub = nh3.advertise<std_msgs::string>("chatter", 1);

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by ZYS
close date 2016-02-16 08:25:14.390354