PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <RoverPositionControl.hpp>
Public Member Functions | |
RoverPositionControl () | |
~RoverPositionControl () | |
RoverPositionControl (const RoverPositionControl &)=delete | |
RoverPositionControl | operator= (const RoverPositionControl &other)=delete |
void | run () override |
Static Public Member Functions | |
static int | task_spawn (int argc, char *argv[]) |
static RoverPositionControl * | instantiate (int argc, char *argv[]) |
static int | custom_command (int argc, char *argv[]) |
static int | print_usage (const char *reason=nullptr) |
Private Types | |
enum | UGV_POSCTRL_MODE { UGV_POSCTRL_MODE_AUTO, UGV_POSCTRL_MODE_OTHER } |
Private Member Functions | |
DEFINE_PARAMETERS ((ParamFloat< px4::params::GND_L1_PERIOD >) _param_l1_period,(ParamFloat< px4::params::GND_L1_DAMPING >) _param_l1_damping,(ParamFloat< px4::params::GND_L1_DIST >) _param_l1_distance,(ParamFloat< px4::params::GND_SPEED_TRIM >) _param_gndspeed_trim,(ParamFloat< px4::params::GND_SPEED_MAX >) _param_gndspeed_max,(ParamInt< px4::params::GND_SP_CTRL_MODE >) _param_speed_control_mode,(ParamFloat< px4::params::GND_SPEED_P >) _param_speed_p,(ParamFloat< px4::params::GND_SPEED_I >) _param_speed_i,(ParamFloat< px4::params::GND_SPEED_D >) _param_speed_d,(ParamFloat< px4::params::GND_SPEED_IMAX >) _param_speed_imax,(ParamFloat< px4::params::GND_SPEED_THR_SC >) _param_throttle_speed_scaler,(ParamFloat< px4::params::GND_THR_MIN >) _param_throttle_min,(ParamFloat< px4::params::GND_THR_MAX >) _param_throttle_max,(ParamFloat< px4::params::GND_THR_CRUISE >) _param_throttle_cruise,(ParamFloat< px4::params::GND_WHEEL_BASE >) _param_wheel_base,(ParamFloat< px4::params::GND_MAX_ANG >) _param_max_turn_angle) void parameters_update(bool force | |
Update our local parameter cache. More... | |
void | manual_control_setpoint_poll () |
void | position_setpoint_triplet_poll () |
void | attitude_setpoint_poll () |
void | vehicle_control_mode_poll () |
void | vehicle_attitude_poll () |
bool | control_position (const matrix::Vector2f &global_pos, const matrix::Vector3f &ground_speed, const position_setpoint_triplet_s &_pos_sp_triplet) |
Control position. More... | |
void | control_velocity (const matrix::Vector3f ¤t_velocity, const position_setpoint_triplet_s &pos_sp_triplet) |
void | control_attitude (const vehicle_attitude_s &att, const vehicle_attitude_setpoint_s &att_sp) |
Definition at line 79 of file RoverPositionControl.hpp.
|
private |
Enumerator | |
---|---|
UGV_POSCTRL_MODE_AUTO | |
UGV_POSCTRL_MODE_OTHER |
Definition at line 143 of file RoverPositionControl.hpp.
RoverPositionControl::RoverPositionControl | ( | ) |
Definition at line 61 of file RoverPositionControl.cpp.
Referenced by instantiate().
RoverPositionControl::~RoverPositionControl | ( | ) |
Definition at line 68 of file RoverPositionControl.cpp.
References _gnd_control, _loop_perf, _parameter_update_sub, _speed_ctrl, uORB::Subscription::copy(), f(), mpu9x50::parameters_update(), perf_free(), pid_init(), PID_MODE_DERIVATIV_CALC, pid_set_parameters(), math::radians(), ECL_L1_Pos_Controller::set_l1_damping(), ECL_L1_Pos_Controller::set_l1_period(), ECL_L1_Pos_Controller::set_l1_roll_limit(), and uORB::Subscription::updated().
|
delete |
|
private |
Definition at line 132 of file RoverPositionControl.cpp.
References _att_sp, _att_sp_sub, orb_check(), orb_copy(), and ORB_ID.
Referenced by run().
|
private |
Definition at line 329 of file RoverPositionControl.cpp.
References _act_controls, math::constrain(), actuator_controls_s::control, f(), vehicle_attitude_s::q, vehicle_attitude_setpoint_s::q_d, and vehicle_attitude_setpoint_s::thrust_body.
Referenced by run().
|
private |
Control position.
Definition at line 154 of file RoverPositionControl.cpp.
References _act_controls, _control_mode, _control_position_last_called, _global_pos, _gnd_control, _pos_sp_triplet, _speed_ctrl, _vehicle_acceleration_sub, _vehicle_att, _waypoint_reached, math::abs_t(), math::constrain(), actuator_controls_s::control, position_setpoint_s::cruising_speed, position_setpoint_s::cruising_throttle, position_setpoint_triplet_s::current, dt, f(), vehicle_control_mode_s::flag_control_auto_enabled, vehicle_control_mode_s::flag_control_offboard_enabled, uORB::SubscriptionData< T >::get(), get_distance_to_next_waypoint(), hrt_absolute_time(), hrt_elapsed_time(), vehicle_global_position_s::lat, position_setpoint_s::lat, position_setpoint_s::loiter_radius, vehicle_global_position_s::lon, position_setpoint_s::lon, M_PI_F, ECL_L1_Pos_Controller::nav_lateral_acceleration_demand(), ECL_L1_Pos_Controller::navigate_waypoints(), matrix::Vector< Type, M >::norm_squared(), pid_calculate(), position_setpoint_triplet_s::previous, vehicle_attitude_s::q, math::sign(), position_setpoint_s::type, UGV_POSCTRL_MODE_AUTO, UGV_POSCTRL_MODE_OTHER, position_setpoint_s::valid, and vehicle_acceleration_s::xyz.
Referenced by run().
|
private |
Definition at line 280 of file RoverPositionControl.cpp.
References _act_controls, _speed_ctrl, _vehicle_acceleration_sub, _vehicle_att, math::constrain(), actuator_controls_s::control, position_setpoint_triplet_s::current, dt, f(), uORB::SubscriptionData< T >::get(), pid_calculate(), vehicle_attitude_s::q, position_setpoint_s::velocity_frame, position_setpoint_s::vx, position_setpoint_s::vy, position_setpoint_s::vz, and vehicle_acceleration_s::xyz.
Referenced by run().
|
static |
Definition at line 573 of file RoverPositionControl.cpp.
References print_usage().
|
private |
Update our local parameter cache.
|
static |
Definition at line 556 of file RoverPositionControl.cpp.
References ll40ls::instance, and RoverPositionControl().
|
private |
Definition at line 110 of file RoverPositionControl.cpp.
References _manual, _manual_control_sub, orb_check(), orb_copy(), and ORB_ID.
|
delete |
|
private |
Definition at line 121 of file RoverPositionControl.cpp.
References _pos_sp_triplet, _pos_sp_triplet_sub, orb_check(), orb_copy(), and ORB_ID.
Referenced by run().
|
static |
Definition at line 578 of file RoverPositionControl.cpp.
Referenced by custom_command().
|
override |
Definition at line 353 of file RoverPositionControl.cpp.
References _act_controls, _actuator_controls_pub, _att_sp, _att_sp_sub, _control_mode, _control_mode_sub, _global_pos, _global_pos_sub, _gnd_control, _local_pos, _local_pos_sub, _loop_perf, _manual, _manual_control_sub, _pos_ctrl_status_pub, _pos_reset_counter, _pos_sp_triplet, _pos_sp_triplet_sub, _sensor_combined, _sensor_combined_sub, _vehicle_acceleration_sub, _vehicle_att, _vehicle_attitude_sub, position_controller_status_s::acceptance_radius, position_setpoint_s::alt, attitude_setpoint_poll(), actuator_controls_s::control, control_attitude(), control_position(), control_velocity(), ECL_L1_Pos_Controller::crosstrack_error(), position_setpoint_triplet_s::current, vehicle_control_mode_s::flag_control_attitude_enabled, vehicle_control_mode_s::flag_control_manual_enabled, vehicle_control_mode_s::flag_control_offboard_enabled, vehicle_control_mode_s::flag_control_position_enabled, vehicle_control_mode_s::flag_control_velocity_enabled, get_distance_to_next_waypoint(), globallocalconverter_init(), globallocalconverter_initialized(), globallocalconverter_toglobal(), hrt_absolute_time(), vehicle_global_position_s::lat, position_setpoint_s::lat, vehicle_global_position_s::lat_lon_reset_counter, vehicle_global_position_s::lon, position_setpoint_s::lon, position_controller_status_s::nav_bearing, ECL_L1_Pos_Controller::nav_bearing(), position_controller_status_s::nav_pitch, position_controller_status_s::nav_roll, orb_copy(), ORB_ID, orb_set_interval(), orb_subscribe(), orb_unsubscribe(), mpu9x50::parameters_update(), perf_begin(), perf_end(), position_setpoint_triplet_poll(), uORB::Publication< T >::publish(), px4_poll(), manual_control_setpoint_s::r, vehicle_local_position_s::ref_alt, vehicle_local_position_s::ref_lat, vehicle_local_position_s::ref_lon, vehicle_local_position_s::ref_timestamp, position_controller_status_s::target_bearing, ECL_L1_Pos_Controller::target_bearing(), position_controller_status_s::timestamp, actuator_controls_s::timestamp, uORB::SubscriptionData< T >::update(), vehicle_attitude_poll(), vehicle_control_mode_poll(), vehicle_global_position_s::vel_d, vehicle_global_position_s::vel_e, vehicle_global_position_s::vel_n, vehicle_local_position_s::vx, vehicle_local_position_s::vy, vehicle_local_position_s::vz, warn, warnx, position_controller_status_s::wp_dist, position_setpoint_s::x, manual_control_setpoint_s::x, position_controller_status_s::xtrack_error, position_setpoint_s::y, manual_control_setpoint_s::y, position_controller_status_s::yaw_acceptance, position_setpoint_s::z, and manual_control_setpoint_s::z.
|
static |
Definition at line 538 of file RoverPositionControl.cpp.
|
private |
Definition at line 143 of file RoverPositionControl.cpp.
References _vehicle_att, _vehicle_attitude_sub, orb_check(), orb_copy(), and ORB_ID.
Referenced by run().
|
private |
Definition at line 99 of file RoverPositionControl.cpp.
References _control_mode, _control_mode_sub, orb_check(), orb_copy(), and ORB_ID.
Referenced by run().
|
private |
direct control of actuators
Definition at line 122 of file RoverPositionControl.hpp.
Referenced by control_attitude(), control_position(), control_velocity(), and run().
|
private |
Definition at line 103 of file RoverPositionControl.hpp.
Referenced by run().
|
private |
attitude setpoint >
Definition at line 118 of file RoverPositionControl.hpp.
Referenced by attitude_setpoint_poll(), and run().
|
private |
Definition at line 110 of file RoverPositionControl.hpp.
Referenced by attitude_setpoint_poll(), and run().
|
private |
control mode
Definition at line 119 of file RoverPositionControl.hpp.
Referenced by control_position(), run(), and vehicle_control_mode_poll().
|
private |
control mode subscription
Definition at line 105 of file RoverPositionControl.hpp.
Referenced by run(), and vehicle_control_mode_poll().
|
private |
last call of control_position
Definition at line 130 of file RoverPositionControl.hpp.
Referenced by control_position().
|
private |
global vehicle position
Definition at line 120 of file RoverPositionControl.hpp.
Referenced by control_position(), and run().
|
private |
Definition at line 106 of file RoverPositionControl.hpp.
Referenced by run().
|
private |
Definition at line 139 of file RoverPositionControl.hpp.
Referenced by control_position(), run(), and ~RoverPositionControl().
|
private |
global vehicle position
Definition at line 121 of file RoverPositionControl.hpp.
Referenced by run().
|
private |
Definition at line 107 of file RoverPositionControl.hpp.
Referenced by run().
|
private |
loop performance counter
Definition at line 128 of file RoverPositionControl.hpp.
Referenced by run(), and ~RoverPositionControl().
|
private |
r/c channel data
Definition at line 116 of file RoverPositionControl.hpp.
Referenced by manual_control_setpoint_poll(), and run().
|
private |
notification of manual control updates
Definition at line 108 of file RoverPositionControl.hpp.
Referenced by manual_control_setpoint_poll(), and run().
|
private |
Definition at line 114 of file RoverPositionControl.hpp.
Referenced by ~RoverPositionControl().
|
private |
Definition at line 102 of file RoverPositionControl.hpp.
Referenced by run().
|
private |
Definition at line 137 of file RoverPositionControl.hpp.
Referenced by run().
|
private |
triplet of mission items
Definition at line 117 of file RoverPositionControl.hpp.
Referenced by control_position(), position_setpoint_triplet_poll(), and run().
|
private |
Definition at line 109 of file RoverPositionControl.hpp.
Referenced by position_setpoint_triplet_poll(), and run().
|
private |
Definition at line 124 of file RoverPositionControl.hpp.
Referenced by run().
|
private |
Definition at line 112 of file RoverPositionControl.hpp.
Referenced by run().
|
private |
Definition at line 134 of file RoverPositionControl.hpp.
Referenced by control_position(), control_velocity(), and ~RoverPositionControl().
|
private |
Definition at line 126 of file RoverPositionControl.hpp.
Referenced by control_position(), control_velocity(), and run().
|
private |
Definition at line 123 of file RoverPositionControl.hpp.
Referenced by control_position(), control_velocity(), run(), and vehicle_attitude_poll().
|
private |
Definition at line 111 of file RoverPositionControl.hpp.
Referenced by run(), and vehicle_attitude_poll().
|
private |
Definition at line 141 of file RoverPositionControl.hpp.
Referenced by control_position().
|
private |
used to check the mode in the last control loop iteration. Use to check if the last iteration was in the same mode.
Referenced by control_position().