Spins the motor that is bound to the leftmotor variable backwards at 50% speed. Accepts positive or negative integers or decimals from -100 to 100. 2ģ arg2: The percentage of the motor s maximum speed you want to run the motor at. arg 1: The motor variable of the motor you want to spin. Uses positive percentage for turning forward and a negative percentage for turning backward. setspeed Description: Sets a motor at a specified percentage of its maximum speed. When you use other motor blocks and want to specify the robot s left motor, you would then use the leftmotor variable. Binds the variable leftmotor to the robot s motor for its left wheel. The names of the default robot s left and right motor are left wheel and right wheel respectively. arg 2: The name of the motor you wish to bind - do not enter quotes. arg 1: The motor variable to be bound to the motor. Must be used before a motor can be referenced by other motor blocks. 1.2 Block Descriptions Motors setupmotor Description: Initializes a motor and binds it to a motor variable. You do not need to set your motor/sensor variables to any specific value - simply supply it to the various motor/sensor blocks as instructed. We will refer to this variable as a motor variable or sensor variable, but remember that it is just a regular variable. Supply this variable to the initialize blocks, which will bind a sensor/motor to the variable. Go to the Variables category, select Create new variable., and name your variable accordingly (e.g. 1Ģ Motor/Sensor Variable: For each motor, distance sensor, and light sensor that you use, you must create a corresponding variable to represent and reference those motors/sensors. Use the window that appears below to change the name. Click on the bullet point that says name. To rename a sensor, click the drop-down arrow for the sensor you want to rename. A list of sensors will appear with their respective names listed in quotes. Click on the drop-down arrow for the bullet point that says extensionslot. In the Scene Tree, click on the drop-down arrow for the bullet point that says DEF ROBOT Pioneer3dx (PROTO). If the Scene Tree is not already open, press Ctrl+t to open it. To manually find the name of the sensor, follow these steps: 1. The default names of the motors and sensors are listed in the descriptions of the initialize blocks. Motor/Sensor Name: Each motor/sensor has a name that must be supplied to the initialize blocks - do not type quotes when supplying the name. Initialize Blocks: The initialize blocks are the setupmotor, initalizegyro, intializegps, and initalizeothersensor blocks. The value returned by a block will be fed into the block to its left. Indicates that a block should be connected to the right of another block. Used for listing arguments expected by the blocks. 1 Webots-Blockly API Documentation Jeffrey Cheng, Victor Hu, and Julian Lee Contents 1 Webots API Documentation Important Terminology Block Descriptions Motors Time Sensors Camera Other Webots API Documentation 1.1 Important Terminology arg.: Short for argument.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |