Excercise 3.1 "move and then update" the position

Hi, before posting this question i did searched the form and found similar question since 2021 and no much responses. Also i could see the code was diff way back then, than now.

The problem i see is in specific to the update after it completes its movement (`move_forward/backward). I have tried to add sleep through diff thread (though this is supposed to be a basic c++ beginner course), im getting the same position as initially recorded.

looking at the class implementation, seems the get position just calls the this->x but when searching for a place if its getting updated, i got lost.

so i tried by editing the base class implementation to display the position like this.


Is the base implementation is not done or am i doing anything wrong.
if so why does the exercise question says move and then update position.

Hello @KarthikeyanBalasubramanian ,

I think you are misunderstanding the exercise. You don’t have to modify the base class rosbot_class.cpp. You should write your code in unit3_exercise.cpp and simply call the needed methods from the base class. You’re not supposed to modify the base class, it’s just a helper to let you interact with the robot through its methods. For example, to move the robot forward, to get the robot’s position, etc…

Hope this helps,