9#include <Ice/Current.h>
10#include <Ice/Object.h>
11#include <IceUtil/Time.h>
13#include <VirtualRobot/VirtualRobot.h>
20#include <RobotAPI/interface/aron/Aron.h>
21#include <RobotAPI/interface/units/RobotUnit/NJointController.h>
23#include <armarx/control/interface/ConfigurableNJointControllerInterface.h>
24#include <armarx/view_selection/gaze_controller/ice/GazeControllerStatus.h>
31 class ControlTarget1DoFActuatorPosition;
69 virtual public armarx::control::ConfigurableNJointControllerInterface
72 using ConfigPtrT = control::ConfigurableNJointControllerConfigPtr;
75 const NJointControllerConfigPtr& config,
80 void updateConfig(const ::armarx::aron::data::dto::DictPtr& dto,
81 const Ice::Current& iceCurrent = Ice::emptyCurrent)
override;
84 getConfig(const ::Ice::Current& = ::Ice::emptyCurrent)
override;
94 std::string
getClassName(
const Ice::Current& = Ice::emptyCurrent)
const override;
97 void rtRun(
const IceUtil::Time& sensorValuesTimestamp,
98 const IceUtil::Time& timeSinceLastIteration)
override;
114 std::string _rtGazeNodeName;
115 VirtualRobot::RobotNodePtr _rtYawNode;
116 VirtualRobot::RobotNodePtr _rtPitchNode;
117 VirtualRobot::RobotNodePtr _rtCameraNode;
120 armarx::ControlTarget1DoFActuatorPosition* _rtPitchCtrlTarget;
121 armarx::ControlTarget1DoFActuatorPosition* _rtYawCtrlTarget;
122 float* _rtPitchCtrlPos;
123 float* _rtYawCtrlPos;
126 mutable std::recursive_mutex _tripRt2NonRtMutex;
131 GazeControllerStatusListenerPrx _statusTopic;
133 std::atomic<float> _publishCurrentPitchAngle = 0.0;
134 std::atomic<float> _publishCurrentYawAngle = 0.0;
135 std::atomic<float> _publishTargetPitchAngle = 0.0;
136 std::atomic<float> _publishTargetYawAngle = 0.0;
137 std::atomic<float> _publishAngularError = 0.0;
138 std::atomic<float> _publishLateralError = 0.0;
#define TYPEDEF_PTRS_HANDLE(T)
NJointControllerWithTripleBuffer(const Config &initialCommands=Config())
A simple triple buffer for lockfree comunication between a single writer and a single reader.
Collects the gaze residual on the control side and reports it on a topic.
std::string getClassName(const Ice::Current &=Ice::emptyCurrent) const override
::armarx::aron::data::dto::DictPtr getConfig(const ::Ice::Current &=::Ice::emptyCurrent) override
GazeController(RobotUnitPtr robotUnit, const NJointControllerConfigPtr &config, const VirtualRobot::RobotPtr &robot)
void onPublish(const SensorAndControl &, const DebugDrawerInterfacePrx &, const DebugObserverInterfacePrx &) override
void onInitNJointController() override
~GazeController() override
void rtPostDeactivateController() override
This function is called after the controller is deactivated.
void rtRun(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration) override
TODO make protected and use attorneys.
void onConnectNJointController() override
void updateConfig(const ::armarx::aron::data::dto::DictPtr &dto, const Ice::Current &iceCurrent=Ice::emptyCurrent) override
void rtPreActivateController() override
This function is called before the controller is activated.
control::ConfigurableNJointControllerConfigPtr ConfigPtrT
std::shared_ptr< class Robot > RobotPtr
::IceInternal::Handle< Dict > DictPtr
::armarx::view_selection::gaze_targets::GazeTarget Target
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
IceUtil::Handle< class RobotUnit > RobotUnitPtr
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface > DebugDrawerInterfacePrx
detail::ControlThreadOutputBufferEntry SensorAndControl
armarx::view_selection::gaze_controller::Target target
std::int64_t targetId
Identifies this control target; echoed back in the status reports.
std::string cameraNodeName
std::string pitchNodeName
std::string gazeRootNodeName