-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #244 from RI-SE/feature_distanceBasedTrigger
Feature distance based trigger
- Loading branch information
Showing
15 changed files
with
351 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#trigger_ip;trigger_index;trigger_type[parameter];action_type[parameter];action[parameter]; | ||
10.168.15.58;3;DI[RISING_EDGE];SERVER[127.0.0.1];SEND_START[2000]; | ||
#trigger_ip;trigger_type[parameter];action_ip;action_type[parameter]; | ||
127.0.0.1;DISTANCE[TO:(x:5.3y:2.5z:2.1),LESS_THAN,5.0];0.0.0.0;TEST_SCENARIO_COMMAND[START,0]; |
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,55 @@ | ||
#ifndef DISTANCETRIGGER_H | ||
#define DISTANCETRIGGER_H | ||
|
||
#include "booleantrigger.h" | ||
|
||
#include <set> | ||
#include <vector> | ||
#include <string> | ||
|
||
class DistanceTrigger : public BooleanTrigger | ||
{ | ||
public: | ||
DistanceTrigger(TriggerID_t triggerID); | ||
|
||
TriggerReturnCode_t appendParameter(std::string inputStr) override; | ||
TriggerReturnCode_t parseParameters() override; | ||
|
||
using BooleanTrigger::update; | ||
TriggerReturnCode_t update(MonitorDataType newValue) override; | ||
|
||
void setTriggerDistance(double distance_m) { this->triggerDistance_m = distance_m; } | ||
void setReferencePoint(CartesianPosition point) { this->referencePoint = point; } | ||
|
||
double getTriggerDistance(void) const { return this->triggerDistance_m; } | ||
CartesianPosition getReferencePoint(void) const { return this->referencePoint; } | ||
private: | ||
static constexpr CartesianPosition defaultReferencePoint = {0.0, 0.0, 0.0, 0.0, true, false}; | ||
|
||
double triggerDistance_m; | ||
CartesianPosition referencePoint; | ||
enum {LESS_THAN, GREATER_THAN} oper = LESS_THAN; | ||
|
||
const std::set<TriggerParameter_t> getAcceptedParameters() const override | ||
{ | ||
std::set<TriggerParameter_t> accParams; | ||
accParams.insert(TRIGGER_PARAMETER_X); | ||
accParams.insert(TRIGGER_PARAMETER_Y); | ||
accParams.insert(TRIGGER_PARAMETER_Z); | ||
accParams.insert(TRIGGER_PARAMETER_EQUAL_TO); | ||
accParams.insert(TRIGGER_PARAMETER_GREATER_THAN); | ||
accParams.insert(TRIGGER_PARAMETER_GREATER_THAN_OR_EQUAL_TO); | ||
accParams.insert(TRIGGER_PARAMETER_LESS_THAN); | ||
accParams.insert(TRIGGER_PARAMETER_LESS_THAN_OR_EQUAL_TO); | ||
accParams.insert(TRIGGER_PARAMETER_NOT_EQUAL_TO); | ||
accParams.insert(TRIGGER_PARAMETER_RELATIVE); | ||
accParams.insert(TRIGGER_PARAMETER_ABSOLUTE); | ||
accParams.insert(TRIGGER_PARAMETER_MIN); | ||
accParams.insert(TRIGGER_PARAMETER_MAX); | ||
accParams.insert(TRIGGER_PARAMETER_MEAN); | ||
return accParams; | ||
} | ||
|
||
TriggerReturnCode_t parseNumericParameter(std::string inputStr); | ||
}; | ||
#endif // DISTANCETRIGGER_H |
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
Oops, something went wrong.