Chitti app logo

Chitti is better in the app

Coins, streaks and builds — free on Android & iOS

Get the app
Chitti logoChitti

Destroying Robots

5 Minutes · Module 4 - Destroying Robot

Dynamic Castle Crasher robot coding for students, showing how to sense moving castles and push them past the red line. A Tamil robotics lesson.

  • Exploring the Dynamic Castle Crasher playground and camera views
  • Programming if-else blocks with distance sensing to find castles
  • Using down eye red detection and a forever loop to clear objects
What this lesson teachesRead the lesson as text

A castle crasher robot simulation programs an autonomous robot to detect movable targets on a field, push them past a boundary line, and safely avoid falling off the edge. In the Dynamic Castle Crasher playground, objects called castles appear in dynamic positions that shift each time the simulation is reset.

Playground features and camera views

  • The Dynamic Castle Crasher arena places castles in different locations that change whenever the reload button is pressed.
  • Different camera views, such as top and side angles, allow the operator to observe the field and view the castles clearly.
  • The objective of the robot is to push every castle completely out of the arena past the surrounding red line.

Detecting castles with distance sensing

  • The control logic uses an if-else block to decide how the robot moves based on what is in front of it.
  • A sensing block called distance found an object checks whether a castle is located directly ahead.
  • If an object is found, the robot runs a drive forward block to push the castle ahead.
  • If no object is found, the robot runs a turn right block to spin in place until it locates a target.

Border sensing and recovery steps

To prevent the robot from falling off the edge when pushing an object, a repeat until block runs the forward and turning commands until the down eye sensor detects red. Once the down eye registers the red boundary, the robot drives forward an extra 100 millimeters to push the castle completely across the line. Next, the robot executes a reverse drive command to back away from the border. Finally, a turn right command paired with a pick random operator rotates the robot between 30 and 50 degrees to face a new direction.

Running the mission in a forever loop

Without continuous control, the robot stops after clearing a single castle. To clear every castle on the board, a forever block from the control category is placed around the entire set of instructions. This forever loop forces the robot to search, push targets, retreat from the red line, and turn repeatedly until all castles are cleared from the playground.

Part of the course

ROBOTIC SIMULATION

View course →

More in Module 4 - Destroying Robot

  1. 1Destroying RobotsNow playing
  2. 2Bumper Sensor4 Minutes