Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Task 0

Bonus Task : Square Path Challenge


Problem Statement:

  • Make the bot in CoppeliaSim follow a perfect square path, starting and stopping at the same spot such that the robot traces a square and ends where it began.
  • Use the Files from below and Follow Perfect Square.

Prerequistes:

  • Use the 3.1) CoppeliaSim guide from the Learn section to get comfortable with the interface, and set up the Python remote API before attempting the upcoming Taks.

Setup

  • Download the provided files from the Drive Link:
    • Drive Link : Task0_files
    • .ttt scene file (CoppeliaSim environment with square path)
    • bridge.exe / bridge(Python file for communication between your Code and CoppeliaSim)(.exe for Windows and File without Extension For ubuntu.)
    • Boilerplate task0.py file (where you'll write your logic)

Steps to Start the task

  1. Open CoppeliaSim and load the provided .ttt scene file

  2. Run the bridge in a separate terminal:

     ./bridge.exe
    

    OR

    ./bridge
    
  3. Write your square path logic in the provided task0.py file inside the control_loop() function. This is the only function you need to edit, all your movement and turning logic should go inside this function.

  4. Run your Python program:

    python task0.py
    

Success looks like

  • Robot starts at a corner, moves forward one side length, turns 90°, repeats 4 times.
  • Robot stops exactly where it started (closing the loop).
  • Smooth motion, no sudden jumps.
img
Figure 1: Sample Output

Great, now you are very familiar with CoppeliaSim!