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:
- Destination selection
- AI-based user interaction
- Destination pointer
- Route visualization
- Ride confirmation
- Ride cancellation
- Simulated cab movement
- Destination-specific routes
- Text-to-speech feedback
- Five-star ride rating
- Interactive PictoBlox sprites
- Quarky-based cab representation
The available destinations in the project are:
- Store
- Mall
- Hospital
- Pharmacy
Supplies
Hardware
- Computer/Laptop
- Webcam, if using the AI camera features
- Quarky
Software
- PictoBlox
PictoBlox Extensions Used
The project uses the following extensions/features:
- Pen
- Text to Speech
- Face Detection
- Text Recognition
- Quarky-related functionality
Sprites Used
- Tobi
- Main controller and route selection
- pointer
Displays the selected destination
- confirm ride
Confirms the ride
- decline ride
Declines the ride
Quarky
- Simulates cab movement
Star1
- Selects 1-star rating
Star2
- Selects 2-star rating
Star3
- Selects 3-star rating
Star4
- Selects 4-star rating
Star5
- Selects 5-star rating
Creating the Variables
Create the following variables in PictoBlox:
- Destination
- DestinationX
- DestinationY
These variables help the project store the selected destination and its corresponding coordinates.
Destination
Stores the selected location, such as:
- Pharmacy
- Hospital
- Mall
- 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:
- Select
- Arena2
- Pharmacy
- Hospital
- Mall
- 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:
- The Pen is put down.
- Tobi moves 42 repetitions × 6 steps.
- Tobi moves an additional 3 steps.
- DestinationX is set to 134.
- DestinationY is set to -121.
- ShowDestinationAnchor is broadcast.
- The program waits for 1 second.
- 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:
- Points in direction 90°.
- Puts the Pen down.
- Repeats 28 times and moves 4 steps.
- Turns 90°.
- Repeats 30 times and moves 4 steps.
- Moves an additional 2 steps.
- Turns 90°.
- Repeats 25 times and moves 5 steps.
- Sets DestinationX to -133.
- Sets DestinationY to 1.
- Broadcasts ShowDestinationAnchor.
- Waits for 1 second.
- 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:
- Moves to DestinationX and DestinationY.
- 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:
- ride confirmed
- 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:
- It moves to X = -86, Y = -93
- It hides itself.
When it receives:
ShowDestinationAnchor
it waits for 1 second and then shows itself.
When the customer clicks the sprite:
- Graphic effects are cleared.
- Brightness is increased by 15 four times.
- Brightness is decreased by 15 four times.
- The sprite hides.
- The backdrop changes to Arena2.
- 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:
- It moves to X = 93, Y = -93
- It hides.
When it receives:
ShowDestinationAnchor
it waits for 1 second and then shows itself.
When the customer clicks it:
- Graphic effects are cleared.
- Brightness increases by 15 four times.
- Brightness decreases by 15 four times.
- The sprite hides.
- The backdrop switches to Arena2.
- 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:
- Goes to X = -109, Y = -107.
- Shows itself.
- Checks the selected Destination.
The project then uses conditional statements to select the correct route.
Step 7.1: Pharmacy
If:
Destination = Pharmacy
Quarky:
- Displays Pharmacy.
- Broadcasts go to pharmacy.
- Uses the Pharmacy route.
- Switches to the Pharmacy backdrop.
Step 7.2: Hospital
If:
Destination = Hospital
Quarky:
- Displays Hospital.
- Broadcasts go to hospital.
- Uses the Hospital route.
- Switches to the Hospital backdrop.
Step 7.3: Mall
If:
Destination = Mall
Quarky:
- Displays Mall.
- Broadcasts go to mall.
- Uses the Mall route.
- Switches to the Mall backdrop.
Step 7.4: Store
If:
Destination = Store
Quarky:
- Displays Store.
- Broadcasts go to store.
- Switches the backdrop to Select.
Cab Movement
For the Mall route, the cab uses a sequence of glide and direction blocks.
The cab:
- Uses left-right rotation.
- Points in direction 90°.
- Glides for 6 seconds to approximately X = -15, Y = -116.
- Changes rotation style to all around.
- Points in direction 0°.
- Glides for 8.5 seconds to approximately X = 2, Y = 91.
- Changes rotation style back to left-right.
- Points in direction 90°.
- 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:
- Hides itself.
- 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:
- Costume changes to no.
- Position becomes X = -178, Y = -72.
- 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:
- Costume → no
- Position → X = -97, Y = -99
- Hide
When Blue Sky 2 appears, Star2 becomes visible.
When the customer clicks Star2, it broadcasts:
- star 1
- 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:
- Costume → no
- Position → X = -11, Y = -112
- Hide
When Blue Sky 2 appears, Star3 becomes visible.
When clicked, Star3 broadcasts:
- star 1
- star 2
- 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:
- Costume → no
- Position → X = 69, Y = -99
- Hide
When Blue Sky 2 appears, Star4 becomes visible.
When clicked, it broadcasts:
- star 1
- star 2
- star 3
- 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:
- Costume → no
- Position → X = 148, Y = -72
- Hide
When Blue Sky 2 appears, Star5 becomes visible.
When clicked, it broadcasts:
- star 1
- star 2
- star 3
- star 4
- 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:
- Star1 → 1 star
- Star2 → 2 stars
- Star3 → 3 stars
- Star4 → 4 stars
- Star5 → 5 stars
Applications
This project can be used as an educational model for:
- AI-based cab services
- Smart transportation
- Autonomous navigation concepts
- Route planning
- Customer-service automation
- AI and robotics education
- Interactive transportation systems
- Smart-city demonstrations
Advantages
- Interactive cab-booking simulation
- Demonstrates AI concepts
- Uses visual route navigation
- Provides voice feedback
- Includes ride confirmation and cancellation
- Includes customer rating
- Uses separate sprites for different functions
- Easy to modify and expand
- Suitable for STEM and AI education
Limitations
This is an educational simulation, not a real cab-booking application.
- The routes are predefined.
- The cab movement is simulated.
- Destination coordinates are manually programmed.
- There is no real GPS navigation.
- There is no real cab booking or payment system.
- The rating system is part of the simulation.
Future Improvements
The project can be expanded by adding:
- GPS-based navigation
- Real-time maps
- Live cab tracking
- Distance calculation
- Fare calculation
- Estimated arrival time
- Voice-based destination selection
- Real driver/passenger accounts
- Online booking
- Digital payment
- Ride history
- Database integration
- Real-time traffic information
- 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.