Search code examples
webots

Webots e-puck turn 90 degrees


How can I make a e-puck robot turn 90 degrees into a certain direction in Webots ? I tryed using wb_robot_step(TIME_STEP) to make the robot rotate for a certain amount of time but I didnt quite get it.

I also read somewhere online that I could possibly use the InertialUnit module to get the position of the robot on the y axis and rotate the robot until the angle is correct, but I didn't find any examples on that either.

Anyone can help ?


Solution

  • This may help you:

    bool turn90ccw();   // Turn robot 90 degrees ccw in place
    

    Just call this function where ever you need.