Mistakes in the C++ For Robotics Course

I quickly went through most of the C++ For Robotics course today and ran into a number of mistakes when doing so. I’ve listed them all below.

Chapter 1

Problem 1

cd ~/catkin_ws/src/cpp_course_repo/c_scripts/src

This folder does not exist in the cloned repo so cd will fail.

Problem 2

The CMakeLists.txt file includes targets for all of the exercises despite the source files not existing. Running catkin_make without commenting out the targets for the other units results in a make error. From working through the other chapters, it seems like the other unit source files were originally meant to exist as just an empty main function (e.g. unit 3 says “open the file unit3_exercise.cpp” rather than “create and file unit3_exercise.cpp”).

Chapter 2

Problem 1

RosbotClass::move_backwards actually moves the robot forwards at a slightly faster speed than RosbotClass::move_forwards does.

Problem 2

The logic in Exercise 3.2 is wrong. If we pass the limit that we want to reach, the robot stops. Otherwise, the robot travels backwards. If the issue with RosbotClass::move_backwards mentioned above is fixed and the robot did not reach the x limit when moving forwards. The robot will start to move backwards and continue to move backwards forever since it can never reach that x value.

Chapter 4

Problem 1

The output of Exercise 5.1 shows a different filename (i.e. rosrun c_scripts fourthscript) and doesn’t contain any output about moving the robot forward.

Chapter 5

Problem 1

The soultion to 6.1 doesn’t turn the robot enough to stop it from crashing into the wall.

Hello @acis.ubc ,

Many thanks for this feedback. I will go through all these points during today (and probably next week) in order to solve all of them.

Best,