AI Based Cab Service Using PictoBlox

by Narzo107897 in Design > Software

15 Views, 0 Favorites, 0 Comments

AI Based Cab Service Using PictoBlox

AI Based Cab Service is an interactive smart-cab simulation developed using PictoBlox. The project allows a user to select a destination, view the destination on a map, confirm or decline a ride, and simulate cab movement toward the selected location.

The project uses AI and automation concepts to make the cab service interactive. After reaching the destination, the system provides voice feedback and allows the passenger to rate the ride using a five-star rating system.

Project Features

The project includes:

  1. Destination selection
  2. AI-based user interaction
  3. Destination pointer
  4. Route visualization
  5. Ride confirmation
  6. Ride cancellation
  7. Simulated cab movement
  8. Destination-specific routes
  9. Text-to-speech feedback
  10. Five-star ride rating
  11. Interactive PictoBlox sprites
  12. Quarky-based cab representation

The available destinations in the project are:

  1. Store
  2. Mall
  3. Hospital
  4. Pharmacy


Supplies

Hardware

  1. Computer/Laptop
  2. Webcam, if using the AI camera features
  3. Quarky

Software

  1. PictoBlox

PictoBlox Extensions Used

The project uses the following extensions/features:

  1. Pen
  2. Text to Speech
  3. Face Detection
  4. Text Recognition
  5. Quarky-related functionality


Sprites Used


  1. Tobi
  2. Main controller and route selection


  1. pointer

Displays the selected destination


  1. confirm ride

Confirms the ride


  1. decline ride

Declines the ride


Quarky

  1. Simulates cab movement


Star1

  1. Selects 1-star rating

Star2

  1. Selects 2-star rating


Star3

  1. Selects 3-star rating


Star4

  1. Selects 4-star rating


Star5

  1. Selects 5-star rating

Creating the Variables

Create the following variables in PictoBlox:

  1. Destination
  2. DestinationX
  3. DestinationY

These variables help the project store the selected destination and its corresponding coordinates.

Destination

Stores the selected location, such as:

  1. Pharmacy
  2. Hospital
  3. Mall
  4. Store

DestinationX and DestinationY

These variables store the coordinates of the selected destination so that the pointer and cab can use them.


Creating the Backdrops


The project uses different backdrops for different stages of the cab service.

Important backdrops include:

  1. Select
  2. Arena2
  3. Pharmacy
  4. Hospital
  5. Mall
  6. Blue Sky 2

The backdrop changes according to the current stage of the ride.


Programming the Tobi Sprite


Tobi is the main character/controller of the project.

Tobi uses custom blocks to create routes for different destinations.

The Pen extension is used to draw the route while Tobi moves through the map.

Step 4.1: Pharmacy Route

A custom block named Pharmacy is used for the Pharmacy destination.

When this block runs:

  1. The Pen is put down.
  2. Tobi moves 42 repetitions × 6 steps.
  3. Tobi moves an additional 3 steps.
  4. DestinationX is set to 134.
  5. DestinationY is set to -121.
  6. ShowDestinationAnchor is broadcast.
  7. The program waits for 1 second.
  8. The backdrop changes to Select.

The coordinates are used by the pointer to identify the Pharmacy location.

Step 4.2: Hospital Route

A custom block named Hospital is used for the Hospital destination.

Tobi:

  1. Points in direction 90°.
  2. Puts the Pen down.
  3. Repeats 28 times and moves 4 steps.
  4. Turns 90°.
  5. Repeats 30 times and moves 4 steps.
  6. Moves an additional 2 steps.
  7. Turns 90°.
  8. Repeats 25 times and moves 5 steps.
  9. Sets DestinationX to -133.
  10. Sets DestinationY to 1.
  11. Broadcasts ShowDestinationAnchor.
  12. Waits for 1 second.
  13. Switches to the Select backdrop.

This creates the route toward the Hospital.

Programming the Pointer Sprite


The pointer sprite marks the selected destination on the map.

When the green flag is clicked, it is hidden.

When it receives:

ShowDestinationAnchor

the pointer:

  1. Moves to DestinationX and DestinationY.
  2. Shows itself.

The pointer also has predefined locations for each destination.

Pharmacy

X = 134, Y = -121

Hospital

X = -133, Y = 1

Store

X = -137, Y = 140

Mall

X = 132, Y = 83

The pointer becomes hidden when it receives:

  1. ride confirmed
  2. ride declined

This prevents the destination marker from remaining visible after the ride decision.

Programming the Confirm Ride Sprite

