Commit 3732144f authored by mastefan's avatar mastefan
Browse files

SM: Reset of variables(not testet/compiled yet)

parent 92060c44
......@@ -238,6 +238,93 @@ void buttonPressed_integrator_off(){
void buttonPressed_integrator_reset(){
ROS_INFO("[DRONEX CONTROLLER-DroneXControllerService] RESET integrator to zero");
integratorFlag = DRONEX_INTEGRATOR_RESET;
//New:
m_time_ticks = 0;
integrator_sum_XYZ = {0,0,0};
tookOffFlag = false;
approachedFlag = false;
landedFlag = false;
savedStartCoordinates = false;
tol_takeoff = std::fill(tol_takeoff.begin(), tol_takeoff.end(), 0);
tol_approach = std::fill(tol_approach.begin(), tol_approach.end(), 0);
tol_land = std::fill(tol_land.begin(), tol_land.end(), 0);
/*std::vector<float> tol_takeoff (3, 0.0);
std::vector<float> tol_approach (3, 0.0);
std::vector<float> tol_land (3, 0.0);
*/
trajectory_start_time = 0;
total_time_since_start = 0;
first_trajectory_calculation = true;
trajectory_deltaT_position = 0;
trajectory_deltaT_velocity = 0;
xcf0 = std::fill(xcf0.begin(), xcf0.end(), 0);
xm1 = std::fill(xm1.begin(), xm1.end(), 0);
xm2 = std::fill(xm2.begin(), xm2.end(), 0);
xm3 = std::fill(xm3.begin(), xm3.end(), 0);
/*std::vector<float> xm1(3, 0.0);
std::vector<float> xm2(3, 0.0);
std::vector<float> xms(3, 0.0);
*/
trajectory_duration_1 = 0; // Duration of flight between xcf0 and xm1
trajectory_duration_2 = 0; // Duration of flight between xm1 and xm2
trajectory_duration_3 = 0; // Duration of flight between xm2 and xms
trajectory_t0 = 0; // Time when Button pressed to land on mothership
trajectory_t1 = 0; // Time at xm1
trajectory_t2 = 0; // Time at xm2
xm1_normalizing_factor = 3; // normalize the difference between xcf0 and xms
xm1_scaling_factor = 0.6;
xm2_distance_to_ms_at_zero_velocity = 0.6;
xm2_distance_to_ms_scaling_factor = 1;
trajectory_velocity_of_CF; // fetched from yaml
trajectory_total_distance = 0;
trajectory_duration = 0;
// returned trajectory setpoint & velocity
trajectory_setpoint = {0,0,0,0}; // x,y,z,yaw
trajectory_velocity = {0,0,0}; // x,y,z
// Origin of the Flying zone
//float originX = 0;
//float originY = 0;
// > The setpoints for (x,y,z) position and yaw angle, in that order
m_setpoint = {0.0,0.0,0.0,0.0};
m_setpoint_for_controller = {0.0,0.0,0.0,0.0};
// > The velocities for (x,y,z) position, in that order
m_velocity = {0.0,0.0,0.0};
m_velocity_for_controller = {0.0,0.0,0.0};
// > Small adjustments to the x-y setpoint
m_xAdjustment = 0.0f;
m_yAdjustment = 0.0f;
// Boolean for whether to limit rate of change of the setpoint
m_shouldSmoothSetpointChanges = false;
prev_MS_pos = {0,0,0};
current_MS_pos = {0,0,0};
mothership_vel = {0,0,0};
// thrust factor to do a smooth landing
thrust_factor = 1;
reset_rviz = false;
flightSequence = 0;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment