From 695e1fa574fe6e5e25ebf9d7af72d459670cf011 Mon Sep 17 00:00:00 2001 From: TSC21 Date: Sat, 17 Jul 2021 17:30:13 +0200 Subject: [PATCH] uorb_to_ros_rtps_ids: add an header with a notice regarding the autogneration of the 'px4_ros_com' urtps_bridge_topics.yaml file Although it can be modified manually, we are going to recommend the developer to generate it from the PX4-Autopilot side instead --- msg/tools/uorb_to_ros_rtps_ids.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/msg/tools/uorb_to_ros_rtps_ids.py b/msg/tools/uorb_to_ros_rtps_ids.py index 44d5a6ef79..9bff06d373 100755 --- a/msg/tools/uorb_to_ros_rtps_ids.py +++ b/msg/tools/uorb_to_ros_rtps_ids.py @@ -14,7 +14,7 @@ __author__ = 'PX4 Development Team' __copyright__ = \ ''' ' - ' Copyright (c) 2018-2019 PX4 Development Team. All rights reserved. + ' Copyright (c) 2018-2021 PX4 Development Team. All rights reserved. ' ' Redistribution and use in source and binary forms, or without ' modification, permitted provided that the following conditions @@ -114,6 +114,10 @@ def update_yaml_file(list, file): """ try: with open(file, 'w') as f: + f.write("# AUTOGENERATED-FILE! DO NOT MODIFY IT DIRECTLY.\n#" + " Edit instead the same file under PX4-Autopilot/msg/tools and" + " use the \n# PX4-Autopilot/msg/tools/uorb_to_ros_rtps_ids.py" + " to regenerate this file.\n") yaml.dump(list, f, Dumper=IndenterDumper, default_flow_style=False) if verbose: if in_file == out_file: @@ -144,7 +148,8 @@ if __name__ == "__main__": args = parser.parse_args() verbose = args.verbose in_file = args.input_file - out_file = args.output_file if (args.output_file != in_file and args.output_file != "") else in_file + out_file = args.output_file if ( + args.output_file != in_file and args.output_file != "") else in_file if verbose: print("-- PX4 to ROS RTPS Ids --")