Last active
December 8, 2018 06:06
-
-
Save TheProjectsGuy/d8cd4c62aa096da15a5649db4f5b6dcb to your computer and use it in GitHub Desktop.
CPP Argument parser using ROS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Include the main header file | |
#include "ros/ros.h" | |
int main(int argc, char **argv) { | |
// Initialize the node | |
ros::init(argc, argv, "ArgumentParser"); | |
// Print information about the arguments passed | |
std::cout<<argc<<" arguments"<<std::endl; | |
for (int i = 0; i < argc; i++) { | |
std::cout<<"Argument "<<i<<": "<<argv[i]<<std::endl; | |
} | |
// End program | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment