def add_arguments(self, parser, cli_name): arg = parser.add_argument( 'topic_name', help="Name of the ROS topic to listen to (e.g. '/chatter')") arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics') parser.add_argument( '--window', '-w', dest='window_size', type=unsigned_int, default=DEFAULT_WINDOW_SIZE, help='window size, in # of messages, for calculating rate ' '(default: %d)' % DEFAULT_WINDOW_SIZE, metavar='WINDOW') parser.add_argument( '--filter', dest='filter_expr', default=None, help= 'only measure messages matching the specified Python expression', metavar='EXPR') parser.add_argument( '--wall-time', dest='use_wtime', default=False, action='store_true', help='calculates rate using wall time which can be helpful' ' when clock is not published during simulation')
def add_arguments(self, parser, cli_name): arg = parser.add_argument( 'topic_name', help="Name of the ROS topic to publish to (e.g. '/chatter')") arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics') arg = parser.add_argument( 'message_type', help="Type of the ROS message (e.g. 'std_msgs/String')") arg.completer = TopicTypeCompleter( topic_name_key='topic_name') parser.add_argument( 'values', nargs='?', default='{}', help='Values to fill the message with in YAML format ' + '(e.g. "data: Hello World"), ' + 'otherwise the message will be published with default values') parser.add_argument( '-r', '--rate', metavar='N', type=float, default=1.0, help='Publishing rate in Hz (default: 1)') parser.add_argument( '-p', '--print', metavar='N', type=int, default=1, help='Only print every N-th published message (default: 1)') parser.add_argument( '-1', '--once', action='store_true', help='Publish one message and exit') parser.add_argument( '-n', '--node-name', type=str, help='Name of the created publishing node')
def add_arguments(self, parser, cli_name): arg = parser.add_argument( 'topic_name', help="Name of the ROS topic to listen to (e.g. '/chatter')") arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics') parser.add_argument( 'message_type', nargs='?', help="Type of the ROS message (e.g. 'std_msgs/String')") parser.add_argument( '--csv', action='store_true', help='Output all recursive fields separated by commas (e.g. for ' 'plotting)') parser.add_argument( '--full-length', '-f', action='store_true', help='Output all elements for arrays, bytes, and string with a ' "length > '--truncate-length', by default they are truncated " "after '--truncate-length' elements with '...''") parser.add_argument( '--truncate-length', '-l', type=unsigned_int, default=DEFAULT_TRUNCATE_LENGTH, help='The length to truncate arrays, bytes, and string to ' '(default: %d)' % DEFAULT_TRUNCATE_LENGTH)
def add_arguments(self, parser, cli_name): arg = parser.add_argument( 'topic', help='Topic name to monitor for bandwidth utilization') arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics') parser.add_argument( '--window', '-w', type=positive_int, default=DEFAULT_WINDOW_SIZE, help='window size, in # of messages, for calculating rate ' '(default: %d)' % DEFAULT_WINDOW_SIZE, metavar='WINDOW')
def add_arguments(self, parser, cli_name): arg = parser.add_argument( 'topic', help='Topic name to be calcurated the delay') arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics') parser.add_argument( '--window', '-w', type=unsigned_int, default=DEFAULT_WINDOW_SIZE, help='window size, in # of messages, for calculating rate, ' 'string to (default: %d)' % DEFAULT_WINDOW_SIZE)
def add_arguments(self, parser, cli_name): add_strategy_node_arguments(parser) arg = parser.add_argument( 'topic_name', help="Name of the ROS topic to listen to (e.g. '/chatter')") arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics') parser.add_argument( 'message_type', nargs='?', help="Type of the ROS message (e.g. 'std_msgs/msg/String')") add_qos_arguments_to_argument_parser(parser, is_publisher=False, default_preset='sensor_data') parser.add_argument( '--csv', action='store_true', help='Output all recursive fields separated by commas (e.g. for ' 'plotting)') parser.add_argument( '--field', type=str, default=None, help='Echo a selected field of a message. ' "Use '.' to select sub-fields. " 'For example, to echo the position field of a nav_msgs/msg/Odometry message: ' "'ros2 topic echo /odom --field pose.pose.position'", ) parser.add_argument( '--full-length', '-f', action='store_true', help='Output all elements for arrays, bytes, and string with a ' "length > '--truncate-length', by default they are truncated " "after '--truncate-length' elements with '...''") parser.add_argument( '--truncate-length', '-l', type=unsigned_int, default=DEFAULT_TRUNCATE_LENGTH, help='The length to truncate arrays, bytes, and string to ' '(default: %d)' % DEFAULT_TRUNCATE_LENGTH) parser.add_argument('--no-arr', action='store_true', help="Don't print array fields of messages") parser.add_argument('--no-str', action='store_true', help="Don't print string fields of messages") parser.add_argument('--lost-messages', action='store_true', help='Report when a message is lost') parser.add_argument('--raw', action='store_true', help='Echo the raw binary representation')
def add_arguments(self, parser, cli_name): add_strategy_node_arguments(parser) arg = parser.add_argument( 'topic_name', help="Name of the ROS topic to listen to (e.g. '/chatter')") arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics') parser.add_argument( 'message_type', nargs='?', help="Type of the ROS message (e.g. 'std_msgs/msg/String')") add_qos_arguments_to_argument_parser(parser, is_publisher=False, default_preset='sensor_data') parser.add_argument( '--csv', action='store_true', help='Output all recursive fields separated by commas (e.g. for ' 'plotting)') parser.add_argument( '--full-length', '-f', action='store_true', help='Output all elements for arrays, bytes, and string with a ' "length > '--truncate-length', by default they are truncated " "after '--truncate-length' elements with '...''") parser.add_argument( '--truncate-length', '-l', type=unsigned_int, default=DEFAULT_TRUNCATE_LENGTH, help='The length to truncate arrays, bytes, and string to ' '(default: %d)' % DEFAULT_TRUNCATE_LENGTH) parser.add_argument('--no-arr', action='store_true', help="Don't print array fields of messages") parser.add_argument('--no-str', action='store_true', help="Don't print string fields of messages") parser.add_argument('--lost-messages', action='store_true', help='Report when a message is lost') parser.add_argument( '--once', action='store_true', help='Print the first message received and then exit') parser.add_argument( '--timeout', metavar='N', type=unsigned_int, default=None, help='The time after which the application will exit')
def add_arguments(self, parser, cli_name): arg = parser.add_argument( 'topic_name', help="Name of the ROS topic to get info (e.g. '/chatter')") parser.add_argument( '--verbose', '-v', action='store_true', help='Prints detailed information like the node name, node namespace, topic type, ' 'GUID and QoS Profile of the publishers and subscribers to this topic') arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics')
def add_arguments(self, parser, cli_name): arg = parser.add_argument( 'topic_name', help="Name of the ROS topic to publish to (e.g. '/chatter')") arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics') arg = parser.add_argument( 'message_type', help="Type of the ROS message (e.g. 'std_msgs/String')") arg.completer = TopicTypeCompleter(topic_name_key='topic_name') parser.add_argument( 'values', nargs='?', default='{}', help='Values to fill the message with in YAML format ' '(e.g. "data: Hello World"), ' 'otherwise the message will be published with default values') parser.add_argument('-r', '--rate', metavar='N', type=float, default=1.0, help='Publishing rate in Hz (default: 1)') parser.add_argument( '-p', '--print', metavar='N', type=int, default=1, help='Only print every N-th published message (default: 1)') parser.add_argument('-1', '--once', action='store_true', help='Publish one message and exit') parser.add_argument('-n', '--node-name', help='Name of the created publishing node') parser.add_argument('--qos-profile', choices=rclpy.qos.QoSPresetProfiles.short_keys(), default='system_default', help='Quality of service profile to publish with') parser.add_argument( '--qos-reliability', choices=rclpy.qos.QoSReliabilityPolicy.short_keys(), help='Quality of service reliability setting to publish with. ' '(Will override reliability value of --qos-profile option)') parser.add_argument( '--qos-durability', choices=rclpy.qos.QoSDurabilityPolicy.short_keys(), help='Quality of service durability setting to publish with. ' '(Will override durability value of --qos-profile option)')
def add_arguments(self, parser, cli_name): arg = parser.add_argument( 'topic_name', help="Name of the ROS topic to publish to (e.g. '/chatter')") arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics') arg = parser.add_argument( 'message_type', help="Type of the ROS message (e.g. 'std_msgs/String')") arg.completer = TopicTypeCompleter(topic_name_key='topic_name') arg = parser.add_argument( 'values', nargs='?', default='{}', help='Values to fill the message with in YAML format ' "(e.g. 'data: Hello World'), " 'otherwise the message will be published with default values') arg.completer = TopicMessagePrototypeCompleter( topic_type_key='message_type') parser.add_argument('-r', '--rate', metavar='N', type=positive_float, default=1.0, help='Publishing rate in Hz (default: 1)') parser.add_argument( '-p', '--print', metavar='N', type=int, default=1, help='Only print every N-th published message (default: 1)') group = parser.add_mutually_exclusive_group() group.add_argument('-1', '--once', action='store_true', help='Publish one message and exit') group.add_argument('-t', '--times', type=nonnegative_int, default=0, help='Publish this number of times and then exit') parser.add_argument('-n', '--node-name', help='Name of the created publishing node') add_qos_arguments_to_argument_parser(parser, is_publisher=True, default_preset='system_default')
def add_arguments(self, parser, cli_name): arg = parser.add_argument( 'topic_name', help="Name of the ROS topic to get type (e.g. '/chatter')") arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics')
def add_arguments(self, parser, cli_name): add_strategy_node_arguments(parser) arg = parser.add_argument( 'topic_name', help="Name of the ROS topic to listen to (e.g. '/chatter')") arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics') parser.add_argument( 'message_type', nargs='?', help="Type of the ROS message (e.g. 'std_msgs/msg/String')") parser.add_argument( '--qos-profile', choices=rclpy.qos.QoSPresetProfiles.short_keys(), help='Quality of service preset profile to subscribe with (default: {})' .format(default_profile_str)) default_profile = rclpy.qos.QoSPresetProfiles.get_from_short_key(default_profile_str) parser.add_argument( '--qos-depth', metavar='N', type=int, help='Queue size setting to subscribe with ' '(overrides depth value of --qos-profile option)') parser.add_argument( '--qos-history', choices=rclpy.qos.QoSHistoryPolicy.short_keys(), help='History of samples setting to subscribe with ' '(overrides history value of --qos-profile option, default: {})' .format(default_profile.history.short_key)) parser.add_argument( '--qos-reliability', choices=rclpy.qos.QoSReliabilityPolicy.short_keys(), help='Quality of service reliability setting to subscribe with ' '(overrides reliability value of --qos-profile option, default: ' 'Automatically match existing publishers )') parser.add_argument( '--qos-durability', choices=rclpy.qos.QoSDurabilityPolicy.short_keys(), help='Quality of service durability setting to subscribe with ' '(overrides durability value of --qos-profile option, default: ' 'Automatically match existing publishers )') parser.add_argument( '--csv', action='store_true', help='Output all recursive fields separated by commas (e.g. for ' 'plotting)') parser.add_argument( '--field', type=str, default=None, help='Echo a selected field of a message. ' "Use '.' to select sub-fields. " 'For example, to echo the position field of a nav_msgs/msg/Odometry message: ' "'ros2 topic echo /odom --field pose.pose.position'", ) parser.add_argument( '--full-length', '-f', action='store_true', help='Output all elements for arrays, bytes, and string with a ' "length > '--truncate-length', by default they are truncated " "after '--truncate-length' elements with '...''") parser.add_argument( '--truncate-length', '-l', type=unsigned_int, default=DEFAULT_TRUNCATE_LENGTH, help='The length to truncate arrays, bytes, and string to ' '(default: %d)' % DEFAULT_TRUNCATE_LENGTH) parser.add_argument( '--no-arr', action='store_true', help="Don't print array fields of messages") parser.add_argument( '--no-str', action='store_true', help="Don't print string fields of messages") parser.add_argument( '--lost-messages', action='store_true', help='DEPRECATED: Does nothing') parser.add_argument( '--no-lost-messages', action='store_true', help="Don't report when a message is lost") parser.add_argument( '--raw', action='store_true', help='Echo the raw binary representation')
def add_arguments(self, parser, cli_name): add_strategy_node_arguments(parser) arg = parser.add_argument( 'topic_name', help="Name of the ROS topic to listen to (e.g. '/chatter')") arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics') parser.add_argument( 'message_type', nargs='?', help="Type of the ROS message (e.g. 'std_msgs/msg/String')") parser.add_argument( '--qos-profile', choices=rclpy.qos.QoSPresetProfiles.short_keys(), help= 'Quality of service preset profile to subscribe with (default: {})' .format(default_profile_str)) default_profile = rclpy.qos.QoSPresetProfiles.get_from_short_key( default_profile_str) parser.add_argument('--qos-depth', metavar='N', type=int, help='Queue size setting to subscribe with ' '(overrides depth value of --qos-profile option)') parser.add_argument( '--qos-history', choices=rclpy.qos.QoSHistoryPolicy.short_keys(), help='History of samples setting to subscribe with ' '(overrides history value of --qos-profile option, default: {})'. format(default_profile.history.short_key)) parser.add_argument( '--qos-reliability', choices=rclpy.qos.QoSReliabilityPolicy.short_keys(), help='Quality of service reliability setting to subscribe with ' '(overrides reliability value of --qos-profile option, default: ' 'Automatically match existing publishers )') parser.add_argument( '--qos-durability', choices=rclpy.qos.QoSDurabilityPolicy.short_keys(), help='Quality of service durability setting to subscribe with ' '(overrides durability value of --qos-profile option, default: ' 'Automatically match existing publishers )') parser.add_argument( '--csv', action='store_true', help= ('Output all recursive fields separated by commas (e.g. for ' 'plotting). ' 'If --include-message-info is also passed, the following fields are prepended: ' 'source_timestamp, received_timestamp, publication_sequence_number,' ' reception_sequence_number.')) parser.add_argument( '--field', type=str, default=None, help='Echo a selected field of a message. ' "Use '.' to select sub-fields. " 'For example, to echo the position field of a nav_msgs/msg/Odometry message: ' "'ros2 topic echo /odom --field pose.pose.position'", ) parser.add_argument( '--full-length', '-f', action='store_true', help='Output all elements for arrays, bytes, and string with a ' "length > '--truncate-length', by default they are truncated " "after '--truncate-length' elements with '...''") parser.add_argument( '--truncate-length', '-l', type=unsigned_int, default=DEFAULT_TRUNCATE_LENGTH, help='The length to truncate arrays, bytes, and string to ' '(default: %d)' % DEFAULT_TRUNCATE_LENGTH) parser.add_argument('--no-arr', action='store_true', help="Don't print array fields of messages") parser.add_argument('--no-str', action='store_true', help="Don't print string fields of messages") parser.add_argument( '--flow-style', action='store_true', help= 'Print collections in the block style (not available with csv format)' ) parser.add_argument('--lost-messages', action='store_true', help='DEPRECATED: Does nothing') parser.add_argument('--no-lost-messages', action='store_true', help="Don't report when a message is lost") parser.add_argument('--raw', action='store_true', help='Echo the raw binary representation') parser.add_argument('--filter', dest='filter_expr', help='Python expression to filter messages that ' 'are printed. Expression can use Python builtins ' 'as well as m (the message).') parser.add_argument( '--once', action='store_true', help='Print the first message received and then exit.') parser.add_argument('--include-message-info', '-i', action='store_true', help='Shows the associated message info.')
def add_arguments(self, parser, cli_name): arg = parser.add_argument( 'topic_name', help="Name of the ROS topic to publish to (e.g. '/chatter')") arg.completer = TopicNameCompleter( include_hidden_topics_key='include_hidden_topics') arg = parser.add_argument( 'message_type', help="Type of the ROS message (e.g. 'std_msgs/String')") arg.completer = TopicTypeCompleter(topic_name_key='topic_name') arg = parser.add_argument( 'values', nargs='?', default='{}', help='Values to fill the message with in YAML format ' "(e.g. 'data: Hello World'), " 'otherwise the message will be published with default values') arg.completer = TopicMessagePrototypeCompleter( topic_type_key='message_type') parser.add_argument('-r', '--rate', metavar='N', type=positive_float, default=1.0, help='Publishing rate in Hz (default: 1)') parser.add_argument( '-p', '--print', metavar='N', type=int, default=1, help='Only print every N-th published message (default: 1)') group = parser.add_mutually_exclusive_group() group.add_argument('-1', '--once', action='store_true', help='Publish one message and exit') group.add_argument('-t', '--times', type=nonnegative_int, default=0, help='Publish this number of times and then exit') parser.add_argument( '-w', '--wait-matching-subscriptions', type=nonnegative_int, default=None, help= ('Wait until finding the specified number of matching subscriptions. ' 'Defaults to 1 when using "-1"/"--once"/"--times", otherwise defaults to 0.' )) parser.add_argument( '--keep-alive', metavar='N', type=positive_float, default=0.1, help='Keep publishing node alive for N seconds after the last msg ' '(default: 0.1)') parser.add_argument('-n', '--node-name', help='Name of the created publishing node') parser.add_argument( '--qos-profile', choices=rclpy.qos.QoSPresetProfiles.short_keys(), help='Quality of service preset profile to publish)') default_profile = get_pub_qos_profile() parser.add_argument('--qos-depth', metavar='N', type=int, default=-1, help='Queue size setting to publish with ' '(overrides depth value of --qos-profile option)') parser.add_argument( '--qos-history', choices=rclpy.qos.QoSHistoryPolicy.short_keys(), help='History of samples setting to publish with ' '(overrides history value of --qos-profile option, default: {})'. format(default_profile.history.short_key)) parser.add_argument( '--qos-reliability', choices=rclpy.qos.QoSReliabilityPolicy.short_keys(), help='Quality of service reliability setting to publish with ' '(overrides reliability value of --qos-profile option, default: {})' .format(default_profile.reliability.short_key)) parser.add_argument( '--qos-durability', choices=rclpy.qos.QoSDurabilityPolicy.short_keys(), help='Quality of service durability setting to publish with ' '(overrides durability value of --qos-profile option, default: {})' .format(default_profile.durability.short_key))