LCOV - code coverage report
Current view: top level - home/pbarker/rc/ardupilot/Rover - balance_bot.cpp (source / functions) Hit Total Coverage
Test: lcov.info Lines: 6 6 100.0 %
Date: 2026-09-09 11:02:08 Functions: 2 2 100.0 %

          Line data    Source code
       1             : #include<stdio.h>
       2             : #include "Rover.h"
       3             : 
       4             : // Function to set a desired pitch angle according to throttle
       5       54262 : void Rover::balancebot_pitch_control(float &throttle)
       6             : {
       7             :     // calculate desired pitch angle
       8       54262 :     const float demanded_pitch = radians(-throttle * 0.01f * g2.bal_pitch_max) + radians(g2.bal_pitch_trim);
       9             : 
      10             :     // calculate required throttle using PID controller
      11       54262 :     throttle = g2.attitude_control.get_throttle_out_from_pitch(demanded_pitch, radians(g2.bal_pitch_max), g2.motors.limit.throttle_lower || g2.motors.limit.throttle_upper, G_Dt) * 100.0f;
      12       54262 : }
      13             : 
      14             : // returns true if vehicle is a balance bot
      15             : // called in AP_MotorsUGV::output()
      16             : // this affects whether the vehicle tries to control its pitch with throttle output
      17     1241905 : bool Rover::is_balancebot() const
      18             : {
      19     1241905 :     return ((enum frame_class)g2.frame_class.get() == FRAME_BALANCEBOT);
      20             : }

Generated by: LCOV version 1.14