You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int main(int argc,char **argv) -----------why commansline argument syntax is here,since not parsing any data
{
ros::init(argc,argv,"first_node");
ros::NodeHandle n;
ros::Publisher pub=n.advertise<std_msgs::String>("first_topic",10);
ros::Rate loop_rate(10);
int count;
while (ros::ok())
{
std_msgs::String msg;
std::string strrr;
msg.data strrr="hi";----------here already i have the data to be published
ROS_INFO("%s",msg.data.c_str());
pub.publish(msg);
++count;
}
return 0;
}
The text was updated successfully, but these errors were encountered:
why commandline argument in publisher node syntax ,since we have already given the data to be published in code
#include "ros/ros.h"
#include "std_msgs/String.h"
#include
int main(int argc,char **argv) -----------why commansline argument syntax is here,since not parsing any data
{
ros::init(argc,argv,"first_node");
ros::NodeHandle n;
ros::Publisher pub=n.advertise<std_msgs::String>("first_topic",10);
ros::Rate loop_rate(10);
int count;
}
The text was updated successfully, but these errors were encountered: