This subclass of DtTaskControllerComponent will listen to front-end tasks and implement the subtasking mechanism for a turn and move to.
Header file:
#ifndef turnAndMoveController_H_
#define turnAndMoveController_H_
{
private:
public:
protected:
public:
protected:
{
};
};
#endif
Implementation:
myProcessState(0)
{
}
{
{
}
}
{
{
return false;
}
{
return false;
}
return true;
}
{
DtString processSRName = DtString::nullString();
DtString processSRType = DtString::nullString();
{
}
if (processSRName == DtString::nullString())
{
processSRName = "turn-and-move-psr";
}
if (processSRType == DtString::nullString())
{
}
{
return false;
}
return true;
}
{
}
{
}
{
}
{
{
{
{
"Error starting turn-and-move task." << std::endl;
}
}
}
}
{
}
{
{
{
{
{
"Done turning." << std::endl;
}
{
"Done moving; Task complete." << std::endl;
}
}
}
}
}
{
}
{
if (destination)
{
"Starting TURNING subtask." << std::endl;
double desiredHeading =
return true;
}
else
{
"Could not find destination object "
return false;
}
}
{
"Starting MOVING subtask." << std::endl;
return true;
}
{
}
{
}