Skip to content
Snippets Groups Projects
Commit 0346d5d3 authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Add error state to NJointController

parent 873611ab
No related branches found
No related tags found
No related merge requests found
......@@ -214,6 +214,7 @@ namespace armarx
deactivatedBecauseOfError = false;
rtPreActivateController();
isActive = true;
errorState.store(false);
}
}
......
......@@ -708,6 +708,12 @@ namespace armarx
* calculates a \ref ControlTargetBase "ControlTarget" for.
*/
const std::vector<std::size_t>& rtGetControlDeviceUsedIndices() const;
/**
* @brief Sets the error state to true. This will deactivate this controller!
*/
bool rtGetErrorState() const;
protected:
/**
* @brief This function is called before the controller is activated.
......@@ -720,6 +726,10 @@ namespace armarx
*/
virtual void rtPostDeactivateController() {}
/**
* @brief Sets the error state to true. This will deactivate this controller!
*/
void rtSetErrorState();
private:
/**
* @brief Activates this controller in the \ref RobotUnitModules::ControlThread "ControlThread".
......@@ -809,6 +819,7 @@ namespace armarx
std::atomic_bool isActive {false};
std::atomic_bool isRequested {false};
std::atomic_bool deactivatedBecauseOfError {false};
std::atomic_bool errorState {false};
bool deletable {false};
bool internal {false};
......
......@@ -195,6 +195,15 @@ namespace armarx
{
}
inline void NJointController::rtSetErrorState()
{
errorState.store(true);
}
inline bool NJointController::rtGetErrorState() const
{
return errorState;
}
//NJointControllerWithTripleBuffer<ControlDataStruct>
template <typename ControlDataStruct>
inline void NJointControllerWithTripleBuffer<ControlDataStruct>::rtSwapBufferAndRun(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment