Open jacknlliu opened 6 years ago
An example:
import yaml
data = dict(
A = 'a',
B = dict(
C = 'c',
D = 'd',
E = 'e',
)
)
with open('data.yml', 'w') as outfile:
yaml.dump(data, outfile, default_flow_style=False)
output of file
A: a
B:
C: c
D: d
E: e
how to output a list in one row in yaml documents
We follow the
YAML
configuration file format from ros-drivers/video_stream_opencv.The format of the file
camera_calibration.yaml
:NOTE: The value of parameter
distortion_model
is fixed asplumb_bob
.TODO:
.yaml
file after camera calibration, thecamera_matrix
parameters is what we concerned. (Here we use original python write file method to do output, not use the PyYaml module which cannot output the list as the inline mode. ).yaml
file, print all the parameters and use the parameters of the camera to test.(use PyYaml module to load the calibration file.)Reference