The confirm ride sprite is used to confirm the selected cab ride.

When the green flag is clicked:

  1. It moves to X = -86, Y = -93
  2. It hides itself.

When it receives:

ShowDestinationAnchor

it waits for 1 second and then shows itself.

When the customer clicks the sprite:

  1. Graphic effects are cleared.
  2. Brightness is increased by 15 four times.
  3. Brightness is decreased by 15 four times.
  4. The sprite hides.
  5. The backdrop changes to Arena2.
  6. ride confirmed is broadcast.

The brightness effect provides visual feedback when the button is pressed.

If the sprite receives:

ride declined

it hides itself.


Programming the Decline Ride Sprite


The decline ride sprite provides an option to cancel the selected ride.

When the green flag is clicked:

  1. It moves to X = 93, Y = -93
  2. It hides.

When it receives:

ShowDestinationAnchor

it waits for 1 second and then shows itself.

When the customer clicks it:

  1. Graphic effects are cleared.
  2. Brightness increases by 15 four times.
  3. Brightness decreases by 15 four times.
  4. The sprite hides.
  5. The backdrop switches to Arena2.
  6. ride declined is broadcast.

If it receives:

ride confirmed

the sprite hides.

This allows the confirmation and cancellation buttons to respond to each other's status.


Programming the Quarky Sprite


The Quarky sprite represents the cab and controls the simulated ride.

When Quarky receives:

StartRide

it:

  1. Goes to X = -109, Y = -107.
  2. Shows itself.
  3. Checks the selected Destination.

The project then uses conditional statements to select the correct route.

Step 7.1: Pharmacy

If:

Destination = Pharmacy

Quarky:

  1. Displays Pharmacy.
  2. Broadcasts go to pharmacy.
  3. Uses the Pharmacy route.
  4. Switches to the Pharmacy backdrop.

Step 7.2: Hospital

If:

Destination = Hospital

Quarky:

  1. Displays Hospital.
  2. Broadcasts go to hospital.
  3. Uses the Hospital route.
  4. Switches to the Hospital backdrop.

Step 7.3: Mall

If:

Destination = Mall

Quarky:

  1. Displays Mall.
  2. Broadcasts go to mall.
  3. Uses the Mall route.
  4. Switches to the Mall backdrop.

Step 7.4: Store

If:

Destination = Store

Quarky:

  1. Displays Store.
  2. Broadcasts go to store.
  3. Switches the backdrop to Select.


Cab Movement

For the Mall route, the cab uses a sequence of glide and direction blocks.

The cab:

  1. Uses left-right rotation.
  2. Points in direction 90°.
  3. Glides for 6 seconds to approximately X = -15, Y = -116.
  4. Changes rotation style to all around.
  5. Points in direction 0°.
  6. Glides for 8.5 seconds to approximately X = 2, Y = 91.
  7. Changes rotation style back to left-right.
  8. Points in direction 90°.
  9. Glides for 4 seconds to DestinationX and DestinationY.

This creates the visual effect of the cab travelling along the road.

Destination Reached


After completing the ride, Quarky uses Text to Speech to provide feedback.

It speaks:

"Destination Reached!"

Then:

"Thank you for choosing our AI cab service"

Finally:

"Please rate your ride"

Quarky then:

  1. Hides itself.
  2. Switches the backdrop to Blue Sky 2.

This starts the ride-rating stage.

Programming the Star1 Sprite


Star1 represents the first rating star.

When the green flag is clicked:

  1. Costume changes to no.
  2. Position becomes X = -178, Y = -72.
  3. Sprite hides.

When the backdrop changes to Blue Sky 2, Star1 appears.

When it receives:

star 1

it changes its costume to:

yes

This represents a 1-star rating.


Programming the Star2 Sprite


Star2 represents the second rating star.

At startup:

  1. Costume → no
  2. Position → X = -97, Y = -99
  3. Hide

When Blue Sky 2 appears, Star2 becomes visible.

When the customer clicks Star2, it broadcasts:

  1. star 1
  2. star 2

When it receives star 2, its costume changes to yes.

Therefore, selecting Star2 activates the first two stars.

Programming the Star3 Sprite


Star3 represents the third rating star.

At startup:

  1. Costume → no
  2. Position → X = -11, Y = -112
  3. Hide

When Blue Sky 2 appears, Star3 becomes visible.

When clicked, Star3 broadcasts:

  1. star 1
  2. star 2
  3. star 3

When it receives star 3, its costume changes to yes.

This creates a 3-star rating.

Programming the Star4 Sprite

Star4 represents the fourth rating star.

