Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Summary Develop a Python script to simulate key models of robot navigation using object oriented programming. This assessment does not require using a real robot

Summary

Develop a Python script to simulate key models of robot navigation using

object oriented programming. This assessment does not require using

a real robot or suggest to do so.


Simulation

4.1 Robot Navigation with No Global Map and a Distance Sensor

Adding a sensor to the robot fundamentally changes the ability of the robot to

obtain information about its environment, but also the nature of the challenge

of navigation.

Now, implement object oriented classes to simulate a robot with a distance

sensor which provides a data signal indicating the current distance to the destination object it is facing, if there is such an object in the path.

Your robot must be able to find a path to the destination using the sensor

information only, and the position of the destination is not known to the robot

before or during the navigation.


Model Assumptions

  • The robot moves in a two dimensional space with horizontal and vertical

integer dimensions, as seen from above. The x dimension increase to the

right, and the y dimension increases downward. The robot can move one

unit in positiveegative x direction, or one unit in positiveegative y

direction.

  • The robot can rotate to face any one of four directions/angles 0, 90, 180,

270, with 0 degrees matching positive x direction and 270 dgrees matching

positive y.

  • The robot has a distance sensor which provides a data signal indicating

the current distance to the object ahead in the direction faced by

the sensor/robot, or a fixed 'default' value if the sensor does not detect anything.

- The distance sensor uses the same units as the navigational space.


In reality, a range sensor (such as ultrasonic or sonar) will typically

return a response based on the closest object in a 'cone' of sensing,

not a fixed direction, but our model can feasibly simulate it with one

direction.


  • The robot has data on its own location throughout the search


  • The robot has no data about the location of any objects,

except what it discovers via sensor data

  • There is no obstacle present in the navigational space


Coding Steps

  1. Develop an object-oriented class to represent your Sensor-Based Robot,

including:

(a) Constructor function and class instance data variables for

1) the x,y position of the robot within the navigational space, 2) the

direction the robot is facing (see the model), and 3) the distance data

value measured by the distance sensor based on its current position

(This number could be at most the maximum size vertically or horizontally in your two dimensional space)

(b) A class function to move the robot (and sensor) position by one

distance unit in one of the four directions, positive or negative x, or

positiveegative y

(c) A class function to rotate the robot (and sensor) to a new angle/direction, which is passed in as a parameter

(d) A class function to update the distance sensor data value based

on the current robot position/angle and the destination position,

and returns the current sensor data value

  • Simulation: This function is how the robot "knows"

whether the sensor has detected the destination


HINT: make a function parameter for the destination object


(e) A class function to navigate the entire path to the destination

location by calling the class move/rotation functions (described above)

and the sensor reading function

  • Print out a message when the destination is sensed, and when it is

reached, including the location found

Suggestion: Create some conditions that indicate what type of move

is needed to increase the probability of sensing the destination. Write

a loop to iterate robot moves one after another, and in your loop

use your conditions to check which move is best (or a sufficiently

workable choice) to approach the destination)


2. Develop an object oriented class to represent the destination, with enough

data to describe what kind of destination it is (e.g. lightpost) and its own

x,y position


3. Create sensor-based robot and destination object.


4. Before the simulation start, place the sensor-based robot initial location at

the center of the two dimensional space(halfway horizontally and

vertically). Place the destination in exactly one randomly selected direction

of the four directions relative to your robot: 0, 90, 180, 270 degrees of

rotation.


Try integer division to find a halfway number, as in 5 //2 which results in 2. These placements mean that only robot rotation and motion in the single direction of the destination is needed to reach the destination.The robot actions are guided by the sensor data only.


5. Use the robot's navigation function to navigate to the destination


One example was made available. Please see pictures below:

imageimageimageimageimageimageimageimageimageimageimageimageimageimageimageimageimage

1 ITEC4270 Robot Navigation Programming Simulation Example 2 Dr. Jonathan Jenkins ITEC 4270 Robot Programming Run and experiment with all examples in the text and course content yourself until you understand the concept. Write your own code Simulation of Navigation with a Distance Sen- sor and a Goal with a Location 'Unknown' at the Start of Simulation 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

International Marketing And Export Management

Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr

8th Edition

1292016922, 978-1292016924

More Books

Students also viewed these Programming questions

Question

2. How might culture influence perceptions of fairness?

Answered: 1 week ago