Solves tasks, but fails grading + grader freeze


I’ve been trying to finish the prerequisite exam to get the accomplishment, however, despite trying to follow the specifications very precisely, several of the tasks fail while grading. This is despite all the tasks being performed, to my knowledge, correctly. Also, the grader only manages to get this far in the process before it just hangs/freezes. I’ve let it sit for 30 mins and no progress.

Could you please look into this? I’ll add the relevant code from the failed tasks:

All the best.

#!/usr/bin/env python

import rospy

from robot_control_class import RobotControl

rc = RobotControl()

while not rospy.is_shutdown():

    rc.move_straight_time("forward", 0.7, 1)

    rc.turn("clockwise", 1,1.49)





#Check equality two string variables

if [ $1 == $strval1 ]; then

  echo "Running small_square program!"

  rosrun linux_exam


if [ $1 == $strval2 ]; then

  echo "Running medium_square program!"

  rosrun linux_exam


if [ $1 == $strval3 ]; then

  echo "Running big_square program!"

  rosrun linux_exam


#!/usr/bin/env python

from robot_control_class import RobotControl

def get_highest_lowest():

    instance = RobotControl()

    scan_data = instance.get_laser_full()

    l = scan_data

    minimum = l[0]      # first input

    maximum = l[0]      # first input

    # minimum loop

    for number in l:

        if number != float("inf") and number != float("-inf"):

            if minimum > number:

                minimum = number

        min_index = l.index(minimum)

    # maximum loop

    for number in l:

        if number != float("inf") and number != float("-inf"):

            if maximum < number:

                maximum = number

        max_index = l.index(maximum)

    return max_index, min_index


Hello @torpanvil ,

From what I can see in your files, you have created ROS packages instead of regular folders. This might be causing some conflicts with the correction system. The linux_exam and python_exam folders have to be regular folders.


1 Like

Thank you @albertoezquerro. It worked creating new folders and move the files there, and delete the old ones.

However, the grader still hangs. I’ve left it for 20-30mins. No change.

Hello @torpanvil ,

The problem is that your program never ends because you are checking if rospy.is_shutdown(). Therefore, if nobody terminates the program it will never end.

Thanks @albertoezquerro.
I added a rospy.on_shutdown(“reason”) to the end of the while loops, and that fixed it.

Thanks for your awesome work with the material.