At startup:

  1. Costume → no
  2. Position → X = 69, Y = -99
  3. Hide

When Blue Sky 2 appears, Star4 becomes visible.

When clicked, it broadcasts:

  1. star 1
  2. star 2
  3. star 3
  4. star 4

When it receives star 4, its costume changes to yes.

This represents a 4-star rating.


Programming the Star5 Sprite


Star5 represents the highest rating.

At startup:

  1. Costume → no
  2. Position → X = 148, Y = -72
  3. Hide

When Blue Sky 2 appears, Star5 becomes visible.

When clicked, it broadcasts:

  1. star 1
  2. star 2
  3. star 3
  4. star 4
  5. star 5

When it receives star 5, its costume changes to yes.

This activates all five stars and represents a 5-star rating.

How the Rating System Works

Customer Clicks Activated Stars

Star1 ⭐

Star2 ⭐⭐

Star3 ⭐⭐⭐

Star4 ⭐⭐⭐⭐

Star5 ⭐⭐⭐⭐⭐


For example, clicking Star4 broadcasts all messages from star 1 to star 4. Therefore, all four stars become active.

Complete Project Workflow



The complete AI Based Cab Service works as follows:

Start Project

↓

Destination Selection

↓

Destination Coordinates Stored

↓

Pointer Shows Destination

↓

Confirm Ride / Decline Ride

↓

If Confirmed → Start Ride

↓

Quarky Selects Destination Route

↓

Cab Travels Along Route

↓

Destination Reached

↓

Voice Feedback

↓

Please Rate Your Ride

↓

1–5 Star Rating


Testing the Project

Test the project in the following order.

Test 1 – Destination Selection

Select a destination such as Pharmacy, Hospital, Mall, or Store.

Check that the correct destination is selected.

Test 2 – Pointer

Check that the pointer appears at the correct destination.

Test 3 – Confirm Ride

Click confirm ride.

Check that the ride-confirmation message is broadcast and the project moves to the next stage.

Test 4 – Decline Ride

Restart the selection process and click decline ride.

Check that the ride is cancelled and the appropriate broadcast is sent.

Test 5 – Cab Movement

Confirm a ride and check that Quarky appears and follows the programmed route.

Test 6 – Destination

Check that Quarky provides the voice message after completing the route.

Test 7 – Rating

Check the five rating buttons individually.

Verify:

  1. Star1 → 1 star
  2. Star2 → 2 stars
  3. Star3 → 3 stars
  4. Star4 → 4 stars
  5. Star5 → 5 stars


Applications


This project can be used as an educational model for:

  1. AI-based cab services
  2. Smart transportation
  3. Autonomous navigation concepts
  4. Route planning
  5. Customer-service automation
  6. AI and robotics education
  7. Interactive transportation systems
  8. Smart-city demonstrations


Advantages

  1. Interactive cab-booking simulation
  2. Demonstrates AI concepts
  3. Uses visual route navigation
  4. Provides voice feedback
  5. Includes ride confirmation and cancellation
  6. Includes customer rating
  7. Uses separate sprites for different functions
  8. Easy to modify and expand
  9. Suitable for STEM and AI education


Limitations

This is an educational simulation, not a real cab-booking application.

  1. The routes are predefined.
  2. The cab movement is simulated.
  3. Destination coordinates are manually programmed.
  4. There is no real GPS navigation.
  5. There is no real cab booking or payment system.
  6. The rating system is part of the simulation.


Future Improvements


The project can be expanded by adding:

  1. GPS-based navigation
  2. Real-time maps
  3. Live cab tracking
  4. Distance calculation
  5. Fare calculation
  6. Estimated arrival time
  7. Voice-based destination selection
  8. Real driver/passenger accounts
  9. Online booking
  10. Digital payment
  11. Ride history
  12. Database integration
  13. Real-time traffic information
  14. AI-based route optimization


Conclusion


AI Based Cab Service is an interactive PictoBlox project that demonstrates how AI, automation, navigation, and visual programming can be combined to simulate a smart cab-booking system.

The project allows users to select destinations, visualize their location using a pointer, confirm or decline a ride, and simulate cab movement using Quarky. After reaching the destination, Text to Speech provides a personalized message and the passenger can rate the ride using a five-star system.

The project demonstrates important programming concepts such as variables, custom blocks, broadcasts, conditional statements, loops, motion, Pen, Text to Speech, and interactive sprites.

It can be further developed into a more advanced smart transportation system by integrating GPS, real-time navigation, fare calculation, databases, and voice-based interaction.