4#include <boost/shared_ptr.hpp>
8#include <VirtualRobot/VirtualRobot.h>
14#include <armarx/control/deprecated_njoint_mp_controller/joint_space/ControllerInterface.h>
16#include <dmp/general/vec.h>
17#include <dmp/representation/systemstatus.h>
21 class SensorValue1DoFActuatorTorque;
22 class SensorValue1DoFActuatorVelocity;
23 class SensorValue1DoFActuatorPosition;
24 class ControlTarget1DoFActuatorTorque;
25 class ControlTarget1DoFActuatorVelocity;
31 using UMIDMPPtr = ::boost::shared_ptr<class UMIDMP>;
54 using ConfigPtrT = NJointJointSpaceDMPControllerConfigPtr;
56 const NJointControllerConfigPtr& config,
60 std::string
getClassName(
const Ice::Current&)
const override;
63 void rtRun(
const IceUtil::Time& sensorValuesTimestamp,
64 const IceUtil::Time& timeSinceLastIteration)
override;
72 void learnDMPFromFiles(
const Ice::StringSeq& fileNames,
const Ice::Current&)
override;
73 void setSpeed(
double times,
const Ice::Current&)
override;
75 void runDMP(
const Ice::DoubleSeq& goals,
double times,
const Ice::Current&)
override;
81 const Ice::Current&)
override;
82 void setViaPoints(Ice::Double u,
double viapoint,
const Ice::Current&)
override;
84 void setMPWeights(
const DoubleSeqSeq& weights,
const Ice::Current&)
override;
97 NJointJointSpaceDMPControllerConfigPtr cfg;
99 struct DebugBufferData
101 StringFloatDictionary latestTargetVelocities;
102 StringFloatDictionary latestTargets;
104 double currentCanVal;
110 struct NJointJSDMPControllerSensorData
114 DMP::Vec<DMP::DMPState> currentState;
121 Eigen::VectorXf qpos;
122 Eigen::VectorXf qvel;
128 std::map<std::string, const SensorValue1DoFActuatorPosition*> positionSensors;
129 std::map<std::string, const SensorValue1DoFActuatorVelocity*> velocitySensors;
130 std::map<std::string, ControlTarget1DoFActuatorVelocity*>
targets;
136 DMP::Vec<DMP::DMPState> currentState;
137 DMP::Vec<DMP::DMPState> currentDMPState;
154 std::vector<std::string> dimNames;
155 DMP::DVec targetState;
156 Eigen::VectorXf targetVels;
160 Eigen::VectorXf qpos;
161 Eigen::VectorXf qvel;
#define TYPEDEF_PTRS_HANDLE(T)
NJointControllerWithTripleBuffer(const NJointJSDMPControllerControlData &initialCommands=NJointJSDMPControllerControlData())
std::recursive_mutex MutexType
A simple triple buffer for lockfree comunication between a single writer and a single reader.
Eigen::VectorXf targetJointVels
The NJointJSDMPController class.
virtual void onPublish(const SensorAndControl &, const DebugDrawerInterfacePrx &, const DebugObserverInterfacePrx &) override
void onInitNJointController() override
void runDMP(const Ice::DoubleSeq &goals, double times, const Ice::Current &) override
bool isFinished(const Ice::Current &) override
void setMPWeights(const DoubleSeqSeq &weights, const Ice::Current &) override
void onDisconnectNJointController() override
void learnDMPFromFiles(const Ice::StringSeq &fileNames, const Ice::Current &) override
NJointJSDMPController(const RobotUnitPtr &robotUnit, const NJointControllerConfigPtr &config, const VirtualRobot::RobotPtr &)
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 setSpeed(double times, const Ice::Current &) override
std::vector< double > createDMPFromString(const std::string &dmpString, const Ice::Current &) override
NJointJointSpaceDMPControllerConfigPtr ConfigPtrT
void setViaPoints(Ice::Double u, double viapoint, const Ice::Current &) override
std::string getClassName(const Ice::Current &) const override
void rtPreActivateController() override
This function is called before the controller is activated.
Brief description of class targets.
DoubleSeqSeq getMPWeights()
boost::shared_ptr< class UMIDMP > UMIDMPPtr
std::shared_ptr< class Robot > RobotPtr
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