File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
external-control/src/main/java/us/ihmc/externalControl Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ package us .ihmc .externalControl ;
2
+
3
+ import us .ihmc .commonWalkingControlModules .highLevelHumanoidControl .HighLevelControllerFactoryHelper ;
4
+ import us .ihmc .commonWalkingControlModules .highLevelHumanoidControl .factories .HighLevelControllerStateFactory ;
5
+ import us .ihmc .commonWalkingControlModules .highLevelHumanoidControl .highLevelStates .HighLevelControllerState ;
6
+ import us .ihmc .communication .controllerAPI .CommandInputManager ;
7
+ import us .ihmc .humanoidRobotics .communication .packets .dataobjects .HighLevelControllerName ;
8
+ import us .ihmc .mecano .multiBodySystem .interfaces .OneDoFJointBasics ;
9
+
10
+ public class ExternalControllerStateFactory implements HighLevelControllerStateFactory
11
+ {
12
+ private ExternalControllerState externalControlState ;
13
+
14
+ public ExternalControllerStateFactory ()
15
+ {
16
+ }
17
+
18
+ @ Override
19
+ public HighLevelControllerState getOrCreateControllerState (HighLevelControllerFactoryHelper controllerFactoryHelper )
20
+ {
21
+ if (externalControlState == null )
22
+ {
23
+ OneDoFJointBasics [] controlledJoints = controllerFactoryHelper .getHighLevelHumanoidControllerToolbox ().getControlledOneDoFJoints ();
24
+ CommandInputManager commandInputManager = controllerFactoryHelper .getCommandInputManager ();
25
+
26
+ externalControlState = new ExternalControllerState ("externalControl" ,
27
+ HighLevelControllerName .EXTERNAL ,
28
+ controllerFactoryHelper .getHighLevelHumanoidControllerToolbox (),
29
+ controlledJoints ,
30
+ controllerFactoryHelper .getLowLevelControllerOutput (),
31
+ commandInputManager );
32
+ }
33
+
34
+ return externalControlState ;
35
+ }
36
+
37
+ @ Override
38
+ public HighLevelControllerName getStateEnum ()
39
+ {
40
+ return HighLevelControllerName .EXTERNAL ;
41
+ }
42
+ }
You can’t perform that action at this time.
0 commit comments