Skip to content
Snippets Groups Projects
Commit e46e0839 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Add ObjectPoseObserver component

parent 287ffd80
No related branches found
No related tags found
1 merge request!70Add ObjectPoseObserver (WIP)
......@@ -13,6 +13,7 @@ add_subdirectory(KITHandUnit)
add_subdirectory(KITProstheticHandUnit)
add_subdirectory(MultiHandUnit)
add_subdirectory(NaturalIKTest)
add_subdirectory(ObjectPoseObserver)
add_subdirectory(RobotHealth)
add_subdirectory(RobotNameService)
add_subdirectory(RobotState)
......
armarx_component_set_name("ObjectPoseObserver")
set(COMPONENT_LIBS
ArmarXCore ArmarXCoreInterfaces
RobotAPIComponentPlugins
${PROJECT_NAME}Interfaces
)
set(SOURCES
ObjectPoseObserver.cpp
)
set(HEADERS
ObjectPoseObserver.h
)
armarx_add_component("${SOURCES}" "${HEADERS}")
#find_package(MyLib QUIET)
#armarx_build_if(MyLib_FOUND "MyLib not available")
# all target_include_directories must be guarded by if(Xyz_FOUND)
# for multiple libraries write: if(X_FOUND AND Y_FOUND)....
#if(MyLib_FOUND)
# target_include_directories(ObjectPoseObserver PUBLIC ${MyLib_INCLUDE_DIRS})
#endif()
# add unit tests
add_subdirectory(test)
armarx_component_set_name("ObjectPoseObserverApp")
set(COMPONENT_LIBS ObjectPoseObserver)
armarx_add_component_executable(main.cpp)
/*
* 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::ObjectPoseObserver
* @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
* @date 2020
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include "ObjectPoseObserver.h"
namespace armarx
{
ObjectPoseObserverPropertyDefinitions::ObjectPoseObserverPropertyDefinitions(std::string prefix) :
armarx::ObserverPropertyDefinitions(prefix)
{
}
armarx::PropertyDefinitionsPtr ObjectPoseObserver::createPropertyDefinitions()
{
armarx::PropertyDefinitionsPtr defs(new ObjectPoseObserverPropertyDefinitions(getConfigIdentifier()));
return defs;
}
std::string ObjectPoseObserver::getDefaultName() const
{
return "ObjectPoseObserver";
}
void ObjectPoseObserver::onInitObserver()
{
}
void ObjectPoseObserver::onConnectObserver()
{
}
void ObjectPoseObserver::onDisconnectComponent()
{
}
void ObjectPoseObserver::onExitObserver()
{
}
void ObjectPoseObserver::reportProviderInfo(const std::string& providerName, const objpose::ProviderInfo& info, const Ice::Current&)
{
}
void ObjectPoseObserver::reportObjectPoses(const std::string& providerName, const objpose::ObjectPoseSeq& candidates, const Ice::Current&)
{
}
objpose::InfoMap ObjectPoseObserver::getAvailableProvidersWithInfo(const Ice::Current&)
{
return {};
}
Ice::StringSeq ObjectPoseObserver::getAvailableProviderNames(const Ice::Current&)
{
return {};
}
objpose::ProviderInfo ObjectPoseObserver::getProviderInfo(const std::string& providerName, const Ice::Current&)
{
return {};
}
bool ObjectPoseObserver::hasProvider(const std::string& providerName, const Ice::Current&)
{
return {};
}
objpose::ObjectPoseSeq ObjectPoseObserver::getObjectPoses(const Ice::Current&)
{
return {};
}
objpose::ObjectPoseSeq ObjectPoseObserver::getObjectPosesByProvider(const std::string& providerName, const Ice::Current&)
{
return {};
}
Ice::Int ObjectPoseObserver::getUpdateCounterByProvider(const std::string& providerName, const Ice::Current&)
{
return {};
}
StringIntDictionary ObjectPoseObserver::getAllUpdateCounters(const Ice::Current&)
{
return {};
}
bool ObjectPoseObserver::setProviderConfig(const std::string& providerName, const StringVariantBaseMap& config, const Ice::Current&)
{
return {};
}
}
/*
* 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::ObjectPoseObserver
* @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
* @date 2020
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
#include <ArmarXCore/observers/Observer.h>
#include <RobotAPI/interface/objectpose/ObjectPoseObserver.h>
#include <RobotAPI/libraries/RobotAPIComponentPlugins/ArVizComponentPlugin.h>
#define ICE_CURRENT_ARG const Ice::Current& = Ice::emptyCurrent
namespace armarx
{
/**
* @class ObjectPoseObserverPropertyDefinitions
* @brief Property definitions of `ObjectPoseObserver`.
*/
class ObjectPoseObserverPropertyDefinitions :
public ObserverPropertyDefinitions
{
public:
ObjectPoseObserverPropertyDefinitions(std::string prefix);
};
/**
* @defgroup Component-ObjectPoseObserver ObjectPoseObserver
* @ingroup RobotAPI-Components
* A description of the component ObjectPoseObserver.
*
* @class ObjectPoseObserver
* @ingroup Component-ObjectPoseObserver
* @brief Brief description of class ObjectPoseObserver.
*
* Detailed description of class ObjectPoseObserver.
*/
class ObjectPoseObserver :
virtual public Observer
, virtual public objpose::ObjectPoseObserverInterface
, virtual public armarx::ArVizComponentPluginUser
{
public:
/// @see armarx::ManagedIceObject::getDefaultName()
std::string getDefaultName() const override;
// ObjectPoseTopic interface
public:
void reportProviderInfo(const std::string& providerName, const objpose::ProviderInfo& info, ICE_CURRENT_ARG) override;
void reportObjectPoses(const std::string& providerName, const objpose::ObjectPoseSeq& candidates, ICE_CURRENT_ARG) override;
// ObjectPoseObserverInterface interface
public:
objpose::InfoMap getAvailableProvidersWithInfo(ICE_CURRENT_ARG) override;
Ice::StringSeq getAvailableProviderNames(ICE_CURRENT_ARG) override;
objpose::ProviderInfo getProviderInfo(const std::string& providerName, ICE_CURRENT_ARG) override;
bool hasProvider(const std::string& providerName, ICE_CURRENT_ARG) override;
objpose::ObjectPoseSeq getObjectPoses(ICE_CURRENT_ARG) override;
objpose::ObjectPoseSeq getObjectPosesByProvider(const std::string& providerName, ICE_CURRENT_ARG) override;
Ice::Int getUpdateCounterByProvider(const std::string& providerName, ICE_CURRENT_ARG) override;
StringIntDictionary getAllUpdateCounters(ICE_CURRENT_ARG) override;
bool setProviderConfig(const std::string& providerName, const StringVariantBaseMap& config, ICE_CURRENT_ARG) override;
protected:
void onInitObserver() override;
void onConnectObserver() override;
void onDisconnectComponent() override;
void onExitObserver() override;
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override;
private:
};
}
#undef ICE_CURRENT_ARG
/*
* 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::ObjectPoseObserver
* @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
* @date 2020
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include <RobotAPI/components/ObjectPoseObserver/ObjectPoseObserver.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::ObjectPoseObserver > (argc, argv, "ObjectPoseObserver");
}
# Libs required for the tests
SET(LIBS ${LIBS} ArmarXCore ObjectPoseObserver)
armarx_add_test(ObjectPoseObserverTest ObjectPoseObserverTest.cpp "${LIBS}")
/*
* 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::ObjectPoseObserver
* @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
* @date 2020
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#define BOOST_TEST_MODULE RobotAPI::ArmarXObjects::ObjectPoseObserver
#define ARMARX_BOOST_TEST
#include <RobotAPI/Test.h>
#include <RobotAPI/components/ObjectPoseObserver/ObjectPoseObserver.h>
#include <iostream>
BOOST_AUTO_TEST_CASE(testExample)
{
armarx::ObjectPoseObserver 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