Пример #1
0
        /// <summary>
        /// Starts the task. Called when the operator clicks the Go button.
        /// </summary>
        /// <param name="command">The movement command (velocity, acceleration)</param>
        /// <param name="duration">The duration of movement</param>
        internal void Go(MotionCommand command, double duration)
        {
            logger.Debug("Enter: Go(MotionCommand, double)");

            if (command.innerPosition == Hulk.ANY_MOTION)
            {
                // Moving with given velocity/acceleration and (optionally) duration.

                logger.Info("Starting rotation task with given velocity, acceleration, and duration.");

                Hulk.SetCommandType(Hulk.CommandType.Velocity);

                if (duration == -1.0)
                {
                    stopTime = DateTime.MinValue;
                }
                else
                {
                    stopTime = DateTime.Now.AddSeconds(duration);
                }

                Hulk.SetCommand(command);
                Hulk.StartTask();
            }
            else
            {
                // Moving to the given position.

                logger.Info("Starting rotation task to given position.");

                Hulk.SetCommandType(Hulk.CommandType.ModulusPosition);
                Hulk.SetCommand(command);
                Hulk.StartDefinedMove(false);
            }
        }
        /// <summary>
        /// Starts the task. Called when the operator clicks the Go button.
        /// </summary>
        /// <param name="sender">Not used</param>
        /// <param name="e">Not used</param>
        internal void Go()
        {
            MotionCommand newMotionCommand;

            logger.Debug("Enter: Go()");

            Hulk.Halt();

            startOuterPosition = Hulk.CurrentMotion.outerPosition;
            startInnerPosition = Hulk.CurrentMotion.innerPosition;

            logger.Info("Starting position task with center at OUTER=" + startOuterPosition.ToString("F1") +
                        " INNER=" + startInnerPosition.ToString("F1") + ".");

            Hulk.SetCommandType(Hulk.CommandType.ModulusPosition);

            newMotionCommand = new MotionCommand {
                outerVelocity     = POSITIONING_VELOCITY,
                innerVelocity     = POSITIONING_VELOCITY,
                outerAcceleration = POSITIONING_ACCELERATION,
                innerAcceleration = POSITIONING_ACCELERATION
            };

            Hulk.SetCommand(newMotionCommand);
            Hulk.StartTask();
        }
        /// <summary>
        /// Starts the task. Called when the operator clicks the Go button.
        /// </summary>
        /// <param name="command">The movement command (velocity, acceleration)</param>
        /// <param name="duration">The duration of movement</param>
        internal void Go(MotionCommand command, double duration)
        {
            logger.Debug("Enter: Go(MotionCommand, double)");

            if (command.innerPosition == Hulk.ANY_MOTION)
            {
                // Moving with given velocity/acceleration and (optionally) duration.

                logger.Info("Starting UnrealLandscapesDemoTask with given duration.");

                Hulk.SetCommandType(Hulk.CommandType.Velocity);

                Hulk.SetCommand(command);
                Hulk.StartTask();
            }
            else
            {
                // Moving to the given position.

                logger.Info("Starting UnrealLandscapesDemoTask to given position.");

                Hulk.SetCommandType(Hulk.CommandType.ModulusPosition);
                Hulk.SetCommand(command);
                Hulk.StartDefinedMove(false);
            }
        }
Пример #4
0
        /// <summary>
        /// Starts the task. Called when the operator clicks the Go button.
        /// </summary>
        internal void Go()
        {
            MotionCommand newMotionCommand;

            logger.Debug("Enter: Go()");

            logger.Info("Starting passive movement task.");

            previousTrigger = false;
            numClicks       = 0;

            lastPositionOuter = Hulk.CurrentMotion.outerPosition;
            lastPositionInner = Hulk.CurrentMotion.innerPosition;

            currentTrialNumber = Recordings.GetFirstTrialNumber();

            DataLogger.AcquireDataLog(String.Format("recording{0:000}.csv", currentTrialNumber), dataLogHeader);

            runningStopwatch.Reset();
            runningStopwatch.Start();

            Hulk.SetCommandType(Hulk.CommandType.ModulusPosition);

            newMotionCommand = new MotionCommand {
                outerVelocity     = POSITIONING_VELOCITY,
                innerVelocity     = POSITIONING_VELOCITY,
                outerAcceleration = POSITIONING_ACCELERATION,
                innerAcceleration = POSITIONING_ACCELERATION
            };

            Hulk.SetCommand(newMotionCommand);
            Hulk.StartTask();
        }
        /// <summary>
        /// Starts the task. Called when the operator clicks the Go button.
        /// </summary>
        /// <param name="functionFilename">The filename of the CSV file containing the forcing function</param>
        /// <param name="selectedAmplitude">The amplitude of the forcing function</param>
        /// <param name="selectedOffset">???</param>
        internal void Go(string functionFilename, double selectedAmplitude, double selectedOffset)
        {
            MotionCommand newMotionCommand;

            logger.Debug("Enter: Go()");

            logger.Info("Starting delay measurement task.");

            amplitude = selectedAmplitude;

            // Move to the start location

            Hulk.SetCommandType(Hulk.CommandType.ModulusPosition);

            newMotionCommand = new MotionCommand();
            newMotionCommand.innerPosition     = selectedOffset;
            newMotionCommand.outerPosition     = 0.0;
            newMotionCommand.outerVelocity     = Hulk.NORMAL_VELOCITY;
            newMotionCommand.innerVelocity     = Hulk.NORMAL_VELOCITY;
            newMotionCommand.outerAcceleration = Hulk.NORMAL_ACCELERATION;
            newMotionCommand.innerAcceleration = Hulk.NORMAL_ACCELERATION;

            Hulk.SetCommand(newMotionCommand);
            Hulk.StartDefinedMove(false);

            while (Hulk.SystemStatus != Hulk.Status.Idling)
            {
                Thread.Sleep(100);
            }

            // Prepare for trial

            DataLogger.AcquireDataLog(Path.GetFileNameWithoutExtension(functionFilename) +
                                      "_Amplitude" + amplitude.ToString("F1") + "_Offset" + selectedOffset.ToString("F1") + "_data.csv", dataLogHeader);

            runningStopwatch.Reset();
            runningStopwatch.Start();

            // Start task

            Hulk.SetCommandType(Hulk.CommandType.Velocity);
            Hulk.StartTask();
        }