Issue with

At first my script seems to work correctly and makes the robot move according to the input argument but then it seems to do the other 2 as well am I missing something?


if [ $var="big_square" ]

then rosrun linux_exam


if [ $var="medium_square" ]

then rosrun linux_exam


if [ $var="small_square" ]

then rosrun linux_exam


also for it wants me to create an instance of RobotClass but I wasnt given the files necessary to import?

Hi @thunderbootyclap ,

it’s recommended to use the variables inside double-quotes, like "$var" when checking their values, because if for any reason the variable is evaluated as empty, your script would raise an error.

And for the RobotClass, in the instructions and previous examples, you should be able to see how to import it.

Please let us know if you are still having problems.

Okay i’ll try that but for the RobotClass part, i know how to import it but i just dont have the code, should i go to a past course to just copy paste like normal?

You need to write your if statements like this:

if [ "$var" == "big_square" ]
  • Use == instead of =.
  • Add a space on the right and left sides of the ==.

Regarding RobotControl class, I’m sorry we should actually provide it in the exam notes. I’ll update the notes accordingly.

In the meantime, you can get in the Python 3 for Robotics course, in the Python Essentials unit. You can copy it easily using the Notebook Review app:


I did grabbed the code but now th library wont function because its having an issue with other imports?

[Edit] Actually ignore that i was using the wrong code for the class, I hadnt noticed the new section.

1 Like