Skip to content
/ wrestling-alice Public template
generated from cyberbotics/wrestling

Minimalist controller example for the Humanoid Robot Wrestling Competition.

License

Notifications You must be signed in to change notification settings

cyberbotics/wrestling-alice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Humanoid Robot Wrestling Controller Example

webots.cloud - Competition

Alice Python controller

Minimalist Python controller example for the Humanoid Robot Wrestling Competition. Demonstrates how to play a simple motion file. We use the Motion class from Webots. It could also be programmed in C, C++ or Java.

from controller import Robot, Motion


class Alice (Robot):
    def run(self):
        # motion files are text files containing pre-recorded positions of the robot's joints
        handWave = Motion('../motions/HandWave.motion')
        handWave.setLoop(True)
        handWave.play()
        # retrieves the simulation time step (ms) from the world file
        time_step = int(self.getBasicTimeStep())
        while self.step(time_step) != -1:  # Mandatory function to make the simulation run
            pass


# create the Robot instance and run main loop
wrestler = Alice()
wrestler.run()

Bob is a more advanced robot controller able to win against Alice.

About

Minimalist controller example for the Humanoid Robot Wrestling Competition.

Resources

License

Stars

Watchers

Forks