turn - Copy (2) - virtual void setRobot(ArRobot *robot);...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#pragma once #include "Aria.h" # class ActionTurn : public ArAction { public: // constructor, sets the turnThreshold, and turnAmount ActionTurn(double turnThreshold, double turnAmount); // destructor, its just empty, we don't need to do anything virtual ~ActionTurn(void) {}; // fire, this is what the resolver calls to figure out what this action wants virtual ArActionDesired *fire(ArActionDesired currentDesired); // sets the robot pointer, also gets the sonar device, or deactivates this action if there is no sonar.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: virtual void setRobot(ArRobot *robot); protected: // this is to hold the sonar device form the robot ArRangeDevice *mySonar; // what the action wants to do; used by the action resover after fire() ArActionDesired myDesired; // distance at which to start turning double myTurnThreshold; // amount to turn when turning is needed double myTurnAmount; // remember which turn direction we requested, to help keep turns smooth int myTurning; // -1 == left, 1 == right, 0 == none };...
View Full Document

This note was uploaded on 07/19/2011 for the course ECE 101 taught by Professor Chu during the Spring '11 term at Punjab Engineering College.

Ask a homework question - tutors are online