Skip to content
Snippets Groups Projects
Commit 2eadcae0 authored by Simon Ottenhaus's avatar Simon Ottenhaus
Browse files

added OptoForce OMD driver

parent c6df7483
No related branches found
No related tags found
No related merge requests found
Showing
with 843 additions and 0 deletions
# - Try to find OptoForceOMD
# Once done this will define
#
# OptoForceOMD_FOUND - OptoForceOMD found
# OptoForceOMD_INCLUDE_DIR - the OptoForceOMD include directory
# OptoForceOMD_LIBRARIES - OptoForceOMD library
#
FIND_PATH(OptoForceOMD_INCLUDE_DIR NAMES opto.h
PATHS
$ENV{OptoForceOMD_DIR}/include/
$ENV{OptoForceOMD_DIR}/include/OptoForceOMD/
${OptoForceOMD_DIR}/include/
${OptoForceOMD_DIR}/include/OptoForceOMD/
ENV CPATH
/usr/include/OptoForceOMD/
/usr/local/include/OptoForceOMD/
/opt/local/include/OptoForceOMD/
NO_DEFAULT_PATH
)
FIND_LIBRARY(OptoForceOMD_LIBRARIES NAMES libOMD.so
PATHS
$ENV{OptoForceOMD_DIR}/lib
${OptoForceOMD_DIR}/lib
ENV LD_LIBRARY_PATH
ENV LIBRARY_PATH
/usr/lib
/usr/local/lib
/opt/local/lib
NO_DEFAULT_PATH
)
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set OODL_YOUBOT_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(OptoForceOMD DEFAULT_MSG
OptoForceOMD_LIBRARIES OptoForceOMD_INCLUDE_DIR)
set(OptoForceOMD_FOUND ${OPTOFORCEOMD_FOUND}) # CMake UPPERCASE-FUNTIME!
#message( "OptoForceOMD_FOUND:" ${OptoForceOMD_FOUND})
#message( "OPTOFORCEOMD_FOUND:" ${OPTOFORCEOMD_FOUND})
#message( "OptoForceOMD_LIBRARIES:" ${OptoForceOMD_LIBRARIES})
#message( "OptoForceOMD_INCLUDE_DIR:" ${OptoForceOMD_INCLUDE_DIR})
# show the OptoForceOMD_INCLUDE_DIR and OptoForceOMD_LIBRARY_DIR variables only in the advanced view
MARK_AS_ADVANCED(OptoForceOMD_INCLUDE_DIR OptoForceOMD_LIBRARIES)
<?xml version="1.0" encoding="utf-8"?>
<scenario name="OptoForceUnit" lastChange="2017-03-03.15:11:46" creation="2017-03-03.15:11:40" globalConfigName="./config/global.cfg" package="RobotAPI">
<application name="OptoForceUnitApp" instance="" package="RobotAPI"/>
</scenario>
# ==================================================================
# OptoForceUnitApp properties
# ==================================================================
# ArmarX.AdditionalPackages: List of additional ArmarX packages which should be in the list of default packages. If you have custom packages, which should be found by the gui or other apps, specify them here. Comma separated List.
# Attributes:
# - Default: Default value not mapped.
# - Case sensitivity: no
# - Required: no
# ArmarX.AdditionalPackages = Default value not mapped.
# ArmarX.ApplicationName: Application name
# Attributes:
# - Default: ""
# - Case sensitivity: no
# - Required: no
# ArmarX.ApplicationName = ""
# ArmarX.CachePath: Path for cache files
# Attributes:
# - Default: ${HOME}/.armarx/mongo/.cache
# - Case sensitivity: no
# - Required: no
# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache
# ArmarX.Config: Comma-separated list of configuration files
# Attributes:
# - Default: ""
# - Case sensitivity: no
# - Required: no
# ArmarX.Config = ""
# ArmarX.DataPath: Semicolon-separated search list for data files
# Attributes:
# - Default: ""
# - Case sensitivity: no
# - Required: no
# ArmarX.DataPath = ""
# ArmarX.DefaultPackages: List of ArmarX packages which are accessible by default. Comma separated List. If you want to add your own packages and use all default ArmarX packages, use the property 'AdditionalPackages'.
# Attributes:
# - Default: Default value not mapped.
# - Case sensitivity: no
# - Required: no
# ArmarX.DefaultPackages = Default value not mapped.
# ArmarX.DependenciesConfig: Path to the (usually generated) config file containing all data paths of all dependent projects. This property usually does not need to be edited.
# Attributes:
# - Default: ./config/dependencies.cfg
# - Case sensitivity: no
# - Required: no
# ArmarX.DependenciesConfig = ./config/dependencies.cfg
# ArmarX.DisableLogging: Turn logging off in whole application
# Attributes:
# - Default: 0
# - Case sensitivity: no
# - Required: no
# ArmarX.DisableLogging = 0
# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application
# Attributes:
# - Default: 0
# - Case sensitivity: no
# - Required: no
# ArmarX.EnableProfiling = 0
# ArmarX.OptoForceUnit.EnableProfiling: enable profiler which is used for logging performance events
# Attributes:
# - Default: 0
# - Case sensitivity: no
# - Required: no
# ArmarX.OptoForceUnit.EnableProfiling = 0
# ArmarX.OptoForceUnit.MinimumLoggingLevel: Local logging level only for this component
# Attributes:
# - Default: Undefined
# - Case sensitivity: no
# - Required: no
# ArmarX.OptoForceUnit.MinimumLoggingLevel = Undefined
# ArmarX.OptoForceUnit.ObjectName: Name of IceGrid well-known object
# Attributes:
# - Default: ""
# - Case sensitivity: no
# - Required: no
# ArmarX.OptoForceUnit.ObjectName = ""
# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog
# Attributes:
# - Default: 1
# - Case sensitivity: no
# - Required: no
# ArmarX.RedirectStdout = 1
# ArmarX.RemoteHandlesDeletionTimeout: The timeout (in ms) before a remote handle deletes the managed object after the use count reached 0. This time can be used by a client to increment the count again (may be required when transmitting remote handles)
# Attributes:
# - Default: 3000
# - Case sensitivity: no
# - Required: no
# ArmarX.RemoteHandlesDeletionTimeout = 3000
# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger.
# Attributes:
# - Default: 0
# - Case sensitivity: no
# - Required: no
# ArmarX.StartDebuggerOnCrash = 0
# ArmarX.TopicSuffix: Suffix appended to all topic names for outgoing topics. This is mainly used to direct all topics to another name for TopicReplaying purposes.
# Attributes:
# - Default: ""
# - Case sensitivity: no
# - Required: no
# ArmarX.TopicSuffix = ""
# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator)
# Attributes:
# - Default: 0
# - Case sensitivity: no
# - Required: no
# ArmarX.UseTimeServer = 0
# ArmarX.Verbosity: Global logging level for whole application
# Attributes:
# - Default: Info
# - Case sensitivity: no
# - Required: no
# ArmarX.Verbosity = Info
# Ice.Config: Custom Property
# Attributes:
# - Default: ::NOT_DEFINED::
# - Case sensitivity: no
# - Required: no
# Ice.Config = ::NOT_DEFINED::
# ==================================================================
# Global Config from Scenario OptoForceUnit
# ==================================================================
......@@ -21,3 +21,5 @@ add_subdirectory(XsensIMU)
add_subdirectory(InertialMeasurementUnitObserver)
add_subdirectory(ViewSelection)
add_subdirectory(OptoForceUnit)
armarx_component_set_name("OptoForceUnitApp")
find_package(OptoForceOMD QUIET)
armarx_build_if(OptoForceOMD_FOUND "OptoForceOMD not available")
if(OptoForceOMD_FOUND)
include_directories(${OptoForceOMD_INCLUDE_DIR})
endif()
#message("OptoForceOMD_INCLUDE_DIR: " ${OptoForceOMD_INCLUDE_DIR})
#message("OptoForceOMD_LIBRARIES: " ${OptoForceOMD_LIBRARIES})
set(COMPONENT_LIBS ArmarXCoreInterfaces ArmarXCore ${OptoForceOMD_LIBRARIES})
set(COMPONENT_LIBS
ArmarXCoreInterfaces
ArmarXCore
OptoForceUnit
)
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 General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 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::OptoForceUnit
* @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
* @date 2017
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include <RobotAPI/drivers/OptoForceUnit/OptoForceUnit.h>
#include <ArmarXCore/core/application/Application.h>
#include <ArmarXCore/core/Component.h>
#include <ArmarXCore/core/logging/Logging.h>
int main(int argc, char* argv[])
{
return armarx::runSimpleComponentApp < armarx::OptoForceUnit > (argc, argv, "OptoForceUnit");
}
add_subdirectory(WeissHapticSensor)
add_subdirectory(XsensIMU)
add_subdirectory(OptoForceUnit)
armarx_component_set_name("OptoForce")
find_package(OptoForceOMD QUIET)
armarx_build_if(OptoForceOMD_FOUND "OptoForceOMD not available 11elf!")
if(OptoForceOMD_FOUND)
include_directories(${OptoForceOMD_INCLUDE_DIR})
endif()
set(COMPONENT_LIBS ArmarXCoreInterfaces ArmarXCore OMD)
set(SOURCES
OptoForce.cpp
#@TEMPLATE_LINE@@COMPONENT_PATH@/@COMPONENT_NAME@.cpp
)
set(HEADERS
OptoForce.h
#@TEMPLATE_LINE@@COMPONENT_PATH@/@COMPONENT_NAME@.h
)
armarx_add_component("${SOURCES}" "${HEADERS}")
# add unit tests
add_subdirectory(test)
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 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::ArmarXObjects::OptoForce
* @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
* @date 2017
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include "OptoForce.h"
using namespace armarx;
void OptoForce::onInitComponent()
{
}
void OptoForce::onConnectComponent()
{
}
void OptoForce::onDisconnectComponent()
{
}
void OptoForce::onExitComponent()
{
}
armarx::PropertyDefinitionsPtr OptoForce::createPropertyDefinitions()
{
return armarx::PropertyDefinitionsPtr(new OptoForcePropertyDefinitions(
getConfigIdentifier()));
}
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 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::ArmarXObjects::OptoForce
* @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
* @date 2017
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#ifndef _ARMARX_COMPONENT_RobotAPI_OptoForce_H
#define _ARMARX_COMPONENT_RobotAPI_OptoForce_H
#include <ArmarXCore/core/Component.h>
#include <opto.h>
namespace armarx
{
/**
* @class OptoForcePropertyDefinitions
* @brief
*/
class OptoForcePropertyDefinitions:
public armarx::ComponentPropertyDefinitions
{
public:
OptoForcePropertyDefinitions(std::string prefix):
armarx::ComponentPropertyDefinitions(prefix)
{
//defineRequiredProperty<std::string>("PropertyName", "Description");
//defineOptionalProperty<std::string>("PropertyName", "DefaultValue", "Description");
}
};
/**
* @defgroup Component-OptoForce OptoForce
* @ingroup RobotAPI-Components
* A description of the component OptoForce.
*
* @class OptoForce
* @ingroup Component-OptoForce
* @brief Brief description of class OptoForce.
*
* Detailed description of class OptoForce.
*/
class OptoForce :
virtual public armarx::Component
{
public:
/**
* @see armarx::ManagedIceObject::getDefaultName()
*/
virtual std::string getDefaultName() const
{
return "OptoForce";
}
protected:
/**
* @see armarx::ManagedIceObject::onInitComponent()
*/
virtual void onInitComponent();
/**
* @see armarx::ManagedIceObject::onConnectComponent()
*/
virtual void onConnectComponent();
/**
* @see armarx::ManagedIceObject::onDisconnectComponent()
*/
virtual void onDisconnectComponent();
/**
* @see armarx::ManagedIceObject::onExitComponent()
*/
virtual void onExitComponent();
/**
* @see PropertyUser::createPropertyDefinitions()
*/
virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions();
};
}
#endif
# Libs required for the tests
SET(LIBS ${LIBS} ArmarXCore OptoForce)
armarx_add_test(OptoForceTest OptoForceTest.cpp "${LIBS}")
\ No newline at end of file
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 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::ArmarXObjects::OptoForceOMD
* @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
* @date 2017
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#define BOOST_TEST_MODULE RobotAPI::ArmarXObjects::OptoForceOMD
#define ARMARX_BOOST_TEST
#include <RobotAPI/Test.h>
#include <RobotAPI/components/OptoForceOMD/OptoForceOMD.h>
#include <iostream>
BOOST_AUTO_TEST_CASE(testExample)
{
armarx::OptoForceOMD instance;
BOOST_CHECK_EQUAL(true, true);
}
armarx_component_set_name("OptoForceUnit")
find_package(OptoForceOMD QUIET)
armarx_build_if(OptoForceOMD_FOUND "OptoForceOMD not available")
if(OptoForceOMD_FOUND)
include_directories(${OptoForceOMD_INCLUDE_DIR})
endif()
#message("OptoForceOMD_INCLUDE_DIR: " ${OptoForceOMD_INCLUDE_DIR})
#message("OptoForceOMD_LIBRARIES: " ${OptoForceOMD_LIBRARIES})
set(COMPONENT_LIBS ArmarXCoreInterfaces ArmarXCore ${OptoForceOMD_LIBRARIES})
set(SOURCES
./OptoForceUnit.cpp
#@TEMPLATE_LINE@@COMPONENT_PATH@/@COMPONENT_NAME@.cpp
)
set(HEADERS
./OptoForceUnit.h
#@TEMPLATE_LINE@@COMPONENT_PATH@/@COMPONENT_NAME@.h
)
armarx_add_component("${SOURCES}" "${HEADERS}")
# add unit tests
add_subdirectory(test)
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 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::ArmarXObjects::OptoForceUnit
* @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
* @date 2017
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include "OptoForceUnit.h"
using namespace armarx;
void OptoForceUnit::onInitComponent()
{
OPort* portlist = ports.listPorts(true);
ARMARX_INFO << "Found " << ports.getLastSize() << " Optoforce device(s).";
int numPorts = ports.getLastSize();
ARMARX_INFO << "number of ports: " << numPorts;
OPort* portListNew = ports.listPorts(true);
for (int i = 0; i < ports.getLastSize(); i++)
{
ARMARX_INFO << "Port liste new: " << portListNew[i].name;
}
ARMARX_INFO << "number of ports: " << ports.getLastSize();
if (ports.getLastSize() > 0)
{
for (int i = 0; i < ports.getLastSize(); ++i)
{
ARMARX_INFO << "Opening port #" << i << "...";
if (i == 0)
{
daq.open(portlist[i]);
ARMARX_INFO << "opened port 1";
}
if (daq.getVersion() == _95 || daq.getVersion() == _64)
{
ARMARX_IMPORTANT << "Wrong sensor type! (not 3D)";
daq.close();
return;
}
}
}
readTask = new RunningTask<OptoForceUnit>(this, &OptoForceUnit::run, "OptoForceUnit");
readTask->start();
}
void OptoForceUnit::onConnectComponent()
{
}
void OptoForceUnit::run()
{
ARMARX_IMPORTANT << "run";
SensorConfig config = daq.getConfig();
int state = config.getState();
int speed = config.getSpeed();
int filter = config.getFilter();
int mode = config.getMode();
ARMARX_IMPORTANT << "state: " << state;
ARMARX_IMPORTANT << "speed: " << speed;
ARMARX_IMPORTANT << "filter: " << filter;
ARMARX_IMPORTANT << "mode: " << mode;
while(readTask->isRunning())
{
OptoPackage* pa = 0;
//OptoPackage* pa2 = 0;
int size = daq.readAll(pa, false);
if (size <= 0)
{
usleep(1000); // 1ms
continue;
}
ARMARX_IMPORTANT << "size: " << size;
ARMARX_IMPORTANT << "daq.getSize(): " << daq.getSize();
// necessary so that there are no lines without values
if (daq.getSize() > 0)
{
//optoForceOutputFile << "getsize: " << daq.getSize() << "\n";
//optoForceOutputFile << "getBytesperRead: " << daq.getBytesPerRead() << "\n";
//optoForceOutputFile << "getsize2: " << daq2.getSize() << "\n";
//optoForceOutputFile << "getBytesperRead2: " << daq2.getBytesPerRead() << "\n";
//optoForceOutputFile << IceUtil::Time::now().toDateTime() << " OptoForce: ";
// get values of first DAQ - 4 OptoForce sensors connected
for (int k = 0; k < daq.getSensorSize(); k++)
{
ARMARX_INFO << "Sensor " << k;
for (int i = 0; i < size; i++)
{
ARMARX_INFO << "x: " << pa[k * size + i].x << " y: " << pa[k * size + i].y << " z: " << pa[k * size + i].z << " s1: " << pa[k * size + i].s1 << " s2: " << pa[k * size + i].s2 << " s3: " << pa[k * size + i].s3 << " s4: " << pa[k * size + i].s4 << " TEMP: " << pa[k * size + i].temp << flush;
//optoForceOutputFile << "x: " << pa[k * size + i].x << " y: " << pa[k * size + i].y << " z: " << pa[k * size + i].z << " ";
}
}
/*// get values of second DAQ - 3 OptoForce sensors connected
//needs to be (daq2.getSensorSize()-1) to read out only 3 ports
for (int k = 0; k < (daq2.getSensorSize() - 1) ; k++)
{
ARMARX_INFO << "Sensor " << k;
for (int i = 0; i < size2; i++)
{
ARMARX_INFO << "x: " << pa2[k * size2 + i].x << " y: " << pa2[k * size2 + i].y << " z: " << pa2[k * size2 + i].z << " s1: " << pa2[k * size2 + i].s1 << " s2: " << pa2[k * size2 + i].s2 << " s3: " << pa2[k * size2 + i].s3 << " s4: " << pa2[k * size2 + i].s4 << " TEMP: " << pa2[k * size2 + i].temp << flush;
optoForceOutputFile << "x: " << pa2[k * size2 + i].x << " y: " << pa2[k * size2 + i].y << " z: " << pa2[k * size2 + i].z << " ";
}
}*/
// buffer needs to be deleted
delete[] pa;
//delete[] pa2;
//optoForceOutputFile << "\n";
//optoForceOutputFile.flush();
}
}
}
void OptoForceUnit::onDisconnectComponent()
{
}
void OptoForceUnit::onExitComponent()
{
readTask->stop();
}
armarx::PropertyDefinitionsPtr OptoForceUnit::createPropertyDefinitions()
{
return armarx::PropertyDefinitionsPtr(new OptoForceUnitPropertyDefinitions(
getConfigIdentifier()));
}
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 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::ArmarXObjects::OptoForceUnit
* @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
* @date 2017
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#ifndef _ARMARX_COMPONENT_RobotAPI_OptoForceUnit_H
#define _ARMARX_COMPONENT_RobotAPI_OptoForceUnit_H
#include <ArmarXCore/core/Component.h>
#include <ArmarXCore/core/services/tasks/RunningTask.h>
#include <opto.h>
namespace armarx
{
/**
* @class OptoForceUnitPropertyDefinitions
* @brief
*/
class OptoForceUnitPropertyDefinitions:
public armarx::ComponentPropertyDefinitions
{
public:
OptoForceUnitPropertyDefinitions(std::string prefix):
armarx::ComponentPropertyDefinitions(prefix)
{
//defineRequiredProperty<std::string>("PropertyName", "Description");
//defineOptionalProperty<std::string>("PropertyName", "DefaultValue", "Description");
}
};
/**
* @defgroup Component-OptoForceUnit OptoForceUnit
* @ingroup RobotAPI-Components
* A description of the component OptoForceUnit.
*
* @class OptoForceUnit
* @ingroup Component-OptoForceUnit
* @brief Brief description of class OptoForceUnit.
*
* Detailed description of class OptoForceUnit.
*/
class OptoForceUnit :
virtual public armarx::Component
{
public:
/**
* @see armarx::ManagedIceObject::getDefaultName()
*/
virtual std::string getDefaultName() const
{
return "OptoForceUnit";
}
protected:
/**
* @see armarx::ManagedIceObject::onInitComponent()
*/
virtual void onInitComponent();
/**
* @see armarx::ManagedIceObject::onConnectComponent()
*/
virtual void onConnectComponent();
/**
* @see armarx::ManagedIceObject::onDisconnectComponent()
*/
virtual void onDisconnectComponent();
/**
* @see armarx::ManagedIceObject::onExitComponent()
*/
virtual void onExitComponent();
/**
* @see PropertyUser::createPropertyDefinitions()
*/
virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions();
private:
void run();
OptoPorts ports;
OptoDAQ daq;
RunningTask<OptoForceUnit>::pointer_type readTask;
};
}
#endif
# Libs required for the tests
SET(LIBS ${LIBS} ArmarXCore OptoForceUnit)
armarx_add_test(OptoForceUnitTest OptoForceUnitTest.cpp "${LIBS}")
\ No newline at end of file
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 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::ArmarXObjects::OptoForceUnit
* @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
* @date 2017
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#define BOOST_TEST_MODULE RobotAPI::ArmarXObjects::OptoForceUnit
#define ARMARX_BOOST_TEST
#include <RobotAPI/Test.h>
#include <RobotAPI/drivers/OptoForceUnit/OptoForceUnit.h>
#include <iostream>
BOOST_AUTO_TEST_CASE(testExample)
{
armarx::OptoForceUnit instance;
BOOST_CHECK_EQUAL(true, true);
}
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