def main(self, *, args): # noqa: D102 qos_profile_overrides = {} # Specify a valid default if args.qos_profile_overrides_path: qos_profile_dict = yaml.safe_load(args.qos_profile_overrides_path) try: qos_profile_overrides = convert_yaml_to_qos_profile( qos_profile_dict) except (InvalidQoSProfileException, ValueError) as e: return print_error(str(e)) storage_config_file = '' if args.storage_config_file: storage_config_file = args.storage_config_file.name # NOTE(hidmic): in merged install workspaces on Windows, Python entrypoint lookups # combined with constrained environments (as imposed by colcon test) # may result in DLL loading failures when attempting to import a C # extension. Therefore, do not import rosbag2_transport at the module # level but on demand, right before first use. from rosbag2_transport import rosbag2_transport_py rosbag2_transport_py.play( uri=args.bag_file, storage_id=args.storage, node_prefix=NODE_NAME_PREFIX, read_ahead_queue_size=args.read_ahead_queue_size, rate=args.rate, topics=args.topics, qos_profile_overrides=qos_profile_overrides, loop=args.loop, topic_remapping=args.remap, storage_config_file=storage_config_file)
def main(self, *, args): # noqa: D102 bag_file = args.bag_file if not os.path.exists(bag_file): return "[ERROR] [ros2bag] bag file '{}' does not exist!".format( bag_file) rosbag2_transport_py.play( uri=bag_file, storage_id=args.storage, read_ahead_queue_size=args.read_ahead_queue_size)
def main(self, *, args): # noqa: D102 bag_file = args.bag_file if not os.path.exists(bag_file): return "[ERROR] [ros2bag] bag file '{}' does not exist!".format( bag_file) # NOTE(hidmic): in merged install workspaces on Windows, Python entrypoint lookups # combined with constrained environments (as imposed by colcon test) # may result in DLL loading failures when attempting to import a C # extension. Therefore, do not import rosbag2_transport at the module # level but on demand, right before first use. from rosbag2_transport import rosbag2_transport_py rosbag2_transport_py.play( uri=bag_file, storage_id=args.storage, node_prefix=NODE_NAME_PREFIX, read_ahead_queue_size=args.read_ahead_queue_size, rate=args.rate)
def main(self, *, args): # noqa: D102 bag_file = args.bag_file if not os.path.exists(bag_file): return "[ERROR] [ros2bag] bag file '{}' does not exist!".format( bag_file) if len(args.topics) > 0: rosbag2_transport_py.play( uri=bag_file, storage_id=args.storage, node_prefix=NODE_NAME_PREFIX, read_ahead_queue_size=args.read_ahead_queue_size, topics=args.topics) else: rosbag2_transport_py.play( uri=bag_file, storage_id=args.storage, node_prefix=NODE_NAME_PREFIX, read_ahead_queue_size=args.read_ahead_queue_size)
def main(self, *, args): # noqa: D102 bag_file = args.bag_file if not os.path.exists(bag_file): return "Error: bag file '{}' does not exist!".format(bag_file) rosbag2_transport_py.play(uri=bag_file, storage_id='sqlite3')