Unit 6 MicroProject - change robot_control_class.py

Hello.
Somehow I do not really get why there is so much code provided in this exercise.
Should I put this code in the robot_control_class.py (update it) and then import the updated robot_control_class.py to my code to get out of the maze?

Hi @LenaP, welcome to the community!

The file robot_control_class.py is a Python Class that you can use in a different file in order to implement the methods you need to get out of the maze, yes.

What do you mean by “(update it)”, could you send a screenshot of what you mean?

image

I am talking about the code in the exercise. Should I replace the code in the robot_control_class.py in the workspace with the code provided in the exercise?

Hi @LenaP,

in the second unit of the course, you are asked to create a file named robot_control_class.py inside your ~/catkin_ws/src folder.

The class contains many methods, but there is not a method called rotate.

In the Unit 6 - Project, we are told that we are going to use a new method, called rotate:

Finally, and for this project, you are going to be able to use a new method.

  • rotate (degrees): This method will allow your robot to rotate for the specified number of degrees.
    • degrees: The number of degrees you want your robot to rotate.

Since in the robot_control_class.py used in the previous Units do not contain the rotate method, the instructions then present the updated code with the rotate method:

Below you can find the updated code for the robot_control_class.py class, which contains the new rotate() method.

You just have to replace the code in robot_control_class.py with the new code provided in Unit 6, so that you can use the rotate method.

Please let us know if you still need help on this.

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.