Perfect! Now we can actually know what the error is. Remember, understanding the error is the most important part while debugging. Your idea of installing the packages is a good one, but the course already has them installed.
Did you add the required packages as ament_target_dependencies in your pakcage CMakeLists.txt?