コード例 #1
0
        public ArTagAligner(IRobotMessenger misty, SkillHelper skillHelper)
        {
            _misty       = misty ?? throw new ArgumentNullException(nameof(misty));
            _skillHelper = skillHelper ?? throw new ArgumentNullException(nameof(skillHelper));

            Cleanup();             // just in case things weren't cleaned up during the previous run
        }
コード例 #2
0
 public MistyTellTime(IRobotMessenger misty1, MistySpeechApi speechApi)
 {
     _misty     = misty1;
     _speechApi = speechApi;
     // Set the current time event
     _checkTimeTimer = new Timer(CheckTimeCallback, null, 1000, 60000);
     _misty.SkillLogger.LogVerbose($"Misty.Service : IN MistyTellTime() - TELL TIME SERVICE HAS STARTED");
 }
コード例 #3
0
ファイル: MapNav.cs プロジェクト: peterdrougge/.NET-SDK
 public MapNav(IRobotMessenger misty, SkillHelper skillHelper, double headPitchOffset, double headRollOffset, double headYawOffset)
 {
     _misty           = misty ?? throw new ArgumentNullException(nameof(misty));
     _skillHelper     = skillHelper ?? throw new ArgumentNullException(nameof(skillHelper));
     _headPitchOffset = headPitchOffset;
     _headRollOffset  = headRollOffset;
     _headYawOffset   = headYawOffset;
 }
コード例 #4
0
ファイル: FollowPath.cs プロジェクト: MistyCommunity/.NET-SDK
        public FollowPath(IRobotMessenger misty, SkillHelper skillHelper)
        {
            _misty       = misty ?? throw new ArgumentNullException(nameof(misty));
            _skillHelper = skillHelper ?? throw new ArgumentNullException(nameof(skillHelper));

            _arTagAligner = new ArTagAligner(_misty, _skillHelper);
            _docker       = new ChargerDockSmall(_misty, _skillHelper);
        }
コード例 #5
0
        public ChargerDockSmall(IRobotMessenger misty, SkillHelper skillHelper)
        {
            _misty       = misty ?? throw new ArgumentNullException(nameof(misty));
            _skillHelper = skillHelper ?? throw new ArgumentNullException(nameof(skillHelper));

            Cleanup();             // just in case things weren't cleaned up during the previous run

            _ = LoadChargerOffsetsAsync();
        }
コード例 #6
0
        public SkillHelper(IRobotMessenger misty)
        {
            _misty = misty ?? throw new ArgumentNullException(nameof(misty));

            _misty.RegisterDriveEncoderEvent(EncoderEventCallback, 100, true, null, "SkillHelperEncoderEvent", OnResponse);
            _misty.RegisterIMUEvent(ImuEventCallback, 100, true, null, "SkillHelperIMUEvent", OnResponse);
            _misty.RegisterTimeOfFlightEvent(TofEventCallback, 0, true, null, "SkillHelperTofEventEvent", OnResponse);
            _misty.RegisterHazardNotificationEvent(HazardEventCallback, 0, true, "SkillHelperHazardEvent", OnResponse);
        }
コード例 #7
0
        public SkillHelper(IRobotMessenger misty)
        {
            _misty = misty ?? throw new ArgumentNullException(nameof(misty));

            LogMessage("SkillHelper initiating. Registering event callbacks for encoders and IMU.");

            _misty.RegisterDriveEncoderEvent(EncoderEventCallback, 100, true, null, "SkillHelperEncoderEvent", OnResponse);
            _misty.RegisterIMUEvent(ImuEventCallback, 100, true, null, "SkillHelperIMUEvent", OnResponse);

            // THE HAZARD HANDLING CODE IS CURRENTLY DISABLED
            //_misty.RegisterHazardNotificationEvent(HazardEventCallback, 0, true, "SkillHelperHazardEvent", OnResponse);
        }
コード例 #8
0
 public MistyFoursquareApi(IRobotMessenger misty1)
 {
     _misty = misty1;
 }
コード例 #9
0
 public MistyQuoteApi(IRobotMessenger misty1)
 {
     _misty = misty1;
 }
コード例 #10
0
 public MistyServiceApi(IRobotMessenger misty1)
 {
     _misty = misty1;
 }
コード例 #11
0
 public MistyMapDistanceMatrixApi(IRobotMessenger misty1)
 {
     _misty = misty1;
 }
コード例 #12
0
ファイル: WanderDrive.cs プロジェクト: peterdrougge/.NET-SDK
 public WanderDrive(IRobotMessenger robot, CurrentObstacleState wanderState, bool debugMode)
     : base(robot, wanderState, debugMode)
 {
 }
コード例 #13
0
 public MistySpeechApi(IRobotMessenger misty1)
 {
     _misty = misty1;
 }
