-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--------- Co-authored-by: cjsport11 <[email protected]> Co-authored-by: Brandon-Liu <[email protected]> Co-authored-by: Mihir Laud <[email protected]> Co-authored-by: Rocky14683 <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
168215d
commit 89a77d1
Showing
41 changed files
with
776 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
|
||
#include "VOSS/utils/Pose.hpp" | ||
|
||
namespace voss::controller { | ||
|
||
class AbstractExitCondition { | ||
|
||
protected: | ||
Pose target_pose; | ||
bool target_has_coordinate() const; | ||
bool target_has_heading() const; | ||
|
||
public: | ||
virtual bool is_met(Pose current_pose, bool thru) = 0; | ||
virtual void set_target(Pose target); | ||
virtual void reset(); | ||
}; | ||
|
||
} // namespace voss::controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
#include "../utils/Pose.hpp" | ||
#include "AbstractExitCondition.hpp" | ||
#include <functional> | ||
namespace voss::controller { | ||
class CustomExitCondition : public AbstractExitCondition { | ||
private: | ||
std::function<bool()> callback; | ||
|
||
public: | ||
CustomExitCondition(std::function<bool()> callback); | ||
bool is_met(Pose current_pose, bool thru) override; | ||
}; | ||
} // namespace voss::controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#pragma once | ||
|
||
#include "AbstractExitCondition.hpp" | ||
#include "ToleranceExitCondition.hpp" | ||
#include "VOSS/utils/Pose.hpp" | ||
#include <functional> | ||
#include <memory> | ||
#include <vector> | ||
|
||
namespace voss::controller { | ||
|
||
class ExitConditions : public AbstractExitCondition { | ||
|
||
private: | ||
std::vector<std::shared_ptr<controller::AbstractExitCondition>> conditions; | ||
ExitConditions(); | ||
|
||
public: | ||
static ExitConditions new_conditions(); | ||
|
||
void set_target(voss::Pose new_target) override; | ||
ExitConditions& add_settle(int settle_time, double tolerance, | ||
int initial_delay); | ||
ExitConditions& add_timeout(int timeout); | ||
ExitConditions& add_tolerance(double linear_tolerance, | ||
double angular_tolerance); | ||
ExitConditions& add_thru_smoothness(double smoothness); | ||
ExitConditions& add_custom_condition(std::function<bool()> callback); | ||
ExitConditions& add_condition(std::shared_ptr<AbstractExitCondition> ec); | ||
|
||
std::shared_ptr<ExitConditions> exit_if(std::function<bool()> callback); | ||
|
||
bool is_met(voss::Pose current_pose, bool thru); | ||
bool all_met(voss::Pose current_pose, bool thru); | ||
|
||
std::shared_ptr<ExitConditions> build(); | ||
|
||
void reset() override; | ||
}; | ||
|
||
} // namespace voss::controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
#include "AbstractExitCondition.hpp" | ||
#include "VOSS/utils/Pose.hpp" | ||
|
||
namespace voss::controller { | ||
class PrepLineExitCondition : public AbstractExitCondition { | ||
private: | ||
double thru_smoothness; | ||
|
||
public: | ||
PrepLineExitCondition(double thru_smoothness); | ||
bool is_met(voss::Pose pose, bool thru) override; | ||
}; | ||
} // namespace voss::controller |
Oops, something went wrong.