Beispiel #1
0
        /// <summary>
        /// Returns true if the Nao is currently holding an object.
        /// </summary>
        /// <returns>A boolean.</returns>
        public virtual bool HoldingObject()
        {
            //motion.getwa
            //motion.setWalkArmsEnabled(false, false);
            bool  holdingObject;
            float rad = (float)(0.25 * Math.PI);

            motion.moveTo(0, 0, rad);
            Eyes.Instance.LookDown();

            holdingObject = processor.ObjectInSight();
            Logger.Log(this, "The Nao is holding an object: " + holdingObject);
            Eyes.Instance.LookStraight();
            motion.moveTo(0, 0, -rad);

            return(holdingObject);
        }
Beispiel #2
0
        private bool Rotate(MotionProxy motionProxy, ref float actualRotation)
        {
            if (actualRotation > this.MaxRotation)
            {
                return(false);
            }

            motionProxy.moveInit();
            motionProxy.moveTo(0f, 0f, this.RotationAmount);
            actualRotation += this.RotationAmount;

            return(true);
        }
Beispiel #3
0
        /// <summary>
        /// Aligns the robot with the landmark
        /// </summary>
        /// <param name="motionProxy"></param>
        /// <param name="markInfo"></param>
        private void AlignWithMark(MotionProxy motionProxy, ArrayList markInfo)
        {
            // get mark shape infor
            var shapeInfo = LandMarkHelper.Instance.GetShapeInfo(markInfo);

            // get current yaw position
            var currentYawPosition = motionProxy.getAngles("HeadYaw", true);

            if (!currentYawPosition.IsNullOrEmpty() && shapeInfo[1] != null)
            {
                // move pitch to landmark
                MotionHelper.MoveHead(motionProxy, shapeInfo[2] as float?, null, false);
                // calculate robot rotation
                var rotation = currentYawPosition[0] + (float)shapeInfo[1];
                motionProxy.moveTo(0f, 0f, rotation);
                // reset yaw
                MotionHelper.MoveHead(motionProxy, null, 0f, true);
            }
        }
Beispiel #4
0
        private void button_hello_Click(object sender, EventArgs e)
        {
            /*
             * this.tts.setVoice("Kenny22Enhanced");
             * this.tts.setVoice("Julie22Enhanced");
             *
             * this.tts.setVolume(1.0F);
             * this.tts.say("Hello World.");
             */

            Console.Beep();

            foreach (string line in this.tts.getAvailableVoices())
            {
                this.label_raw_output.Text += "\n" + line;
            }



            //RobotPostureProxy posture = new RobotPostureProxy(this.textBox_IP.Text, 9559);
            //posture.goToPosture("Stand", 0.1f);

            motion.moveTo(0.1f, 0f, 0f);
        }
Beispiel #5
0
 /// <summary>
 /// Turn given radians.
 /// </summary>
 /// <param name="dir"></param>
 public void Turn(float dir)
 {
     motion.moveTo(0, 0, dir);
 }
Beispiel #6
0
 /// <summary>
 /// The Nao will walk towards given coordinates.
 /// </summary>
 /// <param name="x">X-coordinate.</param>
 /// <param name="y">Y-coordinate.</param>
 /// <param name="theta">The angle with which to move towards the destination.</param>
 public void WalkTo(float x, float y, float theta)
 {
     InitMove();
     Motion.moveTo(x, y, theta);
 }