diff --git a/source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointController.cpp b/source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointController.cpp index 5d34536c610128cb23086e8c782249fe9a41e706..a127273c7551352855d23e762cb70b5ff3b5bfba 100644 --- a/source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointController.cpp +++ b/source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointController.cpp @@ -130,10 +130,10 @@ namespace armarx return ds; } - RobotUnitInterfacePrx NJointControllerBase::getRobotUnit(const Ice::Current&) const - { - return RobotUnitInterfacePrx::uncheckedCast(robotUnit.getProxy(-1)); - } +// RobotUnitInterfacePrx NJointControllerBase::getRobotUnit(const Ice::Current&) const +// { +// return RobotUnitInterfacePrx::uncheckedCast(robotUnit.getProxy(-1)); +// } void NJointControllerBase::activateController(const Ice::Current&) { diff --git a/source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointControllerBase.h b/source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointControllerBase.h index cad19193568ecff7c8e97766b89036d0b88b8e26..81afaef0dfdd8dd3de5fb84edb6f718e5cefd0d1 100644 --- a/source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointControllerBase.h +++ b/source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointControllerBase.h @@ -761,7 +761,7 @@ namespace armarx NJointControllerDescription getControllerDescription(const Ice::Current& = Ice::emptyCurrent) const final override; NJointControllerStatus getControllerStatus(const Ice::Current& = Ice::emptyCurrent) const final override; NJointControllerDescriptionWithStatus getControllerDescriptionWithStatus(const Ice::Current& = Ice::emptyCurrent) const final override; - RobotUnitInterfacePrx getRobotUnit(const Ice::Current& = Ice::emptyCurrent) const final override; + //RobotUnitInterfacePrx getRobotUnit(const Ice::Current& = Ice::emptyCurrent) const final override; void activateController(const Ice::Current& = Ice::emptyCurrent) final override; void deactivateController(const Ice::Current& = Ice::emptyCurrent) final override; diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointController.ice index 7e07c41de1e1096a3be5a16bad3a9bd5809c52c4..f1056467092843c4928f63ba9dcba119ac8c0ebd 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointController.ice @@ -22,7 +22,80 @@ #pragma once +#include <ArmarXGui/interface/WidgetDescription.ice> -#include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.ice> +#include <ArmarXCore/interface/core/UserException.ice> +#include <ArmarXCore/interface/core/BasicTypes.ice> + +module armarx +{ + interface NJointControllerInterface; + + + module RobotUnitControllerNames + { + const string NJointTrajectoryController = "NJointTrajectoryController"; + const string NJointGlobalTCPController = "NJointGlobalTCPController"; /*@@@TODO: move NJointGlobalTCPController to RobotAPI */ + const string NJointTCPController = "NJointTCPController"; + const string NJointCartesianVelocityController = "NJointCartesianVelocityController"; + }; + + + class NJointControllerConfig {}; + + struct NJointControllerDescription + { + string instanceName; + string className; + NJointControllerInterface* controller; + StringStringDictionary controlModeAssignment; + bool deletable; + bool internal; + }; + sequence<NJointControllerDescription> NJointControllerDescriptionSeq; + + struct NJointControllerStatus + { + string instanceName; + bool active = false; + bool requested = false; + bool error = false; + long timestampUSec = 0; + }; + sequence<NJointControllerStatus> NJointControllerStatusSeq; + + struct NJointControllerDescriptionWithStatus + { + NJointControllerStatus status; + NJointControllerDescription description; + }; + sequence<NJointControllerDescriptionWithStatus> NJointControllerDescriptionWithStatusSeq; + + interface NJointControllerInterface + { + ["cpp:const"] idempotent string getClassName(); + ["cpp:const"] idempotent string getInstanceName(); + ["cpp:const"] idempotent StringStringDictionary getControlDeviceUsedControlModeMap(); + ["cpp:const"] idempotent bool isControllerActive(); + ["cpp:const"] idempotent bool isControllerRequested(); + ["cpp:const"] idempotent bool isDeletable(); + ["cpp:const"] idempotent bool hasControllerError(); + ["cpp:const"] idempotent NJointControllerStatus getControllerStatus(); + ["cpp:const"] idempotent NJointControllerDescription getControllerDescription(); + ["cpp:const"] idempotent NJointControllerDescriptionWithStatus getControllerDescriptionWithStatus(); + // This method is not used by anybody and just produces cyclic dependencies + // If you were able to create/get an NJointController, you know the RobotUnit already. + //["cpp:const"] idempotent RobotUnitInterface* getRobotUnit(); + + void activateController(); + void deactivateController(); + void deleteController() throws LogicError; + void deactivateAndDeleteController() throws LogicError; + + ["cpp:const"] idempotent WidgetDescription::StringWidgetDictionary getFunctionDescriptions(); + void callDescribedFunction(string fuinctionName, StringVariantBaseMap values) throws InvalidArgumentException; + }; + + dictionary<string, NJointControllerInterface*> StringNJointControllerPrxDictionary; +}; -//see RobotUnitInterface.ice (zeroc broke forward declarations) diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointTaskSpaceDMPController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointTaskSpaceDMPController.ice index 84614f0d5d98bb23fc63a14bc4c0a237189b2779..178edf202298befc0236ca0e048cc65456601e44 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointTaskSpaceDMPController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointTaskSpaceDMPController.ice @@ -25,6 +25,8 @@ #include <RobotAPI/interface/units/RobotUnit/NJointController.ice> #include <RobotAPI/interface/core/Trajectory.ice> +#include <ArmarXCore/interface/serialization/Eigen.ice> + module armarx { module NJointTaskSpaceDMPControllerMode diff --git a/source/RobotAPI/interface/units/RobotUnit/RobotUnitInterface.ice b/source/RobotAPI/interface/units/RobotUnit/RobotUnitInterface.ice index e6c33056b1d99cf0950cf0fcb5a59a3f893ddc82..f59b430191bb535cf527d0d3a624849102385756 100644 --- a/source/RobotAPI/interface/units/RobotUnit/RobotUnitInterface.ice +++ b/source/RobotAPI/interface/units/RobotUnit/RobotUnitInterface.ice @@ -41,82 +41,14 @@ #include <RobotAPI/interface/visualization/DebugDrawerInterface.ice> #include <RobotAPI/interface/components/RobotHealthInterface.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> #include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXGui/interface/WidgetDescription.ice> //NJointController -module armarx -{ - interface NJointControllerInterface; - interface RobotUnitInterface; - - - module RobotUnitControllerNames - { - const string NJointTrajectoryController = "NJointTrajectoryController"; - const string NJointGlobalTCPController = "NJointGlobalTCPController"; /*@@@TODO: move NJointGlobalTCPController to RobotAPI */ - const string NJointTCPController = "NJointTCPController"; - const string NJointCartesianVelocityController = "NJointCartesianVelocityController"; - }; - - - class NJointControllerConfig {}; - - struct NJointControllerDescription - { - string instanceName; - string className; - NJointControllerInterface* controller; - StringStringDictionary controlModeAssignment; - bool deletable; - bool internal; - }; - sequence<NJointControllerDescription> NJointControllerDescriptionSeq; - - struct NJointControllerStatus - { - string instanceName; - bool active = false; - bool requested = false; - bool error = false; - long timestampUSec = 0; - }; - sequence<NJointControllerStatus> NJointControllerStatusSeq; - - struct NJointControllerDescriptionWithStatus - { - NJointControllerStatus status; - NJointControllerDescription description; - }; - sequence<NJointControllerDescriptionWithStatus> NJointControllerDescriptionWithStatusSeq; - - interface NJointControllerInterface - { - ["cpp:const"] idempotent string getClassName(); - ["cpp:const"] idempotent string getInstanceName(); - ["cpp:const"] idempotent StringStringDictionary getControlDeviceUsedControlModeMap(); - ["cpp:const"] idempotent bool isControllerActive(); - ["cpp:const"] idempotent bool isControllerRequested(); - ["cpp:const"] idempotent bool isDeletable(); - ["cpp:const"] idempotent bool hasControllerError(); - ["cpp:const"] idempotent NJointControllerStatus getControllerStatus(); - ["cpp:const"] idempotent NJointControllerDescription getControllerDescription(); - ["cpp:const"] idempotent NJointControllerDescriptionWithStatus getControllerDescriptionWithStatus(); - ["cpp:const"] idempotent RobotUnitInterface* getRobotUnit(); - - void activateController(); - void deactivateController(); - void deleteController() throws LogicError; - void deactivateAndDeleteController() throws LogicError; - - ["cpp:const"] idempotent WidgetDescription::StringWidgetDictionary getFunctionDescriptions(); - void callDescribedFunction(string fuinctionName, StringVariantBaseMap values) throws InvalidArgumentException; - }; - dictionary<string, NJointControllerInterface*> StringNJointControllerPrxDictionary; -}; //RobotUnit Utility types - ControlDevice module armarx