Ros actions and services

I have tried doing exercise8.13 move_square_drone problem from ROS Basics in 5 days. I have used the code provided in solution but also I’m unable to execute it. The problem is occuring when I do launch rostopic list is not getting the five topics which are supposed to appear. I have launched in webshell 1 and rostopic list has been searched in other webshell. It didnt work.

I also have doubt regarding services. When I create server and launch it. The error saying "no module named <package_name> is popping up on screen. I have tried in all ways possible catkin_make is done and sourcing is also done and CMakeLists.txt file with package.xml being the same as given in the tasks. This issue is with every task even with services_quiz. I have even tried doing rm -rf build and do catkin_make. It still didnt work. Even the code when placed the same that is not functioning.

CMake Error at /opt/ros/noetic/share/catkin/cmake/catkin_package.cmake:196 (message):
catkin_package() the catkin package ‘rospy’ has been find_package()-ed but
is not listed as a build dependency in the package.xml
Call Stack (most recent call first):
/opt/ros/noetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
my_example_pkg_final/CMakeLists.txt:105 (catkin_package)

– Configuring incomplete, errors occurred!
See also “/home/user/catkin_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/home/user/catkin_ws/build/CMakeFiles/CMakeError.log”.
Invoking “cmake” failed

This is the error coming up always let it be in services or actions.

Hello @saitarak.padarthi ,

The error message is saying this:

This basically says that you need to add the rospy package as a <build_dependency> in the package.xml file. In order to avoid this kind of issue, it is always recommended to add rospy as a dependency when creating the package, as explained in the first units.

Best,