Added LICENSE notices. Separated robot definition from implementation.

This commit is contained in:
2016-06-21 03:22:29 -04:00
parent dfcc650f29
commit df09ae9dfe
10 changed files with 231 additions and 56 deletions

View File

@@ -35,32 +35,7 @@ Robot::Robot(std::string hostname, uint32_t port) {
}
Robot::~Robot() {
std::cout << "Destroying robot" << std::endl;
delete _p_proxy;
delete _r_proxy;
delete _p_client;
}
IASSS_Robot::IASSS_Robot(std::string hostname, uint32_t port) : Robot(hostname, port) {
std::cout << "Creating IAS-SS robot on host \"" << hostname << "\" and port " << port << "." << std::endl;
}
IASSS_Robot::~IASSS_Robot() {
std::cout << "Destroying IAS-SS robot." << std::endl;
}
void IASSS_Robot::run() {
_p_client->Read();
if(_r_proxy->GetRange(1) < 1.0) {
if(_r_proxy->GetRange(0) > 1.0)
_p_proxy->SetSpeed(0.0f, PlayerCc::dtor(-45));
else if(_r_proxy->GetRange(2) > 1.0)
_p_proxy->SetSpeed(0.0f, PlayerCc::dtor(45));
else
_p_proxy->SetSpeed(0.0f, PlayerCc::dtor(180));
} else {
_p_proxy->SetSpeed(0.3f, 0.0f);
}
sleep(1);
}