コード例 #14
0
 public MistyWeatherApi(IRobotMessenger misty1)
 {
     _misty = misty1;
 }
コード例 #15
0
 public MistyStockApi(IRobotMessenger misty1)
 {
     _misty = misty1;
 }
コード例 #16
0
 /// <summary>
 /// Initialize class variables
 /// </summary>
 /// <param name="misty">Pass the _misty variable used in the rest of the program</param>
 /// <param name="AutoEvent">Pass in the AutoResetEvent used in the hazard events</param>
 public MoveCommands(IRobotMessenger misty, AutoResetEvent AutoEvent) // TODO:  ref bool _isMovingFromHazard test how refs work in c#
 {
     _misty    = misty;
     autoEvent = AutoEvent;
     //isMovingFromHazard = _isMovingFromHazard;
 }
コード例 #17
0
ファイル: Wander.cs プロジェクト: peterdrougge/.NET-SDK
 public void LoadRobotConnection(IRobotMessenger robotInterface)
 {
     _misty = robotInterface;
     _currentObstacleState = new CurrentObstacleState();
     _misty.RegisterForSDKLogEvents(PrintMessage);
 }
コード例 #18
0
ファイル: ForceDriving.cs プロジェクト: akeecha/IntroSkills
		/// <summary>
		///	This method is called by the wrapper to set your robot interface
		///	You need to save this off in the local variable commented on above as you are going use it to call the robot
		/// </summary>
		/// <param name="robotInterface"></param>
		public void LoadRobotConnection(IRobotMessenger robotInterface)
		{
			_misty = robotInterface;
			_misty.SkillLogger.LogLevel = SkillLogLevel.Verbose;
		
		}
コード例 #19
0
ファイル: MistySkill.cs プロジェクト: MistyCommunity/.NET-SDK
 public void LoadRobotConnection(IRobotMessenger robotInterface)
 {
     Skill.TimeoutInSeconds = int.MaxValue;
     _misty = robotInterface;
 }
コード例 #20
0
ファイル: BaseDrive.cs プロジェクト: peterdrougge/.NET-SDK
 public BaseDrive(IRobotMessenger robot, CurrentObstacleState currentObstacleState, bool debugMode)
 {
     _misty = robot;
     _currentObstacleState = currentObstacleState;
     _debugMode            = debugMode;
 }
