9. Practical Guide\9.2 Moving Forward

9.2  Moving Forward

Program a robot to move forward at 60% of the full speed in WORLD_1.

 

Procedure:

1.    In the “Practice” panel, click on “AI” to launch the AI programming pane.

2.    Choose WORLD_1.

3.    Define a new project. Give a project name ”Moving Forward” and Click on “OK” to confirm.

4.    You will see the “Moving Forward” appears on the AI panel title bar.

5.    Add a new team name, Give a team name “CSRobot”.

6.    Right click on “CSRobot World1 statement”, and select “Add New Sub-Statement”.

7.    Assign the statement name and click on “OK” to confirm, the “Forward” statement is added.

8.    Since there is no constraints in the condition, i.e. the robot moves in any condition, hence, we do not need to specify anything in the condition section.

9.    In the action section, we need to define:

v  Moving speed (60% of full speed = grade 3);

v  LED status (off = 0);

v  Duration (we set it as minimum. This will allow robot to act immediately if the surrounding environment changes).

10. Save the project.

11. Double confirm the project name and click on “OK” to confirm. If you want to change the project name, you can do it at this stage.

12. Build the project. You must see the “Built Successfully” massage.

13. Quit the AI panel. Click on red Load button if you which to load the AI to a RED robot.

14. Select the “Moving Forward.dll” file

15. Start the game. You will see the RED robot is moving forward in the WORLD_1.

16. Keep the RED robot selected, you will have all the sensors’ information while the robot is in action.

17. You can use the robot control function to “play  ”, “pause  ”, or “stop  ” a robot.

 

Top of Page