Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/APM_Control/AP_SteerController.h
Views: 1798
#pragma once12#include <AP_Common/AP_Common.h>3#include <AC_PID/AP_PIDInfo.h>45class AP_SteerController {6public:7AP_SteerController()8{9AP_Param::setup_object_defaults(this, var_info);10}1112/* Do not allow copies */13CLASS_NO_COPY(AP_SteerController);1415/*16return a steering servo output from -4500 to 4500 given a17desired lateral acceleration rate in m/s/s. Positive lateral18acceleration is to the right.19*/20int32_t get_steering_out_lat_accel(float desired_accel);2122/*23return a steering servo output from -4500 to 4500 given a24desired yaw rate in degrees/sec. Positive yaw is to the right.25*/26int32_t get_steering_out_rate(float desired_rate);2728/*29return a steering servo output from -4500 to 4500 given a30yaw error in centi-degrees31*/32int32_t get_steering_out_angle_error(int32_t angle_err);3334/*35return the steering radius (half diameter). Assumed to be half36the P value.37*/38float get_turn_radius(void) const { return _K_P * 0.5f; }3940void reset_I();4142static const struct AP_Param::GroupInfo var_info[];4344const class AP_PIDInfo& get_pid_info(void) const { return _pid_info; }4546void set_reverse(bool reverse) {47_reverse = reverse;48}4950// Returns true if controller has been run recently51bool active() const;5253private:54AP_Float _tau;55AP_Float _K_FF;56AP_Float _K_P;57AP_Float _K_I;58AP_Float _K_D;59AP_Float _minspeed;60AP_Int16 _imax;61uint32_t _last_t;62float _last_out;6364AP_Float _deratespeed;65AP_Float _deratefactor;66AP_Float _mindegree;6768AP_PIDInfo _pid_info {};6970bool _reverse;71};727374