0% found this document useful (0 votes)
15 views16 pages

Robotic Frameworks Rotating Robots in Specific Directions in Python

Uploaded by

sindhuyerra8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views16 pages

Robotic Frameworks Rotating Robots in Specific Directions in Python

Uploaded by

sindhuyerra8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Robotic

Frameworks:
Rotating Robots in
Specific Directions
in Python
BY MAMIDI VARSHA
Introduction to Robotic
Frameworks
1 Fundamental Concepts 2 Versatile Platforms
Understand the core Explore the diverse range
principles and components of robotic frameworks
of modern robotic available, each with its
frameworks, including own strengths and
kinematics, dynamics, and applications.
control systems.

3 Python Integration
Leverage the power of Python's extensive libraries and tools to
seamlessly integrate robotic frameworks into your projects.
Fundamentals of Robot Motion
1 Degrees of Freedom
Understand the concept of degrees of freedom and
how they define a robot's range of motion.

2 Coordinate Systems
Explore the different coordinate systems used to
represent a robot's position and orientation.

3 Kinematics and Dynamics


Learn the principles of forward and inverse kinematics,
as well as the dynamics governing robot movement.
Rotation in 2D Coordinate Plane
Planar Rotation Rotation Matrices Practical Applications

Understand the mathematical and Learn how to use rotation matrices Explore real-world scenarios where
geometric concepts behind rotating to represent and apply rotational 2D rotation is a critical component of
a robot in a 2D coordinate plane. transformations in 2D space. robotic systems.
Rotation in 3D Coordinate Space

Spatial Rotation Rotation Transformations Robotic Manipulators


Dive into the complexities of rotating Understand the techniques for Explore how 3D rotation is essential
a robot in a 3D coordinate system, applying rotational transformations for the precise control and
including the use of Euler angles and to a robot's position and orientation movement of robotic manipulators
quaternions. in 3D space. and end-effectors.
Implementing Rotation in Python

Python Integration NumPy for Math Visualizing Rotation


Utilize Python's powerful libraries and Leverage the mathematical Explore tools and techniques for
frameworks to implement rotational capabilities of NumPy to perform visualizing the rotational movements
algorithms and control robotic complex matrix calculations and of robots in both 2D and 3D
systems. transformations. environments.
Practical Applications and
Use Cases
Industrial Automation Healthcare Robotics
Utilize robotic rotation for Apply robotic rotation to surgical
precision tasks in instruments, prosthetic limbs,
manufacturing, assembly, and and other medical devices for
material handling processes. improved patient care.

Aerospace and Defense Assistive Robotics


Leverage robotic rotation for Employ robotic rotation to
advanced applications such as enhance the functionality and
satellite deployment, aerial mobility of assistive devices for
surveillance, and unmanned individuals with disabilities.
vehicles.
Conclusion and Key Takeaways
1 Mastering Rotation 2 Python Integration
Understand the crucial role Leverage the power of
of robotic rotation in a Python's libraries and
wide range of applications frameworks to implement
and industries. seamless rotational control
of robotic systems.

3 Continuous Innovation
Stay ahead of the curve and explore the latest advancements
in robotic frameworks and rotation technology.
class Robot:
def init(self, name):

self.name = name

self.position = (0, 0)

self.orientation = 'N' # North, South, East, West

def move(self, steps):

if self.orientation == 'N':

self.position = (self.position[0], self.position[1] + steps)

elif self.orientation == 'S':

self.position = (self.position[0], self.position[1] - steps)

elif self.orientation == 'E':

self.position = (self.position[0] + steps, self.position[1])

elif self.orientation == 'W':

self.position = (self.position[0] - steps, self.position[1])

elif self.orientation == 'NE':

self.position = (self.position[0] + steps, self.position[1] + steps)

elif self.orientation == 'NW':

self.position = (self.position[0] - steps, self.position[1] + steps)

elif self.orientation == 'SE':

self.position = (self.position[0] + steps, self.position[1] - steps)

elif self.orientation == 'SW':

self.position = (self.position[0] - steps, self.position[1] - steps)


def rotate(self, direction):
if direction == 'L':

if self.orientation == 'N':

self.orientation = 'W'

elif self.orientation == 'S':

self.orientation = 'E'

elif self.orientation == 'E':

self.orientation = 'N'

elif self.orientation == 'W':

self.orientation = 'S'

elif self.orientation == 'NE':

self.orientation = 'NW'

elif self.orientation == 'NW':

self.orientation = 'SW'

elif self.orientation == 'SE':

self.orientation = 'NE'

elif self.orientation == 'SW':

self.orientation = 'SE'
elif direction == 'R':
if self.orientation == 'N':

self.orientation = 'E'

elif self.orientation == 'S':

self.orientation = 'W'

elif self.orientation == 'E':

self.orientation = 'S'

elif self.orientation == 'W':

self.orientation = 'N'

elif self.orientation == 'NE':

self.orientation = 'SE'

elif self.orientation == 'NW':

self.orientation = 'NE'

elif self.orientation == 'SE':

self.orientation = 'SW'

elif self.orientation == 'SW':

self.orientation = 'NW'
def report(self):
print(f"Robot {self.name}: Position ({self.position[0]}, {self.position[1]}), Orientation: {self.orientation}")

class TestRobot:

def init(self, robot):

self.robot = robot

def test_move_forward(self):

initial_position = self.robot.position

self.robot.move(1)

assert self.robot.position != initial_position, "Robot did not move forward"

def test_rotate_left(self):

initial_orientation = self.robot.orientation

self.robot.rotate('L')

assert self.robot.orientation != initial_orientation, "Robot did not rotate left"

def test_rotate_right(self):

initial_orientation = self.robot.orientation

self.robot.rotate('R')

assert self.robot.orientation != initial_orientation, "Robot did not rotate right"

def test_move_backward(self):

initial_position = self.robot.position

self.robot.move(-1)

assert self.robot.position != initial_position, "Robot did not move backward"


def test_move_diagonally_forword(self):
initial_position = self.robot.position

self.robot.orientation = 'NE'

self.robot.move(-1)

assert self.robot.position != initial_position

def test_move_diagonally_backward(self):

initial_position = self.robot.position

self.robot.orientation = 'SW'

self.robot.move(-1)

assert self.robot.position != initial_position

def run_all_tests(self):

self.test_move_forward()

self.test_rotate_left()

self.test_rotate_right()

self.test_move_backward()

self.test_move_diagonally_forword()

self.test_move_diagonally_backward()

print("All tests passed!")


if __name == “__main__”

my_robot = Robot("Varsha")

tester = TestRobot(my_robot)

test.run_all_tests()

# Example usage:

my_robot.move(0)

my_robot.rotate('L')

my_robot.move(1)

my_robot.report()

my_robot.orientation = 'NE'

my_robot.move(1)

my_robot.report()

my_robot.orientation = 'SW'

my_robot.move(-1)

my_robot.report()
OUTPUT:
All tests passed! Robot Varsha: Position (1, -1),
Orientation: SE Robot Varsha: Position (2, 0),
Orientation: NE Robot Varsha: Position (3, 1),
Orientation: SW
THANKYOU

You might also like