Fandom

CMRoboBits Wiki

Start with the code

11pages on
this wiki
Add New Page
Comments0 Share

The default code is essentially an empty cogntive framework for you to use how you wish. Depending on the project you select, you can opt to fill in the framework wtih certain of the modules from the full CMurfs framework to allow you to focus on your chosen area of investigation. Ask Ryan if you have any questions about this.

Also included in the default code are an example Behavior (CMRoboBits/robot/Behaviors/TestBehavior/) and Vision (CMRoboBits/robot/Behaviors/2011/) modules. The example behavior shows how to make the robot walk and move it's head, and to retrieve Vision Objects generated by the Vision Module. The example vision processor shows how to use the load and use the color thresholds from CMurfs to classify each pixel in the camera image as one of a handful of colors useful for RoboCup robots. It also shows an example of displaying a SegmentedImage and Shapes in the Visualizer and creating a new Vision Object.

Creating New BehaviorsEdit

BehaviorsCreator is located in /tools/BehaviorsCreator. This tool creates a header and a .cpp for a new behavior based on a set of states of your choice.

Before using it you should figure out a list of states that completly cover all the possible situations of the robot during a given action. As with other tools you first need to build it by typing ./build.sh. To execute it type ./run.sh and then follow the instructions of the program.

  • The first question is the name of your behavior
  • The second question asks you to enter all the behavior's states, each on its own line. Leave a blank line to finish entering states.
  • The third and last question refers to the state in which you want the robot to start.

Then you will have to copy the behaviors files (.h and .cpp) to a folder of your choice inside the cmurfs architecture in the robot folder (preferably inside the Behaviors folder).

You can either call this new behavior from another behavior, or add it to /robot/Behaviors/Configurable/BehaviorsConfigurable.cpp to allow it to be selected using the config files. Add a #include line at the top with your behavior's header file, and add an if() statement in the BehaviorsConfigurable constructor to check if your behavior should be loaded. It should look like:

else if (strcasecmp(name.c_str(), "<behavior name>") == 0) {
    behaviors = new RoboCup2011::<behavior name>(configFile, log);
}

Then you can tell CMurfs to use your behavior by modifying config/configurable.txt on the robot.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.