26 YAML Configuration File Settings

From Waveshare Wiki
Jump to: navigation, search

What is YAML?

YAML (YAML Ain't Markup Language) is a human-readable data serialization format used to represent complex data structures. Its main purposes include configuration files, data exchange and storage, and passing data to programs.

Advantages of YAML

Human Readability

YAML uses indentation and a well-structured format, making files easy to read and understand. It is less verbose compared to XML or JSON and closer to natural language.

Ease of Writing and Editing

YAML syntax is clear and concise, requiring no additional markup symbols (such as XML tags or JSON braces), making it easier to write and edit.

Support for Complex Data Structures

YAML supports nesting, lists, dictionaries, and other complex data structures, making it easy to represent various types of data.

Extensibility

YAML allows the use of tags and anchors to represent relationships between objects, enabling data reuse and referencing, thereby enhancing extensibility.

Language Independence

YAML is a universal data serialization format that is not tied to any specific programming language, making it easy to parse and generate using multiple programming languages.

Configuration File config.yaml for this Product

In the config.yaml of this product, we configure some key parameters related to the robot:

audio_config - Audio-related settings

  • audio_output: Whether to use audio output
  • default_volume: Default volume level
  • min_time_between_play: Minimum interval between audio playback
  • speed_rate: TTS speech rate

base_config - Basic information

  • robot_name: Product name
  • module_type: Module type (0 - No module, 1 - Robotic arm, 2 - Gimbal)
  • sbc_version: Host version

sbc_config - Upper computer settings

  • feedback_interval: Interval for receiving feedback information
  • disabled_http_log: Disable HTTP server log information

args_config - Robot parameter settings

  • max_speed: Maximum speed
  • slow_speed: Low-speed speed
  • max_rate: Maximum speed rate
  • mid_rate: Medium speed rate
  • min_rate: Low-speed speed rate

cv - OpenCV parameter settings

  • default_color: Default target color for color recognition
  • color_lower: HSV LOWER value of target color
  • color_upper: HSV UPPER value of target color
  • min_radius: Radius threshold of target area
  • sampling_rad: Sampling area radius
  • track_color_iterate: Color tracking (pan-tilt) speed rate
  • track_faces_iterate: Face tracking (pan-tilt) speed rate
  • track_spd_rate: Pan-tilt rotation speed
  • track_acc_rate: Pan-tilt rotation acceleration
  • aimed_error: Aiming lock judgment threshold

cmd_config - Instruction type codes

These codes are related to the definitions of instructions in the lower computer program and are used for communication debugging between the upper and lower computers. Changing these involves changing the lower computer program.

code - Function codes

These codes correspond to functions, and the frontend page also needs to load this .yaml file to obtain these configurations. This way, when the frontend web application communicates with the backend, different buttons correspond to different functions. Change only if necessary.

fb - Feedback information codes

These codes correspond to types of feedback information. Some of this feedback is from the chassis to the host controller, and some is from the backend to the frontend. Using the same .yaml file for both the backend and frontend ensures uniformity of these codes and feedback information types. Change only if necessary.s and feedback information types. Change only if necessary.