DataStore.ActionLibrary.appendToCache C# (CSharp) Méthode

appendToCache() public méthode

public appendToCache ( ActionSequence action ) : void
action ActionSequence
Résultat void
        public void appendToCache(ActionSequence<NaoSkeleton> action)
        {
            this.cachedStates.append(action);
        }

Usage Example

Exemple #1
0
        static void Main(string[] args)
        {
            Dictionary<string, string> actions = new Dictionary<string, string>();
            actions["raise the roof"] = "raisetheroof";
            actions["walk forward"] = "walkforward";
            actions["walk left"] = "walkleft";
            actions["wave right"] = "waveright";
            actions["wave left"] = "waveleft";
            string filename = "Z:/dev/kinect-nao/recordings/";
            ActionLibrary lib = new ActionLibrary();

            foreach (string actionName in actions.Keys)
            {
                List<HumanSkeleton> seq = new List<HumanSkeleton>();
                using (StreamReader s = new StreamReader(filename + actions[actionName] + "/"
                    + actionName + "1.rec"))
                {
                    while (!s.EndOfStream)
                    {
                        seq.Add(new HumanSkeleton(s.ReadLine()));
                    }
                }

                //List<float[]> naoSeq = new List<float[]>();
                ActionSequence<NaoSkeleton> naoSeq = new ActionSequence<NaoSkeleton>();
                foreach (HumanSkeleton h in seq)
                {
                    AngleConverter ac = new AngleConverter(h);
                    naoSeq.append(ac.getNaoSkeleton());
                    //naoSeq.Add(ac.getAngles());
                }

                lib.appendToCache(naoSeq);
                lib.setCachedName(actionName);
                lib.saveCache();
                //bool isJointAction = true; // false if is a walking action
                //ExecuteOnNao(naoSeq, isJointAction);
            }
            lib.save(MainController.ACTION_LIB_PATH);
        }
All Usage Examples Of DataStore.ActionLibrary::appendToCache