Deprecated: Required parameter $query follows optional parameter $post in /var/www/html/wp-content/plugins/elementor-extras/modules/breadcrumbs/widgets/breadcrumbs.php on line 1215
Mars Rover - Blocks, Python Functions, Projects | PictoBlox Extension
[PictoBloxExtension]

Mars Rover

Mars rover extension graphics
Extension Description
Control the Mars Rover Robot with Quarky.

Introduction

Mars is a fascinating planet. It’s icy cold and covered in reddish dust and dirt. Like Earth, it has volcanoes, gullies, and flat plains. Scientists can also see channels that look like they were carved by rivers and streams a long, long time ago. Over the years, NASA has sent five robotic vehicles, called rovers, to Mars. The names of the five rovers are Sojourner, Spirit and Opportunity, Curiosity, and Perseverance.

STEMpedia has created a miniature version of the Mars Rover to educate students about the different aspects of the Mars Rover in a more practical way.

The Mars Rover is programmable with PictoBlox in both modes – Block Coding and Python Coding.

Motor and Servo Motor

In our Mars rover, there are a total of 6 motors and 5 servo motors. 

The motors provide rotation to the wheels which helps the rover to attain motion in both forward and backward directions.  All the left side motors (3 motors) are connected to the left motor port of Quarky and all the right side motors (3 motors) are connected to the right motor port of Quarky using a 3 port wire. This means that to control the Mars rover we have to control only 2 motors – Left and Right. Also, there are 2 parameters to control – Direction (Forward or Backward) and Speed. With this control, the Mars rover can do all the desired motions.

The servo motors help in providing rotation to the complete wheel assembly so that the rover can change its wheel alignments and so its path. These play a major role in turning cases of the mars rover. The front two and the back two-wheel assemblies are connected with one servo motor each. Some important turns:

  1. Turning left on the same point:
  2. Turning right on the same point:
  3. Turning left on a circle:
  4. Turning right on a circle:
Note:  The middle wheel assemblies on either side are not connected to servo motors.

The fifth servo motor is connected to the head portion of the Mars rover so that the rover can rotate its head to detect obstacles. 

Connecting Mars Rover with PictoBlox

Let’s begin by first connecting Quarky to PictoBlox. Select your preferred type of device i.e. either the desktop/laptop or your smartphone and follow the instructions.

Desktop

Follow the steps below for connecting Quarky to PictoBlox:

  1. First, connect Quarky to your laptop using a USB cable.
    Power Quarky
  2. Next, open PictoBlox on your desktop.
  3. After that, select Block or Python Coding as your coding environment.
  4. Then, click the Board button in the toolbar and select board as Quarky.
  5. Next, select the appropriate Serial port if the Quarky is connected via USB or the Bluetooth Port if you want to connect Quarky via Bluetooth and press Connect.
    COM Port

And voila! Quarky is now connected to PictoBlox.

Mobile

Follow the steps below for connecting Quarky to PictoBlox:

  1. First, power ON Quarky.
  2. Open PictoBlox on your smartphone. Go to My Space and make a new project by clicking the ‘+(plus)’ button in the bottom-right corner.
    PictoBlox in Mobile Phone
  3. Then, tap the Board button in the top-right corner of the toolbar.
    PictoBlox BoardSelect board as Quarky.
  4. Next, tap the Connect button:
    PictoBlox ConnectSelect your device from the list.

And voila! Quarky is now connected to PictoBlox.

Mars Rover Extension in Block Coding

Click on the Add Extension button and add the Mars Rover extension.

Once loaded, you will find the fresh blocks of Mars Rover in the block palette.

 

Mars Rover Extension in Python Coding

Click on the Add Modules/Libraries button and add the Mars Rover extension.

To access the library functions, you have to add the object declaration.

quarky = Quarky()
rover = MarsRover(4, 1, 7, 2, 6)
Read More

PictoBlox Blocks

The block changes its sprite’s costume to the next one in the costumes pane, but if the current costume is the last in the list, the block will loop to the first.
It clears any sound effects currently in place. However, it does not stop the sound currently being played.
The block pauses its script until the specified Boolean condition is true.
The block sends a broadcast throughout the whole Scratch program. Any scripts in any sprites that are hatted with the When I Receive () block that is set to a specified broadcast will activate. This broadcast block lets scripts send broadcasts without any waits in its script (unlike the Broadcast () and Wait block). Broadcasts are a good way to have sprites and scripts communicate.
The () of object () block reports the following attributes of the object: class, x position, y position, width, height, and confidence.
The block checks if the Boolean inside it is false — if it is false, the block returns true; if the condition is true, it returns false.
The block simply reports the items of its list as a string. Whenever a list is created, a version of the block appears with the list’s name on it; this results in a version of this block for every list.
This block returns the y position of the pose landmark detected. The position is mapped with the stage coordinates.
The recognized () () name block reports the name of the recognized celebrity/brand/object/image tag.
The get expression of face () block reports the recognized expression of the selected face. If the face selected is not detected, then it reports NULL.
Once you have analyzed the images for handwritten text, you can use a handwritten text result block to get the recognized text from the image in a string format.
The block reports the recognized class from the selected image feed (camera, stage, costume, or backdrop).
The () of object () block reports the following attributes of the object: class, x position, y position, width, height, and confidence.
The block returns the x or y coordinate of the specified landmark points of the QR code.
The block returns the wind speed (Unit Default: meter/sec) or the wind direction (in degrees – meteorological) of the location.
The block sets the project’s tempo, or speed, to the specified amount, using the unit “bpm”, or “beats per minute”.
The block changes the specified value by the number input. 
The block changes the specified value to the integer or float according to the input.
The block is used to create custom patterns on the RGB LED display of Quarky.
The block performs the automatic line following logic with the parameters specified in the set parameter F () T1 () T2 () block.
The block sets the orientation of the robot to align the left and right movement of the robot in horizontal robot position and vertical robot position.
The block is a hat block and starts the execution of the script added under it when the specified touch sensor of Quarky is pressed.
The block reports the recognized class from the analyse image from () block.
Once you have analyzed the images, you can use the get # of objects block to get the number of objects recognized in the image.
The block reports the recognized class from the analyse image from () block.
The block reports the recognized class from the analyse image from () block.
The block sets the sprite’s mass to the specified value.
The block reports the state of the analog sensor connected to the selected pin. The block returns true when the analog reading of the sensor is greater than the threshold value set by the user. Else it reports false.
The block stops the specified motor of the Quarky.
The block gets the last color value from the specified feed and stores it in PictoBlox. The value can be reported from the get () value block.
All articles loaded
No more articles to load

Block Coding Examples

All articles loaded
No more articles to load

Python Functions

There are no python functions for the extension to show.

Python Coding Examples

All articles loaded
No more articles to load
Table of Contents