Robotics StackExchange | Archived questions

How come a node receives one more argument from a launch file compared to the command line?

int main(int argc, char **argv) { rclcpp::init(argc, argv); auto node = std::makeshared(); if (argc != 5) { RCLCPPINFO(node->getlogger(), "(x,y,theta)"); return 1; } node->sendgoal(atof(argv[1]), atof(argv[2]), atof(argv[3])); rclcpp::spin(node); rclcpp::shutdown(); return 0; } why argc suppose to be 4 run by the command line, whereas 5 by launch? what is the last argv?

Asked by V587MrZ on 2023-04-21 04:48:15 UTC

Comments

Answers