TestBringObjectWithArmSelection.cpp
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2014-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package RobotSkillTemplates::BringObjectGroup
19 * @author Mirko Waechter ( mirko dot waechter at kit dot edu )
20 * @date 2015
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
26
27#include <RobotAPI/interface/core/FramedPoseBase.h>
28
31#include <MemoryX/interface/memorytypes/MemoryEntities.h>
33using namespace armarx;
34using namespace BringObjectGroup;
35
36// DO NOT EDIT NEXT LINE
37TestBringObjectWithArmSelection::SubClassRegistry
38 TestBringObjectWithArmSelection::Registry(TestBringObjectWithArmSelection::GetName(),
40
47
48void
50{
51 // put your user code for the enter-point here
52 // execution time should be short (<100ms)
53 //BringObjectGroupStatechartContext* c = getContext<BringObjectGroupStatechartContext>();
54
55 ARMARX_IMPORTANT << "FIXME: No direct access to the simulator here, you can start a scenario "
56 "that adds an object ("
57 << in.getObjectName()
58 << ") via the SceneModifier component (see ArmarXSimulation)";
59 /*if(c->getSimulatorProxy())
60 {
61 std::string objectClassName = in.getObjectName();
62 memoryx::PersistentObjectClassSegmentBasePrx classesSegmentPrx = c->getPriorKnowledgeProxy()->getObjectClassesSegment();
63
64 memoryx::EntityBasePtr classesEntity = classesSegmentPrx->getEntityByName(objectClassName);
65 if (!classesEntity)
66 {
67 ARMARX_ERROR_S << "No memory entity found with name " << objectClassName;
68 }
69 memoryx::ObjectClassBasePtr objectClass = memoryx::ObjectClassBasePtr::dynamicCast(classesEntity);
70 if (!objectClass)
71 {
72 ARMARX_ERROR_S << "Could not cast entitiy to object class, name: " << objectClassName;
73 }
74
75 PosePtr pose = in.getObjectPose();
76 srand(IceUtil::Time::now().toMilliSeconds());
77 // pose->position->y += -200 + (double)(rand()) / RAND_MAX * 400;
78 if (!c->getSimulatorProxy()->hasObject(objectClassName))
79 {
80 ARMARX_IMPORTANT_S << "Adding object " << objectClassName << " at pose:" << *pose;
81 c->getSimulatorProxy()->addObject(objectClass, objectClassName, pose, false);
82 }
83 }*/
84}
85
86void
88{
89 // put your user code for the exit point here
90 // execution time should be short (<100ms)
91}
92
93// DO NOT EDIT NEXT FUNCTION
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Class for legacy to stay compatible with old statecharts.
Definition XMLState.h:147
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
Definition Logging.h:190
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition XMLState.h:64