These are some parts of my crawler header file. I cannot make changes to this header file.
private:
int top_position; // The maximum position of the throttle
bool left_reverse; // true if left direction is reverse
bool right_reverse; // true if right direction is reverse
So I tried to implement left_reverse
in my implementation file. This is still a stub though.
bool left_reverse()
{
return(false);
}
And I use it in implementing other function.
double Crawler::left_engine_speed() const
{
double speedpercentage;
double hundred(100.0);
speedpercentage = left_throttle.flow()*hundred;
if(left_reverse()) // <<< HERE IT IS
{
speedpercentage=speedpercentage*(-1);
}
return(speedpercentage);
}
However I receive an error telling me
error: '((const Vehicles::Crawler*)this)->Vehicles::Crawler::left_reverse' cannot be used as a function.
Can someone tell me the problem here?