15 #include "rclcpp/detail/utilities.hpp"
22 #include "rclcpp/exceptions.hpp"
32 std::vector<std::string>
33 get_unparsed_ros_arguments(
34 int argc,
char const *
const * argv,
39 std::vector<std::string> unparsed_ros_arguments;
41 if (unparsed_ros_args_count > 0) {
42 int * unparsed_ros_args_indices =
nullptr;
46 rclcpp::exceptions::throw_from_rcl_error(ret,
"failed to get unparsed ROS arguments");
49 for (
int i = 0; i < unparsed_ros_args_count; ++i) {
50 assert(unparsed_ros_args_indices[i] >= 0);
51 assert(unparsed_ros_args_indices[i] < argc);
52 unparsed_ros_arguments.push_back(argv[unparsed_ros_args_indices[i]]);
54 allocator.deallocate(unparsed_ros_args_indices, allocator.state);
56 allocator.deallocate(unparsed_ros_args_indices, allocator.state);
60 return unparsed_ros_arguments;
rcutils_allocator_t rcl_allocator_t
Encapsulation of an allocator.
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_arguments_get_unparsed_ros(const rcl_arguments_t *args, rcl_allocator_t allocator, int **output_unparsed_ros_indices)
Return a list of indices to unknown ROS specific arguments that were left unparsed.
RCL_PUBLIC RCL_WARN_UNUSED int rcl_arguments_get_count_unparsed_ros(const rcl_arguments_t *args)
Return the number of ROS specific arguments that were not successfully parsed.
Versions of rosidl_typesupport_cpp::get_message_type_support_handle that handle adapted types.
Hold output of parsing command line arguments.
#define RCL_RET_OK
Success return code.
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.