コード例 #21
0
ファイル: MovementHistory.cs プロジェクト: maclo4/AIMS
        /// <summary>
        /// Redo the commands in the queue in reverse to retrace steps
        /// </summary>
        /// <param name="_misty">The IRobotMessenger representing the current Misty in use</param>
        /// <param name="stepsToRetrace">Number of commands in the queue to retrace</param>
        public void RetraceSteps(IRobotMessenger _misty, int stepsToRetrace = -1)
        {
            HazardSettings hazardSettings = new HazardSettings();

            hazardSettings.DisableTimeOfFlights = true;
            hazardSettings.DisableBumpSensors   = true;
            _misty.UpdateHazardSettings(hazardSettings, null);

            currentTime = DateTimeOffset.Now;

            retracingSteps = true;
            if (stepsToRetrace >= moveQueue.Count || stepsToRetrace == -1)
            {
                stepsToRetrace = moveQueue.Count;
            }
            //int size = inputBuffer.Count;
            Debug.WriteLine("size: " + size);
            Debug.WriteLine("stepstoretrace: " + stepsToRetrace);
            for (int i = 0; i < stepsToRetrace; i++)             // TODO: maybe change the <= to <
            {
                IRobotCommandEvent moveCommand = Pop();

                TimeSpan millisecondsToDriveFor = currentTime.Subtract(moveCommand.Created);
                currentTime = moveCommand.Created;

                if (moveCommand.Command == "Drive" || moveCommand.Command == "DriveAsync")
                {
                    var    linearVelocityString  = moveCommand.Parameters["LinearVelocity"];
                    var    angularVelocityString = moveCommand.Parameters["AngularVelocity"];
                    double linearVelocity        = Convert.ToDouble(linearVelocityString);
                    double angularVelocity       = Convert.ToDouble(angularVelocityString);

                    Debug.WriteLine("MoveCommand[" + i + "] Drive() Linear Velocity: " + (double)linearVelocity * -1 + ", Angular Velocity: " + (double)angularVelocity * -1 + " , ms: " + (int)millisecondsToDriveFor.TotalMilliseconds);
                    _misty.DriveTime(linearVelocity * -1, angularVelocity * -1, (int)millisecondsToDriveFor.TotalMilliseconds, DriveTrackResponse);

                    Thread.Sleep((int)millisecondsToDriveFor.TotalMilliseconds + 500);
                }
                else if (moveCommand.Command == "DriveTime" || moveCommand.Command == "DriveTimeAsync")
                {
                    var linearVelocity  = Convert.ToDouble(moveCommand.Parameters["LinearVelocity"]);
                    var angularVelocity = Convert.ToDouble(moveCommand.Parameters["AngularVelocity"]);
                    var timeMs          = (int)Convert.ToInt64(moveCommand.Parameters["TimeMs"]);
                    Debug.WriteLine("MoveCommand[" + i + "] DrivTime() Linear Velocity: " + (double)linearVelocity * -1 + ", Angular Velocity: " + (double)angularVelocity * -1 + " , ms: " + (int)millisecondsToDriveFor.TotalMilliseconds);
                    _misty.DriveTime(linearVelocity * -1, angularVelocity * -1, (int)millisecondsToDriveFor.TotalMilliseconds, DriveTrackResponse);
                    Thread.Sleep((int)millisecondsToDriveFor.TotalMilliseconds + 500);
                }
                else if (moveCommand.Command == "Stop" || moveCommand.Command == "StopAsync")
                {
                    Debug.WriteLine("MoveCommand[" + i + "] Stop() Linear Velocity: 0, Angular Velocity: 0 , ms: " + (int)millisecondsToDriveFor.TotalMilliseconds);
                    _misty.DriveTime(0, 0, (int)millisecondsToDriveFor.TotalMilliseconds, DriveTrackResponse);
                    Thread.Sleep((int)millisecondsToDriveFor.TotalMilliseconds + 500);
                }
                else if (moveCommand.Command == "DriveArc" || moveCommand.Command == "DriveArcAsync")
                {
                    var heading = Convert.ToDouble(moveCommand.Parameters["Heading"]);
                    var radius  = Convert.ToDouble(moveCommand.Parameters["Radius"]);
                    var timeMs  = (int)Convert.ToInt64(moveCommand.Parameters["TimeMs"]);
                    var reverse = Convert.ToBoolean(moveCommand.Parameters["Reverse"]);
                    Debug.WriteLine("MoveCommand[" + i + "] DriveArc() Heading: " + heading + ", Radius: " + radius + ", TimeMs: " + timeMs + ", Reverse: " + reverse);
                    _misty.DriveArc(heading, radius, timeMs, !reverse, DriveTrackResponse);

                    Thread.Sleep(timeMs + 500);
                }

                Debug.WriteLine("int i = " + i + ", stepstoretrascce = " + stepsToRetrace);
            }

            hazardSettings.DisableTimeOfFlights = false;
            hazardSettings.RevertToDefault      = true;
            _misty.UpdateHazardSettings(hazardSettings, null);

            retracingSteps = false;
        }
コード例 #22
0
ファイル: FollowPath.cs プロジェクト: peterdrougge/.NET-SDK
 public FollowPath(IRobotMessenger misty, SkillHelper skillHelper)
 {
     _misty       = misty ?? throw new ArgumentNullException(nameof(misty));
     _skillHelper = skillHelper ?? throw new ArgumentNullException(nameof(skillHelper));
 }
コード例 #23
0
 /// <summary>
 ///	This method is called by the wrapper to set your robot interface
 ///	You need to save this off in the local variable commented on above as you are going use it to call the robot
 /// </summary>
 /// <param name="robotInterface"></param>
 public void LoadRobotConnection(IRobotMessenger robotInterface)
 {
     _misty = robotInterface;
 }
コード例 #24
0
 public MistyTwilioApi(IRobotMessenger misty1, string twilioAccountSid, string twilioAuthToken)
 {
     _misty = misty1;
     TwilioClient.Init(twilioAccountSid, twilioAuthToken);
 }
コード例 #25
0
ファイル: AssetWrapper.cs プロジェクト: peterdrougge/.NET-SDK
 public AssetWrapper(IRobotMessenger robotMessenger)
 {
     _misty = robotMessenger;
 }
コード例 #26
0
 public MistyJokeApi(IRobotMessenger misty1)
 {
     _misty = misty1;
 }
コード例 #27
0
 public void LoadRobotConnection(IRobotMessenger robotInterface)
 {
     _misty       = robotInterface;
     _assetHelper = new AssetHelper(_misty);
 }
コード例 #28
0
ファイル: AssetHelper.cs プロジェクト: peterdrougge/.NET-SDK
 public AssetHelper(IRobotMessenger robotMessenger)
 {
     _misty = robotMessenger;
 }
コード例 #29
0
 public MistyNewsApi(IRobotMessenger misty1)
 {
     _misty = misty1;
 }
コード例 #30
0
 public MistyInfo(IRobotMessenger misty1)
 {
     _misty = misty1;
     LoadListOfInfo();
 }