Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why commandline argument syntax in publisher node #45

Open
hariharan382 opened this issue Dec 25, 2020 · 0 comments
Open

why commandline argument syntax in publisher node #45

hariharan382 opened this issue Dec 25, 2020 · 0 comments

Comments

@hariharan382
Copy link

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;

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;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant