// the message handling function (called by an internal timer) public override void handleMessages(object sender, EventArgs e) { int packetsavailable = packetsAvailable(); EZPacket pack; // 1. checking pakcets available and acting if (packetsavailable > 0) { pack = getNextAvailablePacket(); // unwrapping the packet CommandMsg msg = RobotMessenger.convertBytes2CommandMsg(pack.Message); ////////////////// Handle the message here ////////////////// // sending a sample answer CommandMsg outmsg = new CommandMsg(); outmsg.robot = t_Robot.t_Station; outmsg.Cmd = RobotCmd.rc_ManualCommand; outmsg.CmdParams = new byte[] { (byte)'H', (byte)'E', (byte)'L', (byte)'L', (byte)'O' }; outmsg.ParamsLength = (byte)outmsg.CmdParams.Length; // one byte - ability index // send it sendCommandMessage(outmsg); } }
public void Run(IBackgroundTaskInstance taskInstance) { RobotMessenger.LoadAndPrepareSkill ( taskInstance, new MoveArmsAndHead() ); }
public void Run(IBackgroundTaskInstance taskInstance) { RobotMessenger.LoadAndPrepareSkill ( taskInstance, new RespondToTouchSensors() ); }
public void Run(IBackgroundTaskInstance taskInstance) { RobotMessenger.LoadAndPrepareSkill ( taskInstance, new Wander(), SkillLogLevel.Verbose ); }
public void Run(IBackgroundTaskInstance taskInstance) { //Load your skill and attach to the Misty robot RobotMessenger.LoadAndPrepareSkill ( taskInstance, new MistyNativeSkill(), SkillLogLevel.Verbose ); }
public override void handleMessages(object sender, EventArgs e) { int packetsavailable = packetsAvailable(); EZPacket pack; // 1. checking pakcest available and acting if (packetsavailable > 0) { pack = getNextAvailablePacket(); // unwrapping the packet CommandMsg msg = RobotMessenger.convertBytes2CommandMsg(pack.Message); // handling the message switch (msg.Cmd) { case RobotCmd.rc_CommandDone: // handling the flags flagAbilityExecuting = false; flagAbilityDone = true; break; case RobotCmd.rc_ManualCommand: // Nothing... break; case RobotCmd.rc_SendCMUCAMAbstractionData: // nothing... break; case RobotCmd.rc_SendSensors: // nothing break; case RobotCmd.rc_SensorData: // retrieving sensory data from the avatar acquireSensorData(msg); flagSensorDataAcquired = true; break; case RobotCmd.rc_CMUCAMAbstractionData: // retrieving a CMUCAM frame acquireCMUCAMAbstractionData(msg); break; case RobotCmd.rc_SonarFired: // handling flags flagSonarArrayFiring = false; flagSonarArrayFiringDone = true; break; } } // 2. Cheking state and flags if (flagAbstractionDataReady) { requestCMUCAMAbstractionData(); } }
/* * Current intro skills in (somewhat) order of complexity: * * SkillTemplate, //empty skill template you can use to build your skills * * MostlyHarmlessSkill, * MostlyHarmlessTooSkill, * HelloWorldSkill, * HelloAgainWorldSkill, * LookAroundSkill, * InteractiveMistySkill, * ForceDriving, * HelloLocomotionSkill * * Change the skill below and re-deploy to run the skill * * If you want to run multiple at the same time, you will need to make a Skill Background Task for each skill and deploy individually - see below or documentation for more details. * */ public void Run(IBackgroundTaskInstance taskInstance) { //Call LoadAndPrepareSkill to register robot events and add an instance of the robot interface to the skill RobotMessenger.LoadAndPrepareSkill ( //Background task instance passed in for task management, managed by system taskInstance, //Instance of your skill new ForceDriving(), //Skill Log Level to start in SkillLogLevel.Verbose, //Overwrite default logging preface to help label runs in log "Skill Test Run #1 => " ); }
public void Run(IBackgroundTaskInstance taskInstance) { RobotMessenger.LoadAndPrepareSkill(taskInstance, new UnitTestExampleSkill()); }
public void Run(IBackgroundTaskInstance taskInstance) { RobotMessenger.LoadAndPrepareSkill(taskInstance, new TextToSpeech()); }
public void Run(IBackgroundTaskInstance taskInstance) { RobotMessenger.LoadAndPrepareSkill(taskInstance, new MistyNativeSkill(), MistyRobotics.Common.Types.SkillLogLevel.Verbose); }
public void Run(IBackgroundTaskInstance taskInstance) { RobotMessenger.LoadAndPrepareSkill(taskInstance, new GrossMisty()); }
private void Awake() { messenger = GetComponentInParent <RobotMessenger> (); Debug.Assert(messenger != null, "Couldn't find a Messenger in the GameObject"); }
private void Awake() { robMov = GetComponent <RobotMovement> (); robMes = GetComponent <RobotMessenger> (); CurrentBatteryAmount = maxBattery; }