From bbd316f85837805a48db821228bbcd1898d506ef Mon Sep 17 00:00:00 2001 From: pal <you@example.com> Date: Wed, 22 Jul 2020 15:17:32 +0200 Subject: [PATCH] code refactoring --- scripts/Eye.py | 10 ++++++---- scripts/Skin.py | 15 +++++---------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/scripts/Eye.py b/scripts/Eye.py index 4906aea..a63891c 100755 --- a/scripts/Eye.py +++ b/scripts/Eye.py @@ -1,8 +1,9 @@ #!/usr/bin/env python ''' -@Author: Bilgehan NAL -This file has a class which defines the shape and movment of the baxter's eyes. +@Author: Antonio Andriella +This file has a class which defines the shape and movement of the Tiago's eyes. +Credits to Bilgehan NAL ''' from PIL import Image @@ -11,8 +12,9 @@ import rospy class Eye: - def __init__(self, file): - self.eyes = Image.open(file) # eye image + def __init__(self, folder_path): + + self.eyes = Image.open(folder_path+"pupil.png") # eye image self.positionX = 0 # keeps the x position as a coordinate self.positionY = 0 # keeps the y position as a coordinate diff --git a/scripts/Skin.py b/scripts/Skin.py index fc8b532..b4b8f96 100755 --- a/scripts/Skin.py +++ b/scripts/Skin.py @@ -1,8 +1,9 @@ #!/usr/bin/env python """ -@Author: Bilgehan NAL +@Author: Antonio Andriella This file has a class which defines the skin of the baxter's face. +Credits to Bilgehan NAL """ from PIL import Image @@ -10,19 +11,13 @@ import rospy class Skin: - indexOfSkin = 5 # choosen element of the array + indexOfSkin = 1 # choosen element of the array - def __init__(self, initSkin): + def __init__(self, folder_path, initSkin): # This array keeps the diffirent colour version of skin self.skins = [ - Image.open("test/skin.png"), - Image.open("test/skin.png"), - Image.open("test/skin.png"), - Image.open("test/skin.png"), - Image.open("test/skin.png"), - Image.open("test/skin.png") - + Image.open(folder_path+"skin.png") ] -- GitLab