25#include <VirtualRobot/VirtualRobot.h>
29#include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h>
38 class SensorValue1DoFActuatorPosition;
99 void _postFinishDeviceInitialization();
115 const std::vector<VirtualRobot::RobotNodePtr>& nodes)
const;
208 return controlThreadOutputBuffer;
218 return controlThreadOutputBuffer.getWriteBuffer();
227 return controlThreadOutputBuffer.commitWrite();
241 std::set<NJointControllerBasePtr, std::greater<NJointControllerBasePtr>> ctrls);
270 mutable std::recursive_mutex controllersRequestedMutex;
277 mutable std::recursive_mutex controllersActivatedMutex;
283 mutable std::recursive_mutex
284 controlThreadOutputBufferMutex;
This Module manages all communication into and out of the ControlThread.
virtual void checkSetOfControllersToActivate(const JointAndNJointControllers &) const
This hook is called prior to writing the set of requested controllers.
std::vector< NJointControllerBase * > getActivatedNJointControllers() const
Returns the set of activated NJointControllers.
bool sensorAndControlBufferChanged() const
Updates the sensor and control buffer and returns whether the buffer was updated.
bool activatedControllersChanged() const
Returns whether the set of activated Joint- and NJointControllers changed.
void setActivateControllersRequest(std::set< NJointControllerBasePtr, std::greater< NJointControllerBasePtr > > ctrls)
Sets the set of requested NJointControllers to.
JointAndNJointControllers getActivatedControllers() const
TODO private + attorney for publish.
const SensorAndControl & getSensorAndControlBuffer() const
TODO private + attorney for publish.
friend class ControlThreadDataBufferAttorneyForControlThread
TODO use this mutex instead of the global one.
ControlThreadOutputBuffer & getControlThreadOutputBuffer()
Returns the ControlThreadOutputBuffer.
SensorAndControl & rtGetSensorAndControlBuffer()
Returns the writer buffer for sensor and control values.
void rtSensorAndControlBufferCommitWrite()
Commits the writer buffer for sensor and control values.
std::vector< JointController * > copyRequestedJointControllers() const
Returns the set of requsted JointControllers.
JointAndNJointControllers copyRequestedControllers() const
Returns the set of requsted Joint- and NJointControllers.
std::vector< NJointControllerBase * > copyRequestedNJointControllers() const
Returns the set of requsted NJointControllers.
static ControlThreadDataBuffer & Instance()
Returns the singleton instance of this class.
void updateVirtualRobot(const VirtualRobot::RobotPtr &robot) const
Updates the given VirtualRobot with the current joint values.
std::vector< JointController * > getActivatedJointControllers() const
Returns the set of activated JointControllers.
static ModuleBase & Instance()
Returns the singleton instance of this class.
Same as the TripleBuffer, but partial writes of the data structure are ok. The write operation may be...
std::shared_ptr< class Robot > RobotPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
detail::ControlThreadOutputBufferEntry SensorAndControl
Structure used by the RobotUnit to swap lists of Joint and NJoint controllers.