The imu.cpp file contains the implementation of the IMUControl class, which is responsible for initializing and servicing the Inertial Measurement Unit (IMU) sensor. Below is a brief explanation of the key functions in this file:
The data is sent in the following format:
- Orientation data:
Ufor x-axis,Gfor y-axis (negated),Mfor z-axis (negated). Orientation data is in the form of euler angle which is the roll, pitch, yaw relative to the fixed frame. Fusion data from Gyroscope and Linear Acceleration. - Gyroscope data:
Dfor x-axis (negated),Ifor y-axis (negated),Yfor z-axis. Gyroscope data is in the form of velocity angle, rad/s, which is the orientation of the body frame - Linear acceleration data:
Pfor x-axis (negated),Cfor y-axis,Tfor z-axis.
The button.cpp file contains the implementation of the ButtonControl class, which is responsible for handling button presses and executing corresponding actions. Below is a brief explanation of the key functions in this file:
Key Features:
- Debounce the button press.
- Execute the corresponding action based on the button state.
The data is sent in the following format:
- Button state:
Bfor the state
The complete data is sent to the computer via USB Serial with this following format: "$U{}G{}M{}D{}I{}Y{}P{}C{}T{}B{}\n"
- $ is the initial marker
- \n is the end marker
- {} is the value placeholder