Skip to content

Commit

Permalink
MulticoperPositionControl: 3rd pass get rid of zombie members
Browse files Browse the repository at this point in the history
  • Loading branch information
MaEtUgR committed Dec 1, 2020
1 parent e46a917 commit e28af51
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 383 deletions.
5 changes: 4 additions & 1 deletion src/modules/flight_mode_manager/FlightModeManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@
#include <px4_platform_common/module_params.h>
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
#include <lib/flight_tasks/FlightTasks.hpp>
#include <Takeoff.hpp>

#include <uORB/Subscription.hpp>
#include <uORB/SubscriptionCallback.hpp>
#include <uORB/Publication.hpp>
#include <uORB/topics/parameter_update.h>
#include <uORB/topics/vehicle_attitude_setpoint.h>
#include <uORB/topics/vehicle_control_mode.h>
Expand All @@ -49,6 +50,8 @@
#include <uORB/topics/vehicle_local_position_setpoint.h>
#include <uORB/topics/vehicle_status.h>

#include "Takeoff/Takeoff.hpp"

class FlightModeManager : public ModuleBase<FlightModeManager>, public ModuleParams, public px4::WorkItem
{
public:
Expand Down
2 changes: 0 additions & 2 deletions src/modules/mc_pos_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#
############################################################################

add_subdirectory(Takeoff)
add_subdirectory(PositionControl)

px4_add_module(
Expand All @@ -50,5 +49,4 @@ px4_add_module(
ecl_geo
WeatherVane
CollisionPrevention
Takeoff2
)
4 changes: 4 additions & 0 deletions src/modules/mc_pos_control/MulticopterPositionControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

#include "MulticopterPositionControl.hpp"

#include <float.h>
#include <lib/mathlib/mathlib.h>
#include <lib/matrix/matrix/math.hpp>

using namespace time_literals;
using namespace matrix;

Expand Down
31 changes: 3 additions & 28 deletions src/modules/mc_pos_control/MulticopterPositionControl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,27 @@
#include <lib/controllib/blocks.hpp>
#include <lib/flight_tasks/FlightTasks.hpp>
#include <lib/hysteresis/hysteresis.h>
#include <lib/mathlib/mathlib.h>
#include <lib/matrix/matrix/math.hpp>
#include <lib/perf/perf_counter.h>
#include <lib/systemlib/mavlink_log.h>
#include <lib/weather_vane/WeatherVane.hpp>
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/defines.h>
#include <px4_platform_common/module.h>
#include <px4_platform_common/module_params.h>
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
#include <px4_platform_common/posix.h>
#include <px4_platform_common/tasks.h>
#include <uORB/Publication.hpp>

#include <uORB/Subscription.hpp>
#include <uORB/SubscriptionCallback.hpp>
#include <uORB/topics/home_position.h>
#include <uORB/topics/landing_gear.h>
#include <uORB/Publication.hpp>
#include <uORB/topics/hover_thrust_estimate.h>
#include <uORB/topics/parameter_update.h>
#include <uORB/topics/vehicle_attitude_setpoint.h>
#include <uORB/topics/vehicle_control_mode.h>
#include <uORB/topics/vehicle_land_detected.h>
#include <uORB/topics/vehicle_local_position.h>
#include <uORB/topics/vehicle_local_position_setpoint.h>
#include <uORB/topics/vehicle_status.h>
#include <uORB/topics/vehicle_trajectory_waypoint.h>
#include <uORB/topics/hover_thrust_estimate.h>

#include "PositionControl/PositionControl.hpp"
#include "Takeoff/Takeoff.hpp"

#include <float.h>

class MulticopterPositionControl : public ModuleBase<MulticopterPositionControl>, public control::SuperBlock,
public ModuleParams, public px4::WorkItem
Expand All @@ -95,8 +85,6 @@ class MulticopterPositionControl : public ModuleBase<MulticopterPositionControl>
private:
void Run() override;

Takeoff _takeoff; /**< state machine and ramp to bring the vehicle off the ground without jumps */

uORB::Publication<vehicle_attitude_setpoint_s> _vehicle_attitude_setpoint_pub;
orb_advert_t _mavlink_log_pub{nullptr};

Expand All @@ -114,21 +102,8 @@ class MulticopterPositionControl : public ModuleBase<MulticopterPositionControl>

int _task_failure_count{0}; /**< counter for task failures */

/**< vehicle-land-detection: initialze to landed */
vehicle_land_detected_s _vehicle_land_detected = {
.timestamp = 0,
.alt_max = -1.0f,
.freefall = false,
.ground_contact = true,
.maybe_landed = true,
.landed = true,
};

vehicle_control_mode_s _control_mode{}; /**< vehicle control mode */
vehicle_local_position_s _local_pos{}; /**< vehicle local position */
home_position_s _home_pos{}; /**< home position */
landing_gear_s _landing_gear{};
int8_t _old_landing_gear_position{landing_gear_s::GEAR_KEEP};

DEFINE_PARAMETERS(
// Position Control
Expand Down
40 changes: 0 additions & 40 deletions src/modules/mc_pos_control/Takeoff/CMakeLists.txt

This file was deleted.

132 changes: 0 additions & 132 deletions src/modules/mc_pos_control/Takeoff/Takeoff.cpp

This file was deleted.

101 changes: 0 additions & 101 deletions src/modules/mc_pos_control/Takeoff/Takeoff.hpp

This file was deleted.

Loading

0 comments on commit e28af51

Please sign in to comment.