parameters: ()
docstring: Main function.
  
      Reading transform info from a yaml file and publish to tf2
docstring_summary: Main function.
docstring_tokens: Main function .
function: def main():
      """Main function.
  
      Reading transform info from a yaml file and publish to tf2
      """
      if len(sys.argv) < 2:
          print('Usage: %s extrinsic_example.yaml' % sys.argv[0])
          return
  
      with open(sys.argv[1]) as fp:
          transform_stamped = yaml.safe_load(file_path)
          command = 'rosrun tf2_ros static_transform_publisher ' \
                    '%f %f %f %f %f %f %f %s %s' % \
                    (transform_stamped['transform']['translation']['x'],
                     transform_stamped['transform']['translation']['y'],
                     transform_stamped['transform']['translation']['z'],
                     transform_stamped['transform']['rotation']['x'],
                     transform_stamped['transform']['rotation']['y'],
                     transform_stamped['transform']['rotation']['z'],
                     transform_stamped['transform']['rotation']['w'],
                     transform_stamped['header']['frame_id'],
                     transform_stamped['child_frame_id'])
  
      print(command)
  
      try:
          return call(command, shell=True)
      except OSError as e:
          print(e)
function_tokens: def main ( ) : if len ( sys . argv ) < 2 : print ( 'Usage: %s extrinsic_example.yaml' % sys . argv [ 0 ] ) return with open ( sys . argv [ 1 ] ) as fp : transform_stamped = yaml . safe_load ( file_path ) command = 'rosrun tf2_ros static_transform_publisher ' '%f %f %f %f %f %f %f %s %s' % ( transform_stamped [ 'transform' ] [ 'translation' ] [ 'x' ] , transform_stamped [ 'transform' ] [ 'translation' ] [ 'y' ] , transform_stamped [ 'transform' ] [ 'translation' ] [ 'z' ] , transform_stamped [ 'transform' ] [ 'rotation' ] [ 'x' ] , transform_stamped [ 'transform' ] [ 'rotation' ] [ 'y' ] , transform_stamped [ 'transform' ] [ 'rotation' ] [ 'z' ] , transform_stamped [ 'transform' ] [ 'rotation' ] [ 'w' ] , transform_stamped [ 'header' ] [ 'frame_id' ] , transform_stamped [ 'child_frame_id' ] ) print ( command ) try : return call ( command , shell = True ) except OSError as e : print ( e )