0

Soccer Robot C - Basic lessons - Additional actions

By now we met 2 actions, for catching a ball and returning to Your goal. More of them are available. Here is the complete list:
ActionFunctionShortcut
actionSoccerCatchcatchBall()cat
actionLoop0loop0()g0
actionLoop1loop1()g1
actionLoop2loop2()g2
actionLoop3loop3()g3
actionLoop4loop4()g4
actionLoop5loop5()g5
actionLoop6loop6()g6
actionLoop7loop7()g7
actionLoop8loop8()g8
actionLoop9loop9()g9
ActionSoccerPlayplay()soc
ActionSoccerIdleidle()idl
The names decribe actions' tasks fairly well, except for generic actions. They are all empty, not having any particular purpose, and are reserved for some actions You may need in the future. You can use them as they are, or rename them. If You find, for example, all the occurences of "actionLoop1" in "mrm-robot-soccer.h" and "mrm-robot-soccer.cpp" in Notepad++, and rename them to "actionGoToOpponentsGoal", You will able to use Your own name in the future. You do not have to stick to this list but can also add Your own actions. However, You will need to change the code in about 6 places for each, so we will not explain this process now.

Startup action of Your whole program can be "ActionSoccerPlay", which can do some initialization, then start "actionIdle".

Task: RCJ Soccer start.

Make a program that is started using action "actionSoccerPlay", where it changes its action to "actionIdle". There it should immediately stop.