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 }
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"); }
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; }
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); }
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(); }
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); }
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); }
public MistyFoursquareApi(IRobotMessenger misty1) { _misty = misty1; }
public MistyQuoteApi(IRobotMessenger misty1) { _misty = misty1; }
public MistyServiceApi(IRobotMessenger misty1) { _misty = misty1; }
public MistyMapDistanceMatrixApi(IRobotMessenger misty1) { _misty = misty1; }
public WanderDrive(IRobotMessenger robot, CurrentObstacleState wanderState, bool debugMode) : base(robot, wanderState, debugMode) { }
public MistySpeechApi(IRobotMessenger misty1) { _misty = misty1; }
public MistyWeatherApi(IRobotMessenger misty1) { _misty = misty1; }
public MistyStockApi(IRobotMessenger misty1) { _misty = misty1; }
/// <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; }
public void LoadRobotConnection(IRobotMessenger robotInterface) { _misty = robotInterface; _currentObstacleState = new CurrentObstacleState(); _misty.RegisterForSDKLogEvents(PrintMessage); }
/// <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; }
public void LoadRobotConnection(IRobotMessenger robotInterface) { Skill.TimeoutInSeconds = int.MaxValue; _misty = robotInterface; }
public BaseDrive(IRobotMessenger robot, CurrentObstacleState currentObstacleState, bool debugMode) { _misty = robot; _currentObstacleState = currentObstacleState; _debugMode = debugMode; }
/// <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; }
public FollowPath(IRobotMessenger misty, SkillHelper skillHelper) { _misty = misty ?? throw new ArgumentNullException(nameof(misty)); _skillHelper = skillHelper ?? throw new ArgumentNullException(nameof(skillHelper)); }
/// <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; }
public MistyTwilioApi(IRobotMessenger misty1, string twilioAccountSid, string twilioAuthToken) { _misty = misty1; TwilioClient.Init(twilioAccountSid, twilioAuthToken); }
public AssetWrapper(IRobotMessenger robotMessenger) { _misty = robotMessenger; }
public MistyJokeApi(IRobotMessenger misty1) { _misty = misty1; }
public void LoadRobotConnection(IRobotMessenger robotInterface) { _misty = robotInterface; _assetHelper = new AssetHelper(_misty); }
public AssetHelper(IRobotMessenger robotMessenger) { _misty = robotMessenger; }
public MistyNewsApi(IRobotMessenger misty1) { _misty = misty1; }
public MistyInfo(IRobotMessenger misty1) { _misty = misty1; LoadListOfInfo(); }