Make a robot move itself


1. Add a drive command to make robot move itself
  1. You can drive a robot by using below method.

       robotname.Drive(left_power, right_power)

  2. Left power and right power have the range of -1.0 ~ 1.0.

  3. Left power and right power will make robot move as follows.

       0, 0  : Stop
       1.0, 1.0  : Go forwards with maximum speed
       -1.0, -1.0  : Go backwards with maximum speed

  4. Examples for drive options (left powerm and right power).

       0.3, 0.3  : Go forwards with 0.3 power
       -0.2, 0.2  : Turn left with 0.2 power
       0.2, 0.3  : Go round with left direction

  5. Add a drive command to make a robot go forwards with 0.3 power.



      
    MFEmulator    emul1
    	/TargetEmulator:SPLMFConsoleEmulator
    
    
    StartSimulationEngine  "SimState/basicenv4.xml"
    
    AddDifferentialDriveEntity    base1
    
    FlushScript  
    
    base1.Go(0.3, 0.3)
    
      


  6. Save script.

  7. Press "F5" key or click "Run" icon.

  8. You can see a mobile robot go forwards.




2. Make a robot go round
  1. Add a drive command to make a robot go forwards with 0.3 power.



      
    MFEmulator    emul1
    	/TargetEmulator:SPLMFConsoleEmulator
    
    
    StartSimulationEngine  "SimState/basicenv4.xml"
    
    AddDifferentialDriveEntity    base1
    
    FlushScript  
    
    base1.Go(0.2, 0.4)
    
      


  2. Save script.

  3. Press "F5" key or click "Run" icon.

  4. You can see a mobile robot go round.