Skip to content
Snippets Groups Projects
Commit 5add4a78 authored by armar-user's avatar armar-user
Browse files

adding skills LookForObject and LookForObjectWithKinematicUnit

parent c8ab0ff0
No related branches found
No related tags found
1 merge request!16Feature/skills
Showing
with 450 additions and 0 deletions
......@@ -18,3 +18,5 @@ add_subdirectory(components)
# ===================================
add_subdirectory(statecharts)
add_subdirectory(skills)
\ No newline at end of file
# Comment in to add an ARON library.
armarx_add_aron_library(skills_aron
ARON_FILES
aron/LookForObject.xml
)
armarx_add_library(skills
SOURCES
skills.cpp
LookForObjectWithKinematicUnit.cpp
LookForObject.cpp
HEADERS
skills.h
LookForObjectWithKinematicUnit.h
LookForObject.h
DEPENDENCIES_PUBLIC
# ArmarXCore
ArmarXCoreInterfaces
ArmarXCore
# RobotAPI
RobotAPISkills
# view_selection
# view_selection::skills_aron
# DEPENDENCIES_PRIVATE
# ...
# DEPENDENCIES_INTERFACE
# ...
# DEPENDENCIES_LEGACY_PUBLIC
# ...
# DEPENDENCIES_LEGACY_PRIVATE
# ...
# DEPENDENCIES_LEGACY_INTERFACE
# ...
)
# Comment in to enable tests.
# armarx_add_test(skills_test
# TEST_FILES
# test/skills_test.cpp
# DEPENDENCIES
# view_selection::skills
# )
#include "LookForObject.h"
#include <memory>
#include <Eigen/Core>
#include <Eigen/Geometry>
namespace armarx::view_selection::skills
{
LookForObject::LookForObject() : Base(DefaultSkillDescription())
{
}
void
LookForObject::connect(const Services& srv)
{
srv_.emplace(srv);
}
::armarx::skills::Skill::InitResult
LookForObject::init(const Base::SpecializedInitInput& in)
{
return ::armarx::skills::Skill::InitResult{
.status = ::armarx::skills::TerminatedSkillStatus::Succeeded};
}
::armarx::skills::Skill::MainResult
LookForObject::main(const Base::SpecializedMainInput& in)
{
return ::armarx::skills::Skill::MainResult{
.status = ::armarx::skills::TerminatedSkillStatus::Succeeded};
}
void
LookForObject::onStopRequested()
{
}
} // namespace armarx::view_selection::skills
/*
* 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/>.
*
* @author Fabian Reister ( fabian dot reister at kit dot edu )
* @date 2023
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
#include <ArmarXCore/core/ManagedIceObject.h>
#include <ArmarXCore/core/time/Duration.h>
#include <RobotAPI/libraries/skills/provider/Skill.h>
#include <RobotAPI/libraries/skills/provider/SpecializedSkill.h>
#include <armarx/view_selection/skills/aron/LookForObject.aron.generated.h>
#include <armarx/view_selection/skills/constants.h>
namespace armarx::view_selection::skills
{
class LookForObject :
virtual public armarx::skills::SpecializedSkill<arondto::LookForObjectParams>
{
public:
using Params = arondto::LookForObjectParams;
using Base = ::armarx::skills::SpecializedSkill<Params>;
struct Services
{
// armem::client::MemoryNameSystem& memoryNameSystem;
};
LookForObject();
void connect(const Services& srv);
private:
::armarx::skills::Skill::InitResult init(const Base::SpecializedInitInput& in) override;
::armarx::skills::Skill::MainResult main(const Base::SpecializedMainInput& in) override;
void onStopRequested() override;
public:
static armarx::skills::SkillDescription
DefaultSkillDescription()
{
return {constants::skill_names::LookForObject,
"",
{},
armarx::core::time::Duration(),
Params::ToAronType()};
}
protected:
private:
std::optional<Services> srv_;
// will be initialized in "init()"
};
} // namespace armarx::view_selection::skills
#include "LookForObjectWithKinematicUnit.h"
#include <memory>
#include <Eigen/Core>
#include <Eigen/Geometry>
namespace armarx::view_selection::skills
{
LookForObjectWithKinematicUnit::LookForObjectWithKinematicUnit() : Base(DefaultSkillDescription())
{
}
void
LookForObjectWithKinematicUnit::connect(const Services& srv)
{
srv_.emplace(srv);
}
::armarx::skills::Skill::InitResult
LookForObjectWithKinematicUnit::init(const Base::SpecializedInitInput& in)
{
return ::armarx::skills::Skill::InitResult{
.status = ::armarx::skills::TerminatedSkillStatus::Succeeded};
}
::armarx::skills::Skill::MainResult
LookForObjectWithKinematicUnit::main(const Base::SpecializedMainInput& in)
{
// TODO(Nagi): implement
return ::armarx::skills::Skill::MainResult{
.status = ::armarx::skills::TerminatedSkillStatus::Succeeded};
}
void
LookForObjectWithKinematicUnit::onStopRequested()
{
}
} // namespace armarx::view_selection::skills
/*
* 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/>.
*
* @author Fabian Reister ( fabian dot reister at kit dot edu )
* @date 2023
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
#include <ArmarXCore/core/ManagedIceObject.h>
#include <ArmarXCore/core/time/Duration.h>
#include <RobotAPI/libraries/skills/provider/Skill.h>
#include <RobotAPI/libraries/skills/provider/SpecializedSkill.h>
#include <armarx/view_selection/skills/aron/LookForObject.aron.generated.h>
#include <armarx/view_selection/skills/constants.h>
namespace armarx::view_selection::skills
{
class LookForObjectWithKinematicUnit :
virtual public armarx::skills::SpecializedSkill<arondto::LookForObjectParams>
{
public:
using Params = arondto::LookForObjectParams;
using Base = ::armarx::skills::SpecializedSkill<Params>;
struct Services
{
// armem::client::MemoryNameSystem& memoryNameSystem;
};
LookForObjectWithKinematicUnit();
void connect(const Services& srv);
private:
::armarx::skills::Skill::InitResult init(const Base::SpecializedInitInput& in) override;
::armarx::skills::Skill::MainResult main(const Base::SpecializedMainInput& in) override;
void onStopRequested() override;
public:
static armarx::skills::SkillDescription
DefaultSkillDescription()
{
return {constants::skill_names::LookForObjectWithKinematicUnit,
"",
{},
armarx::core::time::Duration(),
Params::ToAronType()};
}
protected:
private:
std::optional<Services> srv_;
// will be initialized in "init()"
};
} // namespace armarx::view_selection::skills
<?xml version="1.0" encoding="UTF-8" ?>
<AronTypeDefinition>
<AronIncludes>
</AronIncludes>
<GenerateTypes>
<Object name='armarx::view_selection::skills::arondto::LookForObjectParams'>
<ObjectChild key='location'>
<string />
</ObjectChild>
</Object>
</GenerateTypes>
</AronTypeDefinition>
/**
* 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/>.
*
* @author Fabian Reister ( fabian dot reister at kit dot edu )
* @date 2023
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
namespace armarx::view_selection::skills::constants
{
inline const std::string ViewSelectionSkillProviderName = "ViewSelectionSkillProvider";
}
namespace armarx::view_selection::skills::constants::skill_names
{
inline const std::string LookForObjectWithKinematicUnit = "LookForObjectWithKinematicUnit";
inline const std::string LookForObject = "LookForObject";
} // namespace armarx::view_selection::skills::constants::skill_names
/*
* 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 view_selection::ArmarXObjects::skills
* @author armar-user ( armar6 at kit )
* @date 2023
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include "skills.h"
namespace armarx::view_selection::skills
{
}
/*
* 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 view_selection::ArmarXObjects::skills
* @author armar-user ( armar6 at kit )
* @date 2023
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
namespace armarx::view_selection::skills
{
/**
* @defgroup Library-skills skills
* @ingroup view_selection
* A description of the library skills.
*
* @class skills
* @ingroup Library-skills
* @brief Brief description of class skills.
*
* Detailed description of class skills.
*/
class skills
{
public:
};
}
/*
* 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 view_selection::ArmarXObjects::skills
* @author armar-user ( armar6 at kit )
* @date 2023
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#define BOOST_TEST_MODULE view_selection::ArmarXLibraries::skills
#define ARMARX_BOOST_TEST
#include <view_selection/Test.h>
#include "../skills.h"
#include <iostream>
BOOST_AUTO_TEST_CASE(testExample)
{
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