I am on Exercise 4.1 where we are supposed to copy the provided code to a ‘rotate_robot_integration_test.py’ file in the test directory in the robot_control package.
I have done that and run the ‘rosrun robot_control rotate_robot_integration_test.py’ to see the test result on the CLI, but it goes in the suspended state. I used Ctrl+z to exit and thought it could be a catkin_make issue.
So I ran the catkin_make and sourced the devel/setup.bash in all the terminals. I ran the command and it is still not giving the appropriate test result. The xml file is empty as well.
After that, ROS_MASTER_URI should be ok if it was not ok before.
But even if ROS_MASTER_URI is correctly set, I see that the test is waiting for a service named rotate_robot.
With rosservice list, can you find any service named rotate_robot? If not, maybe you need to run a node that provides that service before running the test.
In any case, we are going to review this course deeper to see what may be wrong in the course.
I’ve tested both unit3 and 4 and it worked.
There might be some small issue sometimes, that it seems more related with ROS timing and the simulator:
ROSUNIT] Outputting test results to /home/user/.ros/test_results/robot_control/rosunit-rotate_robot_integration_test.xml
[Testcase: test_correct_rotation] … FAILURE!
FAILURE: Integration error. Rotation was not between the expected values.
File “/usr/lib/python2.7/unittest/case.py”, line 329, in run
testMethod()
File “/home/user/catkin_ws/src/robot_control/test/rotate_robot_integration_test.py”, line 73, in test_correct_rotation
self.assertTrue((1.3 <= yaw_diff <= 2.1), “Integration error. Rotation was not between the expected values.”)
File “/usr/lib/python2.7/unittest/case.py”, line 422, in assertTrue
raise self.failureException(msg)
SUMMARY:
RESULT: FAIL
TESTS: 1
ERRORS: 0
FAILURES: 1 [test_correct_rotation]
But as far as the reported issue goes, if you launch previopusly the service through teh command given in unit 3, it should work without issues: