HapticUnitDynamicSimulation.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-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
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #pragma once
25 
27 
29 
30 #include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
31 
32 namespace armarx
33 {
35  {
36  public:
39  {
40  defineOptionalProperty<std::string>("SimulatorName", "Simulator", "Name of the simulator component that should be used");
41  defineOptionalProperty<std::string>("RobotNodes", "Index R J1, Middle R J1", "Comma separated list of robot nodes that are used to determine contact information (RobotNodes must own a collision model)");
42  defineOptionalProperty<std::string>("EnvironmentObjects", "Vitalis", "Comma separated list of world objects that are used to determine contact information");
43  defineOptionalProperty<std::string>("RobotName", "Armar3", "Name of the robot to use.");
44  }
45  };
46 
47  class HapticUnitDynamicSimulation : virtual public HapticUnit
48  {
49  // HapticUnit interface
50  public:
51  virtual std::string getDefaultName()
52  {
53  return "HapticUnitDynamicSimulation";
54  }
55 
56  void onInitHapticUnit() override;
57  void onStartHapticUnit() override;
58  void onExitHapticUnit() override;
59 
61 
62  private:
64  void frameAcquisitionTaskLoop();
65  std::vector<std::string> getCommaSeparatedProperty(std::string propertyName);
66 
67  SimulatorInterfacePrx simulatorProxy;
68  std::vector<std::string> robotNodeNames;
69  std::vector<std::string> environmentObjectNames;
70  std::string robotName;
71 
72  DebugDrawerInterfacePrx debugDrawerPrx;
73  };
74 }
75 
armarx::HapticUnitPropertyDefinitions
Definition: HapticUnit.h:42
armarx::HapticUnit
The HapticUnit class.
Definition: HapticUnit.h:62
armarx::HapticUnitDynamicSimulation::onStartHapticUnit
void onStartHapticUnit() override
Definition: HapticUnitDynamicSimulation.cpp:53
HapticUnit.h
armarx::HapticUnitDynamicSimulation::createPropertyDefinitions
PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: HapticUnitDynamicSimulation.cpp:69
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
RunningTask.h
armarx::HapticUnitDynamicSimulationPropertyDefinitions::HapticUnitDynamicSimulationPropertyDefinitions
HapticUnitDynamicSimulationPropertyDefinitions(std::string prefix)
Definition: HapticUnitDynamicSimulation.h:37
armarx::HapticUnitDynamicSimulation
Definition: HapticUnitDynamicSimulation.h:47
armarx::HapticUnitDynamicSimulation::onExitHapticUnit
void onExitHapticUnit() override
Definition: HapticUnitDynamicSimulation.cpp:64
armarx::HapticUnitDynamicSimulation::onInitHapticUnit
void onInitHapticUnit() override
Definition: HapticUnitDynamicSimulation.cpp:37
IceUtil::Handle
Definition: forward_declarations.h:29
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
armarx::HapticUnitDynamicSimulationPropertyDefinitions
Definition: HapticUnitDynamicSimulation.h:34
armarx::HapticUnitDynamicSimulation::getDefaultName
virtual std::string getDefaultName()
Definition: HapticUnitDynamicSimulation.h:51
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28