diff --git a/scenarios/MovePlatformTest/configs/MovePlatformExampleCloseToTable.xml b/scenarios/MovePlatformTest/configs/MovePlatformExampleCloseToTable.xml new file mode 100644 index 0000000000000000000000000000000000000000..791e75adbdeb3eed788b4846e60ee4f6f6ee3704 --- /dev/null +++ b/scenarios/MovePlatformTest/configs/MovePlatformExampleCloseToTable.xml @@ -0,0 +1,28 @@ +<MovePlatformStateChart> + <StateParameters> + <!-- + x/y are in mm + for now z=rotation around z axis in radian + --> + <targetPositions> + <Item0> + <x>3400</x> + <y>7150</y> + <z>-1.6</z> + </Item0> + </targetPositions> + + <!--unreachable--> + <!--targetPositions> + <Item0> + <x>5000</x> + <y>5000</y> + <z>0</z> + </Item0> + </targetPositions--> + <positionalAccuracy>10</positionAccuracy> <!--mm--> + <orientationalAccuracy>0.1</orientationAccuracy> <!--rad--> + <timeoutMoveTo>30000</timeoutMoveTO> + </StateParameters> +</MovePlatformStateChart> + diff --git a/scenarios/MovePlatformTest/startPlatformOnly.sh b/scenarios/MovePlatformTest/startPlatformOnly.sh deleted file mode 100755 index 47ddd1ccacfa44342f2eeeaf743fd7b6cab93d45..0000000000000000000000000000000000000000 --- a/scenarios/MovePlatformTest/startPlatformOnly.sh +++ /dev/null @@ -1,23 +0,0 @@ - -export CORE_PATH=../../../Core -export GUI_PATH=../../../Gui -export VISIONX_PATH=../..././VisionX -export ARMAR4_PATH=../../../Armar4 -export HUMANOIDROBOTAPI_PATH=../../../RobotAPI -export SCRIPT_PATH=$CORE_PATH/build/bin -export SIMULATION_PATH=../../../SimulationX - -export CORE_BIN_PATH=$CORE_PATH/build/bin -export GUI_BIN_PATH=$GUI_PATH/build/bin -export VISIONX_BIN_PATH=$VISIONX_PATH/build/bin -export ARMAR4_BIN_PATH=$ARMAR4_PATH/build/bin -export HUMANOIDROBOTAPI_BIN_PATH=$HUMANOIDROBOTAPI_PATH/build/bin - -export GLOBAL_CONFIG=./configs/Global.cfg - -# armarx components -#$SCRIPT_PATH/startApplication.sh $CORE_BIN_PATH/PlatformUnitObserverRun --Ice.Config=$GLOBAL_CONFIG,./configs/PlatformUnitObserver.cfg & -#$SCRIPT_PATH/startApplication.sh $CORE_BIN_PATH/SystemObserverRun --Ice.Config=$GLOBAL_CONFIG & -#$SCRIPT_PATH/startApplication.sh $CORE_BIN_PATH/RobotControlRun --Ice.Config=$GLOBAL_CONFIG & -#$SCRIPT_PATH/startApplication.sh $CORE_BIN_PATH/ConditionHandlerRun --Ice.Config=$GLOBAL_CONFIG & -$SCRIPT_PATH/startApplication.sh $HUMANOIDROBOTAPI_BIN_PATH/MovePlatformAppRun --Ice.Config=$GLOBAL_CONFIG & diff --git a/scenarios/MovePlatformToLandmarkTest/configs/MovePlatformToLandmarkExampleGraph.xml b/scenarios/MovePlatformToLandmarkTest/configs/MovePlatformToLandmarkExampleGraph.xml index eb7b830d557258ec9f561a9589d54932a49b4865..068d84b2447bb5ae98e14dd9534c881e6af8f01a 100644 --- a/scenarios/MovePlatformToLandmarkTest/configs/MovePlatformToLandmarkExampleGraph.xml +++ b/scenarios/MovePlatformToLandmarkTest/configs/MovePlatformToLandmarkExampleGraph.xml @@ -4,13 +4,14 @@ x/y are in mm for now z=rotation around z axis in radian (values from about -PI to +PI) --> - <targetLandmark>oven</targetLandmark> + <targetLandmark>TableWithRolls</targetLandmark> + <!-- frame serves as a node name --> <landmarkNodes> <Item0> <x>0</x> <y>0</y> <z>0</z> - <frame>start</frame> + <frame>Start</frame> </Item0> <Item1> <x>4200</x> @@ -28,7 +29,7 @@ <x>4200</x> <y>4000</y> <z>3</z> - <frame>handover</frame> + <frame>Handover</frame> </Item3> <Item4> <x>3100</x> @@ -46,39 +47,41 @@ <x>2600</x> <y>7600</y> <z>0.8</z> - <frame>oven</frame> + <frame>Oven</frame> </Item6> <Item7> <x>3300</x> <y>7150</y> <z>-1.6</z> - <frame>table</frame> + <frame>TableWithRolls</frame> </Item7> <Item8> <x>2600</x> <y>9600</y> <z>0.1</z> - <frame>sink</frame> + <frame>Sink</frame> </Item8> <Item9> <x>4500</x> <y>9400</y> <z>0</z> - <frame>cupboard</frame> + <frame>Cupboard7Door</frame> </Item9> </landmarkNodes> + <!-- each edge is defined as "<nodename>;<nodename>" (";" is a delimiter between names, + so it shouldn't appear in any node name), all edges are bidirectional between the provided nodes --> <landmarkEdges> - <Item0>start-1</Item0> - <Item1>1-2</Item1> - <Item2>2-handover</Item2> - <Item3>2-3</Item3> - <Item4>3-4</Item4> - <Item5>3-oven</Item5> - <Item6>3-table</Item6> - <Item7>4-oven</Item7> - <Item8>4-table</Item8> - <Item9>4-sink</Item9> - <Item10>4-cupboard</Item10> + <Item0>start;1</Item0> + <Item1>1;2</Item1> + <Item2>2;Handover</Item2> + <Item3>2;3</Item3> + <Item4>3;4</Item4> + <Item5>3;Oven</Item5> + <Item6>3;TableWithRolls</Item6> + <Item7>4;Oven</Item7> + <Item8>4;TableWithRolls</Item8> + <Item9>4;Sink</Item9> + <Item10>4;Cupboard7Door</Item10> </landmarkEdges> <positionalAccuracy>10</positionalAccuracy> <!--mm--> <orientationalAccuracy>0.1</orientationalAccuracy> <!--rad--> diff --git a/source/RobotAPI/statecharts/MovePlatform/MovePlatform.cpp b/source/RobotAPI/statecharts/MovePlatform/MovePlatform.cpp index d0d48e1bb3b35bdf4c6a3c3f959776d49b59da93..970cf7f292e44a57cc0def318aaa6877077a04c7 100644 --- a/source/RobotAPI/statecharts/MovePlatform/MovePlatform.cpp +++ b/source/RobotAPI/statecharts/MovePlatform/MovePlatform.cpp @@ -51,7 +51,8 @@ namespace armarx // **************************************************************** void StatechartMovePlatform::defineParameters() { - setConfigFile("RobotAPI/scenarios/MovePlatformTest/configs/MovePlatformExample.xml"); +// setConfigFile("RobotAPI/scenarios/MovePlatformTest/configs/MovePlatformExample.xml"); + setConfigFile("RobotAPI/scenarios/MovePlatformTest/configs/MovePlatformExampleCloseToTable.xml"); addToInput("targetPositions", VariantType::List(VariantType::Vector3), false); addToInput("positionalAccuracy", VariantType::Float, false); addToInput("orientationalAccuracy", VariantType::Float, false); diff --git a/source/RobotAPI/statecharts/MovePlatform/PlatformContext.h b/source/RobotAPI/statecharts/MovePlatform/PlatformContext.h index aa69d53dace4e5304ec530efebe309486eba7668..f966ae28646e38dfc32293e0003cd60eab6ce61c 100644 --- a/source/RobotAPI/statecharts/MovePlatform/PlatformContext.h +++ b/source/RobotAPI/statecharts/MovePlatform/PlatformContext.h @@ -30,6 +30,7 @@ #include <Core/statechart/StatechartContext.h> #include <Core/robotstate/remote/RemoteRobot.h> #include <Core/interface/units/PlatformUnitInterface.h> +#include <Core/interface/observers/PlatformUnitObserverInterface.h> #include <Core/units/PlatformUnitObserver.h> //#include <VirtualRobot/VirtualRobot.h> diff --git a/source/RobotAPI/statecharts/MovePlatformToLandmark/MovePlatformToLandmark.cpp b/source/RobotAPI/statecharts/MovePlatformToLandmark/MovePlatformToLandmark.cpp index c3c006edbd5bef7ac04a95489e77e0173a590bb7..ddcd9e2a7c8040392c8ef5e6120e0e79a1b44897 100644 --- a/source/RobotAPI/statecharts/MovePlatformToLandmark/MovePlatformToLandmark.cpp +++ b/source/RobotAPI/statecharts/MovePlatformToLandmark/MovePlatformToLandmark.cpp @@ -125,7 +125,7 @@ namespace armarx for (int i = 0; i < landmarkEdges->getSize(); i++) { std::string edge = landmarkEdges->getVariant(i)->getString(); std::vector<std::string> edgeNodes; - boost::split(edgeNodes, edge, boost::is_any_of("-"), boost::token_compress_on); + boost::split(edgeNodes, edge, boost::is_any_of(";"), boost::token_compress_on); NodePtr left = nameToNodeMap[edgeNodes[0]]; NodePtr right = nameToNodeMap[edgeNodes[1]]; left->successors.push_back(right);