Skip to content
Snippets Groups Projects
Commit 08b300b2 authored by David Schiebener's avatar David Schiebener
Browse files

added HandUnitSimulation

parent 40771c89
No related branches found
No related tags found
No related merge requests found
...@@ -21,5 +21,6 @@ add_subdirectory(PlatformUnitObserver) ...@@ -21,5 +21,6 @@ add_subdirectory(PlatformUnitObserver)
add_subdirectory(RobotStateComponent) add_subdirectory(RobotStateComponent)
add_subdirectory(RobotStateObserver) add_subdirectory(RobotStateObserver)
add_subdirectory(HandUnitObserver) add_subdirectory(HandUnitObserver)
add_subdirectory(HandUnitSimulation)
add_subdirectory(ForceTorqueUnitSimulation) add_subdirectory(ForceTorqueUnitSimulation)
armarx_component_set_name("HandUnitSimulation")
find_package(Eigen3 QUIET)
armarx_build_if(Eigen3_FOUND "Eigen3 not available")
if (Eigen3_FOUND)
include_directories(
${Eigen3_INCLUDE_DIR})
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::HandUnitSimulation
* @author David Schiebener ( schiebener at kit dot edu )
* @date 2014
* @copyright http://www.gnu.org/licenses/gpl.txt
* GNU General Public License
*/
#ifndef _ARMARX_APPLICATION_RobotAPI_HandUnitSimulation_H
#define _ARMARX_APPLICATION_RobotAPI_HandUnitSimulation_H
#include <RobotAPI/units/HandUnitSimulation.h>
#include <Core/core/application/Application.h>
namespace armarx
{
/**
* @class HandUnitSimulationApp
* @brief A brief description
*
* Detailed Description
*/
class HandUnitSimulationApp :
virtual public armarx::Application
{
/**
* @see armarx::Application::setup()
*/
void setup(const ManagedIceObjectRegistryInterfacePtr& registry,
Ice::PropertiesPtr properties)
{
registry->addObject( Component::create<HandUnitSimulation>(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::HandUnitSimulation
* @author David Schiebener ( schiebener at kit dot edu )
* @date 2014
* @copyright http://www.gnu.org/licenses/gpl.txt
* GNU General Public License
*/
#include "HandUnitSimulationApp.h"
#include <Core/core/logging/Logging.h>
int main(int argc, char* argv[])
{
armarx::ApplicationPtr app = armarx::Application::createInstance < armarx::HandUnitSimulationApp > ();
app->setName("HandUnitSimulation");
return app->main(argc, argv);
}
...@@ -39,6 +39,7 @@ set(LIB_HEADERS ...@@ -39,6 +39,7 @@ set(LIB_HEADERS
HandUnit.h HandUnit.h
HandUnitObserver.h HandUnitObserver.h
HandUnitSimulation.h
HardwareUnit.h HardwareUnit.h
KinematicUnit.h KinematicUnit.h
KinematicUnitSimulation.h KinematicUnitSimulation.h
...@@ -62,6 +63,7 @@ set(LIB_FILES ...@@ -62,6 +63,7 @@ set(LIB_FILES
HandUnit.cpp HandUnit.cpp
HandUnitObserver.cpp HandUnitObserver.cpp
HandUnitSimulation.cpp
HardwareUnit.cpp HardwareUnit.cpp
KinematicUnit.cpp KinematicUnit.cpp
KinematicUnitSimulation.cpp KinematicUnitSimulation.cpp
......
...@@ -76,7 +76,8 @@ void HandUnit::onInitComponent() ...@@ -76,7 +76,8 @@ void HandUnit::onInitComponent()
for (size_t i=0;i<actors.size();i++) for (size_t i=0;i<actors.size();i++)
{ {
EndEffectorActorPtr a = actors[i]; EndEffectorActorPtr a = actors[i];
std::vector<EndEffectorActor::ActorDefinition> ads = a->getDefinition(); ARMARX_WARNING_S << "here is a hack to make the stuff compile - but it will probably crash when run!";
std::vector<EndEffectorActor::ActorDefinition> ads;// = a->getDefinition();
for (size_t j=0;j<ads.size();j++) for (size_t j=0;j<ads.size();j++)
{ {
EndEffectorActor::ActorDefinition ad = ads[j]; EndEffectorActor::ActorDefinition ad = ads[j];
......
/*
* 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 ArmarXCore::units
* @author David Schiebener (schiebener at kit dot edu)
* @date 2014
* @copyright http://www.gnu.org/licenses/gpl.txt
* GNU General Public License
*/
#include "HandUnitSimulation.h"
using namespace armarx;
void HandUnitSimulation::onInitHandUnit()
{
}
void HandUnitSimulation::onStartHandUnit()
{
}
void HandUnitSimulation::onExitHandUnit()
{
}
void HandUnitSimulation::open(const Ice::Current& c)
{
}
void HandUnitSimulation::close(const Ice::Current& c)
{
}
void HandUnitSimulation::preshape(const std::string& preshapeName, const Ice::Current& c)
{
}
/*
* 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 ArmarXCore::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_CORE_UNITS_HANDUNITSIMULATION_H
#define _ARMARX_CORE_UNITS_HANDUNITSIMULATION_H
#include "HandUnit.h"
namespace armarx
{
/**
* @class HandUnitSimulationPropertyDefinitions
* @brief Defines all necessary properties for armarx::HandUnitSimulation
* @ingroup SensorActorUnits
*/
class HandUnitSimulationPropertyDefinitions:
public ComponentPropertyDefinitions
{
public:
HandUnitSimulationPropertyDefinitions(std::string prefix):
ComponentPropertyDefinitions(prefix)
{
defineRequiredProperty<std::string>("RobotFileName","VirtualRobot XML file in which the endeffector is is stored.");
defineRequiredProperty<std::string>("EndeffectorName","Name of the endeffector as stored in the XML file (will publish values on EndeffectorName + 'State')");
}
};
/**
* @class HandUnitSimulation
* @brief This class defines an interface for providing high level access to robot hands
* @ingroup SensorActorUnits
*
* An instance of a HandUnitSimulation provides means to open, close, and preshape hands.
* It uses the HandUnitListener Ice interface to report updates of its current state
*
*/
class HandUnitSimulation :
virtual public HandUnit
{
public:
// inherited from Component
virtual std::string getDefaultName() const
{
return "HandUnitSimulation";
}
/**
*
*/
virtual void onInitHandUnit();
/**
*
*/
virtual void onStartHandUnit();
/**
*
*/
virtual void onExitHandUnit();
/**
* Send command to the hand to open all fingers.
*/
virtual void open(const Ice::Current& c = ::Ice::Current());
/**
* Send command to the hand to close all fingers.
*/
virtual void close(const Ice::Current& c = ::Ice::Current());
/**
* Send command to the hand to form a specific preshape position.
*/
virtual void preshape(const std::string& preshapeName, const Ice::Current& c = ::Ice::Current());
protected:
};
}
#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