mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
RoverPositionController: remove some unused stuff
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -48,12 +48,6 @@
|
|||||||
|
|
||||||
using matrix::Vector2f;
|
using matrix::Vector2f;
|
||||||
|
|
||||||
float ECL_L1_Pos_Controller::switch_distance(float wp_radius)
|
|
||||||
{
|
|
||||||
/* following [2], switching on L1 distance */
|
|
||||||
return math::min(wp_radius, _L1_distance);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ECL_L1_Pos_Controller::navigate_waypoints(const Vector2f &vector_A, const Vector2f &vector_B,
|
ECL_L1_Pos_Controller::navigate_waypoints(const Vector2f &vector_A, const Vector2f &vector_B,
|
||||||
const Vector2f &vector_curr_position, const Vector2f &ground_speed_vector)
|
const Vector2f &vector_curr_position, const Vector2f &ground_speed_vector)
|
||||||
|
|||||||
@@ -97,17 +97,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
float crosstrack_error() { return _crosstrack_error; }
|
float crosstrack_error() { return _crosstrack_error; }
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the switch distance
|
|
||||||
*
|
|
||||||
* This is the distance at which the system will
|
|
||||||
* switch to the next waypoint. This depends on the
|
|
||||||
* period and damping
|
|
||||||
*
|
|
||||||
* @param waypoint_switch_radius The switching radius the waypoint has set.
|
|
||||||
*/
|
|
||||||
float switch_distance(float waypoint_switch_radius);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Navigate between two waypoints
|
* Navigate between two waypoints
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -45,8 +45,6 @@
|
|||||||
#include "RoverPositionControl.hpp"
|
#include "RoverPositionControl.hpp"
|
||||||
#include <lib/geo/geo.h>
|
#include <lib/geo/geo.h>
|
||||||
|
|
||||||
#define ACTUATOR_PUBLISH_PERIOD_MS 4
|
|
||||||
|
|
||||||
using namespace matrix;
|
using namespace matrix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -266,11 +264,6 @@ RoverPositionControl::control_position(const matrix::Vector2d ¤t_position,
|
|||||||
float dist_target = get_distance_to_next_waypoint(_global_pos.lat, _global_pos.lon,
|
float dist_target = get_distance_to_next_waypoint(_global_pos.lat, _global_pos.lon,
|
||||||
(double)curr_wp(0), (double)curr_wp(1)); // pos_sp_triplet.current.lat, pos_sp_triplet.current.lon);
|
(double)curr_wp(0), (double)curr_wp(1)); // pos_sp_triplet.current.lat, pos_sp_triplet.current.lon);
|
||||||
|
|
||||||
//PX4_INFO("Setpoint type %d", (int) pos_sp_triplet.current.type );
|
|
||||||
//PX4_INFO(" State machine state %d", (int) _pos_ctrl_state);
|
|
||||||
//PX4_INFO(" Setpoint Lat %f, Lon %f", (double) curr_wp(0), (double)curr_wp(1));
|
|
||||||
//PX4_INFO(" Distance to target %f", (double) dist_target);
|
|
||||||
|
|
||||||
switch (_pos_ctrl_state) {
|
switch (_pos_ctrl_state) {
|
||||||
case GOTO_WAYPOINT: {
|
case GOTO_WAYPOINT: {
|
||||||
if (dist_target < _param_nav_loiter_rad.get()) {
|
if (dist_target < _param_nav_loiter_rad.get()) {
|
||||||
@@ -305,8 +298,6 @@ RoverPositionControl::control_position(const matrix::Vector2d ¤t_position,
|
|||||||
if (dist_between_waypoints > 0) {
|
if (dist_between_waypoints > 0) {
|
||||||
_pos_ctrl_state = GOTO_WAYPOINT; // A new waypoint has arrived go to it
|
_pos_ctrl_state = GOTO_WAYPOINT; // A new waypoint has arrived go to it
|
||||||
}
|
}
|
||||||
|
|
||||||
//PX4_INFO(" Distance between prev and curr waypoints %f", (double)dist_between_waypoints);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -422,8 +413,6 @@ RoverPositionControl::Run()
|
|||||||
|
|
||||||
_global_local_proj_ref.initReference(_local_pos.ref_lat, _local_pos.ref_lon,
|
_global_local_proj_ref.initReference(_local_pos.ref_lat, _local_pos.ref_lon,
|
||||||
_local_pos.ref_timestamp);
|
_local_pos.ref_timestamp);
|
||||||
|
|
||||||
_global_local_alt0 = _local_pos.ref_alt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert Local setpoints to global setpoints
|
// Convert Local setpoints to global setpoints
|
||||||
@@ -435,7 +424,6 @@ RoverPositionControl::Run()
|
|||||||
_trajectory_setpoint.position[0], _trajectory_setpoint.position[1],
|
_trajectory_setpoint.position[0], _trajectory_setpoint.position[1],
|
||||||
_pos_sp_triplet.current.lat, _pos_sp_triplet.current.lon);
|
_pos_sp_triplet.current.lat, _pos_sp_triplet.current.lon);
|
||||||
|
|
||||||
_pos_sp_triplet.current.alt = _global_local_alt0 - _trajectory_setpoint.position[2];
|
|
||||||
_pos_sp_triplet.current.valid = true;
|
_pos_sp_triplet.current.valid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,7 +439,7 @@ RoverPositionControl::Run()
|
|||||||
if (control_position(current_position, ground_speed, _pos_sp_triplet)) {
|
if (control_position(current_position, ground_speed, _pos_sp_triplet)) {
|
||||||
|
|
||||||
//TODO: check if radius makes sense here
|
//TODO: check if radius makes sense here
|
||||||
float turn_distance = _param_l1_distance.get(); //_gnd_control.switch_distance(100.0f);
|
float turn_distance = _param_l1_distance.get();
|
||||||
|
|
||||||
// publish status
|
// publish status
|
||||||
position_controller_status_s pos_ctrl_status{};
|
position_controller_status_s pos_ctrl_status{};
|
||||||
|
|||||||
@@ -139,7 +139,6 @@ private:
|
|||||||
hrt_abstime _manual_setpoint_last_called{0};
|
hrt_abstime _manual_setpoint_last_called{0};
|
||||||
|
|
||||||
MapProjection _global_local_proj_ref{};
|
MapProjection _global_local_proj_ref{};
|
||||||
float _global_local_alt0{NAN};
|
|
||||||
|
|
||||||
/* Pid controller for the speed. Here we assume we can control airspeed but the control variable is actually on
|
/* Pid controller for the speed. Here we assume we can control airspeed but the control variable is actually on
|
||||||
the throttle. For now just assuming a proportional scaler between controlled airspeed and throttle output.*/
|
the throttle. For now just assuming a proportional scaler between controlled airspeed and throttle output.*/
|
||||||
|
|||||||
@@ -46,9 +46,6 @@
|
|||||||
#include "uuv_att_control.hpp"
|
#include "uuv_att_control.hpp"
|
||||||
|
|
||||||
|
|
||||||
#define ACTUATOR_PUBLISH_PERIOD_MS 4
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UUV attitude control app start / stop handling function
|
* UUV attitude control app start / stop handling function
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user