ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

--ros-args is always added to the commandline arguments, but at the end, after any arguments: https://github.com/ros2/launch_ros/blob/6daacbce4bade7ed40f86f16a30a08b4d7ee9272/launch_ros/launch_ros/actions/node.py#L209. If you write code to read these commandline arguments, you might need to filter it out.

--ros-args is always added to the commandline arguments, but at the end, after any arguments: https://github.com/ros2/launch_ros/blob/6daacbce4bade7ed40f86f16a30a08b4d7ee9272/launch_ros/launch_ros/actions/node.py#L209. If you write code to read these commandline arguments, you might need to filter it out.

You can also ask rclcpp to remove ROS arguments from the arguments vector (argv) when initializing. Then I imagine you wouldn't need to filter it out. See rclcpp::init_and_remove_ros_arguments: https://github.com/ros2/rclcpp/blob/28e4b1bd738c23e3ede2c70bf35786ce829ae910/rclcpp/include/rclcpp/utilities.hpp#L140

--ros-args is always added to the commandline arguments, but at the end, after any arguments: https://github.com/ros2/launch_ros/blob/6daacbce4bade7ed40f86f16a30a08b4d7ee9272/launch_ros/launch_ros/actions/node.py#L209. If you write code to read these commandline arguments, you might need to filter it out.

You can also ask rclcpp to remove ROS arguments from the arguments vector (argv) when initializing. Then I imagine you wouldn't need to filter it out. See rclcpp::init_and_remove_ros_argumentsrclcpp::init_and_remove_ros_arguments(): https://github.com/ros2/rclcpp/blob/28e4b1bd738c23e3ede2c70bf35786ce829ae910/rclcpp/include/rclcpp/utilities.hpp#L140