Skip to content

Commit

Permalink
IGoalInput without IUpdatable
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Aug 3, 2017
1 parent e3c9472 commit 52c3200
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 8 deletions.
1 change: 1 addition & 0 deletions AirLib/AirLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<ClInclude Include="include\firmwares\simple_flight\firmware\interfaces\IBoardSensors.hpp" />
<ClInclude Include="include\firmwares\simple_flight\firmware\interfaces\ICommLink.hpp" />
<ClInclude Include="include\firmwares\simple_flight\firmware\interfaces\IController.hpp" />
<ClInclude Include="include\firmwares\simple_flight\firmware\interfaces\IFirmware.hpp" />
<ClInclude Include="include\firmwares\simple_flight\firmware\interfaces\IGoalInput.hpp" />
<ClInclude Include="include\firmwares\simple_flight\firmware\interfaces\IStateEstimator.hpp" />
<ClInclude Include="include\firmwares\simple_flight\firmware\interfaces\IUpdatable.hpp" />
Expand Down
3 changes: 3 additions & 0 deletions AirLib/AirLib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@
<ClInclude Include="include\firmwares\simple_flight\SimpleFlightDroneController.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\firmwares\simple_flight\firmware\interfaces\IFirmware.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\safety\ObstacleMap.cpp">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class AngleLevelController :
virtual void reset() override
{
IAxisController::reset();
IGoalInput::reset();

pid_->reset();
rate_controller_->reset();
Expand All @@ -56,7 +55,6 @@ class AngleLevelController :
virtual void update() override
{
IAxisController::update();
IGoalInput::update();

//get response of level PID
const auto& level_goal = goal_input_->getGoal();
Expand Down
3 changes: 2 additions & 1 deletion AirLib/include/firmwares/simple_flight/firmware/Firmware.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "interfaces/IBoard.hpp"
#include "interfaces/ICommLink.hpp"
#include "interfaces/IStateEstimator.hpp"
#include "interfaces/IFirmware.hpp"
#include "Params.hpp"
#include "RemoteControl.hpp"
#include "Mixer.hpp"
Expand All @@ -13,7 +14,7 @@

namespace simple_flight {

class Firmware {
class Firmware : public IFirmware {
public:
Firmware(const Params* params, IBoard* board, ICommLink* comm_link, IStateEstimator* state_estimator)
: params_(params), board_(board), comm_link_(comm_link),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

namespace simple_flight {

class RemoteControl : public IGoalInput {
class RemoteControl :
public IGoalInput,
public IUpdatable {
public:
RemoteControl(const Params* params, const IBoardClock* clock, const IBoardInputPins* board_inputs, ICommLink* comm_link)
: params_(params), clock_(clock), board_inputs_(board_inputs), comm_link_(comm_link)
Expand All @@ -18,7 +20,7 @@ class RemoteControl : public IGoalInput {

virtual void reset() override
{
IGoalInput::reset();
IUpdatable::reset();

goal_ = Axis4r::zero();
goal_mode_ = params_->default_goal_mode;
Expand All @@ -32,8 +34,8 @@ class RemoteControl : public IGoalInput {

virtual void update() override
{
IGoalInput::update();

IUpdatable::update();
uint64_t time = clock_->millis();

//don't keep reading if not updated
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include "IUpdatable.hpp"
#include <cstdint>

namespace simple_flight {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include "IUpdatable.hpp"

namespace simple_flight {

class IFirmware : public IUpdatable {
public:

};

} //namespace
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace simple_flight {

class IGoalInput : public IUpdatable {
class IGoalInput {
public:
virtual const Axis4r& getGoal() const = 0;
virtual const GoalMode& getGoalMode() const = 0;
Expand Down

0 comments on commit 52c3200

Please sign in to comment.