diff --git a/moveit_setup_assistant/moveit_setup_assistant/src/main.cpp b/moveit_setup_assistant/moveit_setup_assistant/src/main.cpp index e999b7da03..421f9ca5d4 100644 --- a/moveit_setup_assistant/moveit_setup_assistant/src/main.cpp +++ b/moveit_setup_assistant/moveit_setup_assistant/src/main.cpp @@ -55,6 +55,14 @@ void usage(boost::program_options::options_description& desc, int exit_code) int main(int argc, char** argv) { + std::vector remaining_args = rclcpp::remove_ros_arguments(argc, argv); + std::vector clean_argv; + clean_argv.reserve(remaining_args.size()); + for (const std::string& arg : remaining_args) + { + clean_argv.push_back(const_cast(arg.c_str())); + } + // Parse parameters namespace po = boost::program_options; @@ -70,7 +78,7 @@ int main(int argc, char** argv) po::variables_map vm; try { - po::store(po::parse_command_line(argc, argv, desc), vm); + po::store(po::parse_command_line(clean_argv.size(), &clean_argv[0], desc), vm); po::notify(vm); if (vm.count("help"))