Torque.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 #include <VirtualRobot/VirtualRobot.h>
5 
7 
9 
10 // #include <armarx/control/njoint_controller/ControllerInterface.h>
11 
12 #include <RobotAPI/interface/units/RobotUnit/NjointZeroTorqueController.h>
13 
15 {
17  {
18  Ice::FloatSeq targetTorques;
19  };
20 
22 
24  public NJointControllerWithTripleBuffer<NJointTorqueControllerTarget>,
25  public NJointTorqueControllerInterface
26  {
27  public:
28  using ConfigPtrT = NJointTorqueControllerConfigPtr;
29  NJointTorqueController(RobotUnitPtr prov, const NJointTorqueControllerConfigPtr& config, const VirtualRobot::RobotPtr&);
30 
31  // NJointControllerInterface interface
32  std::string getClassName(const Ice::Current&) const override;
33  // WidgetDescription::StringWidgetDictionary getFunctionDescriptions(const Ice::Current&) const override;
34  // void callDescribedFunction(const std::string& name, const StringVariantBaseMap& valueMap, const Ice::Current&) override;
35 
36  // NJointController interface
37  void rtRun(const IceUtil::Time& sensorValuesTimestamp, const IceUtil::Time& timeSinceLastIteration) override;
40  const std::map<std::string, ConstControlDevicePtr>&,
41  const std::map<std::string, ConstSensorDevicePtr>&);
42 
43  static NJointTorqueControllerConfigPtr GenerateConfigFromVariants(const StringVariantBaseMap& values);
44  protected:
45  void rtPreActivateController() override;
46  void rtPostDeactivateController() override;
47 
48  std::vector<ControlTarget1DoFActuatorTorque*> targets;
50 
51  // NJointTorqueControllerInterface interface
52  public:
53  void setControllerTarget(const Ice::FloatSeq&, const Ice::Current&) override;
54  };
55 
56 } // namespace armarx
armarx::control::njoint_controller::joint_space::NJointTorqueControllerTarget::targetTorques
Ice::FloatSeq targetTorques
Definition: Torque.h:18
armarx::StringVariantBaseMap
std::map< std::string, VariantBasePtr > StringVariantBaseMap
Definition: ManagedIceObject.h:111
armarx::control::njoint_controller::joint_space::NJointTorqueController::GenerateConfigFromVariants
static NJointTorqueControllerConfigPtr GenerateConfigFromVariants(const StringVariantBaseMap &values)
Definition: Torque.cpp:106
armarx::control::njoint_controller::joint_space::NJointTorqueController::getClassName
std::string getClassName(const Ice::Current &) const override
Definition: Torque.cpp:14
armarx::NJointControllerWithTripleBuffer
Definition: NJointControllerWithTripleBuffer.h:10
armarx::control::njoint_controller::joint_space::NJointTorqueController::NJointTorqueController
NJointTorqueController(RobotUnitPtr prov, const NJointTorqueControllerConfigPtr &config, const VirtualRobot::RobotPtr &)
Definition: Torque.cpp:19
ProsthesisInterface.values
values
Definition: ProsthesisInterface.py:190
armarx::control::njoint_controller::joint_space::NJointTorqueController::targets
std::vector< ControlTarget1DoFActuatorTorque * > targets
Definition: Torque.h:48
armarx::NJointControllerBase::ConfigPtrT
NJointControllerConfigPtr ConfigPtrT
Definition: NJointControllerBase.h:586
armarx::control::njoint_controller::joint_space::NJointTorqueController
Definition: Torque.h:23
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::control::njoint_controller::joint_space::NJointTorqueController::rtRun
void rtRun(const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration) override
TODO make protected and use attorneys.
Definition: Torque.cpp:46
armarx::control::njoint_controller::joint_space
Definition: Torque.cpp:9
ControlTarget1DoFActuator.h
max
T max(T t1, T t2)
Definition: gdiam.h:48
armarx::control::njoint_controller::joint_space::NJointTorqueController::GenerateConfigDescription
static WidgetDescription::WidgetPtr GenerateConfigDescription(const VirtualRobot::RobotPtr &, const std::map< std::string, ConstControlDevicePtr > &, const std::map< std::string, ConstSensorDevicePtr > &)
Definition: Torque.cpp:54
armarx::control::njoint_controller::joint_space::TYPEDEF_PTRS_HANDLE
TYPEDEF_PTRS_HANDLE(NJointTorqueController)
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
armarx::control::njoint_controller::joint_space::NJointTorqueController::rtPreActivateController
void rtPreActivateController() override
This function is called before the controller is activated.
Definition: Torque.cpp:41
NJointController.h
armarx::control::njoint_controller::joint_space::NJointTorqueControllerTarget
Definition: Torque.h:16
armarx::control::njoint_controller::joint_space::NJointTorqueController::rtPostDeactivateController
void rtPostDeactivateController() override
This function is called after the controller is deactivated.
Definition: Torque.cpp:115
armarx::control::njoint_controller::joint_space::NJointTorqueController::setControllerTarget
void setControllerTarget(const Ice::FloatSeq &, const Ice::Current &) override
Definition: Torque.cpp:229
armarx::control::njoint_controller::joint_space::NJointTorqueController::maxTorque
float maxTorque
Definition: Torque.h:49
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18