pythonic.py
Go to the documentation of this file.
1 PYTHON_REPLACEMENTS = {
2  r'\n(\s+)rospy.init_node\((.*)\)': '\n$0rclpy.init()\n$0node = rclpy.create_node($1)',
3  r'rospy.Publisher\(([^\,]+), ([^\)]+)\)': 'node.create_publisher($1, $0)',
4  r'rospy.Subscriber\(([^\,]+), ([^\,]+), ([^\)]+)\)': 'node.create_subscription($1, $0, $2)',
5  r'rospy.Service\(([^\,]+), ([^\,]+), ([^\)]+)\)': 'node.create_service($1, $0, $2)',
6 }
7 
8 
9 def update_python(package):
10  package.source_code.modify_with_patterns(PYTHON_REPLACEMENTS, language='python')


magical_ros2_conversion_tool
Author(s):
autogenerated on Wed Mar 3 2021 03:56:02