CollisionAvoidance.cpp
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package control::COMPONENT_NAME_SNAKE::skills
17 * @author Meixner ( andre dot meixner at kit dot edu )
18 * @date 2025
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#include "CollisionAvoidance.h"
24
25#include <Eigen/Geometry>
26
27#include <SimoxUtility/algorithm/string/string_tools.h>
28#include <VirtualRobot/ManipulationObject.h>
29#include <VirtualRobot/VirtualRobot.h>
30#include <VirtualRobot/XML/ObjectIO.h>
31#include <VirtualRobot/XML/RobotIO.h>
32
33#include <simox/control/environment/CollisionRobot.h>
34#include <simox/control/environment/collision.h>
35#include <simox/control/impl/simox/robot/Robot.h>
36#include <simox/control/impl/simox/utils/conversion.h>
37#include <simox/control/impl/simox/utils/primitive_conversion.h>
38
43
46
49
50//#include <VisionX/libraries/armem_human/client/HumanPoseReader.h>
51//#include <VisionX/libraries/human/pose/model/k4a_bt_body_32.h>
52
53#include <armarx/control/skills/aron/ZeroTorque.aron.generated.h>
54
55#include <armadillo_bits/def_atlas.hpp>
56
58{
59
62 {
63 ParamType defaultParams;
64 defaultParams.objectIDs = std::vector<std::string>{
65 "Kitchen/mobile-fridge/0", "Kitchen/mobile-dishwasher/0", "Kitchen/mobile-kitchen-counter/0"};
66
68 const armarx::skills::SkillID skillId = armarx::skills::SkillID{.skillName = skillName};
69
70 return ::armarx::skills::SkillDescription{
71 .skillId = skillId,
72 .description = "TODO: Description of skill CollisionAvoidance.",
73 .rootProfileDefaults = defaultParams.toAron(),
74 .timeout = ::armarx::Duration::MilliSeconds(120000),
75 .parametersType = ParamType::ToAronType()};
76 }
77
79 //Base(GetSkillDescription()), remote(r), properties(p), srv_(srv)
81 remote(r)
82 {
83 }
84
86 {
87 std::unique_ptr<simox::control::simox::robot::Robot> robot;
88 std::unique_ptr<simox::control::environment::CollisionRobot<hpp::fcl::OBBRSS>>
90 };
91
93 CollisionAvoidance::main(const SpecializedMainInput& in)
94 {
95 if (getParameters().flagDelete)
96 {
97 remote.collisionAvoidanceComponent->get()->deleteCollisionObjects();
98 return MakeSucceededResult();
99 }
100
101 remote.collisionAvoidanceComponent->get()->sendCollisionObjectsToController(
102 getParameters().objectIDs);
103 if (true)
104 {
105 return MakeSucceededResult();
106 }
107 return MakeFailedResult();
108 }
109
110 CollisionAvoidance::ExitResult
111 CollisionAvoidance::exit(const SpecializedExitInput& in)
112 {
114 }
115
116
117} // namespace armarx::control::collision_avoidance::skills
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition Duration.cpp:48
::armarx::skills::SimpleSpecializedSkill< ::armarx::control::collision_avoidance::arondto::CollisionAvoidanceParams > Base
static MainResult MakeSucceededResult(aron::data::DictPtr data=nullptr)
Definition Skill.cpp:413
static MainResult MakeFailedResult(aron::data::DictPtr data=nullptr)
Definition Skill.cpp:422
AronT getParameters() const
Overwrite getter for parameters. Shadow Skill::getParameters()
const std::string SKILL_NAME
The name of the skill in this library.
Definition constants.cpp:29
std::experimental::observer_ptr< armarx::control::components::collision_avoidance::ComponentInterfacePrx > collisionAvoidanceComponent
std::unique_ptr< simox::control::environment::CollisionRobot< hpp::fcl::OBBRSS > > collisionRobot
std::unique_ptr< simox::control::simox::robot::Robot > robot
A result struct for th main method of a skill.
Definition Skill.h:62