Skip to content
Snippets Groups Projects
Commit 28c6c7f8 authored by Peter Kaiser's avatar Peter Kaiser
Browse files

Removed HandUnitObserver

parent 319de4ef
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@ add_subdirectory(PlatformUnitSimulation)
add_subdirectory(PlatformUnitObserver)
add_subdirectory(RobotStateComponent)
add_subdirectory(RobotIK)
add_subdirectory(HandUnitObserver)
add_subdirectory(HandUnitSimulation)
add_subdirectory(ForceTorqueUnitSimulation)
......
armarx_component_set_name("HandUnitObserverApp")
#find_package(MyLib QUIET)
#armarx_build_if(MyLib_FOUND "MyLib not available")
#
# all include_directories must be guarded by if(Xyz_FOUND)
# for multiple libraries write: if(X_FOUND AND Y_FOUND)....
#if(MyLib_FOUND)
# include_directories(${MyLib_INCLUDE_DIRS})
#endif()
set(COMPONENT_LIBS RobotAPIUnits ArmarXInterfaces ArmarXCore)
set(EXE_SOURCE main.cpp)
armarx_add_component_executable("${EXE_SOURCE}")
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package RobotAPI::application::HandUnitObserver
* @author Mirko Waechter ( mirko dot waechter at kit dot edu )
* @date 2014
* @copyright http://www.gnu.org/licenses/gpl.txt
* GNU General Public License
*/
#ifndef _ARMARX_APPLICATION_RobotAPI_HandUnitObserver_H
#define _ARMARX_APPLICATION_RobotAPI_HandUnitObserver_H
#include <RobotAPI/components/units/HandUnitObserver.h>
#include <Core/core/application/Application.h>
namespace armarx
{
/**
* @class HandUnitObserverApp
* @brief A brief description
*
* Detailed Description
*/
class HandUnitObserverApp :
virtual public armarx::Application
{
/**
* @see armarx::Application::setup()
*/
void setup(const ManagedIceObjectRegistryInterfacePtr& registry,
Ice::PropertiesPtr properties)
{
registry->addObject( Component::create<HandUnitObserver>(properties) );
}
};
}
#endif
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package RobotAPI::application::HandUnitObserver
* @author Mirko Waechter ( mirko dot waechter at kit dot edu )
* @date 2014
* @copyright http://www.gnu.org/licenses/gpl.txt
* GNU General Public License
*/
#include "HandUnitObserverApp.h"
#include <Core/core/logging/Logging.h>
int main(int argc, char* argv[])
{
armarx::ApplicationPtr app = armarx::Application::createInstance < armarx::HandUnitObserverApp > ();
app->setName("HandUnitObserver");
return app->main(argc, argv);
}
......@@ -36,7 +36,6 @@ set(LIB_HEADERS
TCPControlUnitObserver.h
HandUnit.h
HandUnitObserver.h
HandUnitSimulation.h
BusInspectionUnit.h
KinematicUnit.h
......@@ -61,7 +60,6 @@ set(LIB_FILES
TCPControlUnitObserver.cpp
HandUnit.cpp
HandUnitObserver.cpp
HandUnitSimulation.cpp
BusInspectionUnit.cpp
KinematicUnit.cpp
......
#include "HandUnitObserver.h"
#include <Core/observers/checks/ConditionCheckEquals.h>
#include <Core/observers/checks/ConditionCheckUpdated.h>
using namespace armarx;
void HandUnitObserver::onInitObserver()
{
/*usingTopic("LeftHandState");
usingTopic("RightHandState");
offerChannel("leftHand", "Gives information about the state of the left robot hand.");
offerDataField("leftHand", "isOpen", VariantType::Bool, "Is true when the hand is open, false if not.");
setDataField("leftHand", "isOpen", false);
offerDataField("leftHand", "isClosed", VariantType::Bool, "Is true when the hand is closed, false if not.");
setDataField("leftHand", "isClosed", false);
offerDataField("leftHand", "shapeName", VariantType::String, "Contains the name of the current hand shape.");
setDataField("leftHand", "shapeName", "unknown");
updateChannel("leftHand");
offerChannel("rightHand", "Gives information about the state of the right robot hand.");
offerDataField("rightHand", "isOpen", VariantType::Bool, "Is true when the hand is open, false if not.");
setDataField("rightHand", "isOpen", false);
offerDataField("rightHand", "isClosed", VariantType::Bool, "Is true when the hand is closed, false if not.");
setDataField("rightHand", "isClosed", false);
offerDataField("rightHand", "shapeName", VariantType::String, "Contains the name of the current hand shape.");
setDataField("rightHand", "shapeName", "unknown");
updateChannel("rightHand");
offerConditionCheck("equals", new armarx::ConditionCheckEquals());
offerConditionCheck("updated", new armarx::ConditionCheckUpdated());*/
}
void HandUnitObserver::onConnectObserver()
{
}
void HandUnitObserver::onExitObserver()
{
}
/*
void HandUnitObserver::reportHandClosed(bool isLeftHand, const Ice::Current&)
{
if (isLeftHand)
{
setDataField("leftHand", "isOpen", false);
setDataField("leftHand", "isClosed", true);
updateChannel("leftHand");
}
else
{
setDataField("rightHand", "isOpen", false);
setDataField("rightHand", "isClosed", true);
updateChannel("rightHand");
}
}
void HandUnitObserver::reportHandOpened(bool isLeftHand, const Ice::Current&)
{
if (isLeftHand)
{
setDataField("leftHand", "isOpen", true);
setDataField("leftHand", "isClosed", false);
updateChannel("leftHand");
}
else
{
setDataField("rightHand", "isOpen", true);
setDataField("rightHand", "isClosed", false);
updateChannel("rightHand");
}
}
*/
void HandUnitObserver::reportHandShaped(const std::string &handName, const std::string &shapeName, const Ice::Current&)
{
// todo
/*if (isLeftHand)
{
setDataField("leftHand", "isOpen", false);
setDataField("leftHand", "isClosed", false);
updateChannel("leftHand");
}
else
{
setDataField("rightHand", "isOpen", false);
setDataField("rightHand", "isClosed", false);
updateChannel("rightHand");
}*/
}
void HandUnitObserver::reportNewHandShapeName(const std::string &handName, const std::string& handShapeName, const Ice::Current&)
{
// todo
/*if (isLeftHand)
{
setDataField("leftHand", "shapeName", handShapeName);
updateChannel("leftHand");
}
else
{
setDataField("rightHand", "shapeName", handShapeName);
updateChannel("rightHand");
}*/
}
void armarx::HandUnitObserver::reportJointAngles(const armarx::NameValueMap &actualJointAngles, const Ice::Current &)
{
}
void HandUnitObserver::reportJointPressures(const NameValueMap &actualJointPressures, const Ice::Current &)
{
}
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package RobotAPI::units
* @author David Schiebener <schiebener at kit dot edu>
* @date 2014
* @copyright http://www.gnu.org/licenses/gpl.txt
* GNU General Public License
*/
#ifndef _ARMARX_ROBOTAPI_HAND_UNIT_OBSERVER_H
#define _ARMARX_ROBOTAPI_HAND_UNIT_OBSERVER_H
#include <RobotAPI/interface/units/HandUnitInterface.h>
#include <Core/observers/Observer.h>
namespace armarx
{
class HandUnitObserverPropertyDefinitions:
public ComponentPropertyDefinitions
{
public:
HandUnitObserverPropertyDefinitions(std::string prefix):
ComponentPropertyDefinitions(prefix)
{
//defineRequiredProperty<std::string>("HapticTopicName", "Name of the HapticUnit Topic");
}
};
// TODO !!!
/**
* @class HandUnitObserver
* @ingroup RobotAPI-SensorActorUnits-observers
* @brief The HandUnitObserver class
*/
class HandUnitObserver :
virtual public Observer,
virtual public HandUnitObserverInterface
{
public:
HandUnitObserver(){}
// framework hooks
virtual std::string getDefaultName() const { return "HandUnitObserver"; }
virtual void onInitObserver();
virtual void onConnectObserver();
virtual void onExitObserver();
// observer interface
// implementation: todo...
virtual void reportHandShaped(const std::string &handName, const std::string &shapeName, const ::Ice::Current& = ::Ice::Current());
virtual void reportNewHandShapeName(const std::string &handName, const ::std::string& handShapeName, const ::Ice::Current& = ::Ice::Current());
void reportJointAngles(const NameValueMap &actualJointAngles, const Ice::Current& = ::Ice::Current());
void reportJointPressures(const NameValueMap &actualJointPressures, const Ice::Current& = ::Ice::Current());
/**
* @see PropertyUser::createPropertyDefinitions()
*/
//virtual PropertyDefinitionsPtr createPropertyDefinitions();
private:
};
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment