ros2 how to get non-ros parameter argument count
I have code like:
int main(...)
{
rclcpp::init(argc, argv);
if(argc != 3) {
printf("Error, missing arguments for a, b\n");
}
...
The problem with this is that when using launch_testing.launch_test, or any launch file and specifying arguments for my application, these tools/libraries are adding extra parameters like:
mcu_sim_test 20 -50 --ros-args -r __node:=test -r __ns:=/mcu_sim_namespace
These additional --ros-args are throwing off the argument counts even though they aren't being used by my package but rather used by ros2.
I did see that this is an intentional change from ros1 where the argc/argv were being altered and that makes a ton of sense. Where I'm stuck is how to address it.