Skip to content

Commit

Permalink
switching updated
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezaahmadi committed May 23, 2022
1 parent e98596e commit 1a95cad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion configs/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ stationaryDebug: False
# Mode 2: Driving forward with back camera
# Mode 3: Driving backwards with back camera
# Mode 4: Driving backwards with front camera
navigationMode: 4
navigationMode: 1
# angular velocity scaler
maxOmega: 0.05
minOmega: 0.01
Expand Down
3 changes: 3 additions & 0 deletions scripts/featureMatching.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def sampleCropRowFeatures(self, mode, rgbImg, greenIDx, binaryMask, wLocs):
self.refWindowLoc)
# draw keypoints on rgb Image
self.drawKeyPoints(_rgbImg, self.refKeypoints, [255,0,0])

def reset(self):


def detectNewCropLane(self, mode, rgbImg, greenIDx, binaryMask, wLocs, numofCropRows):
_rgbImg = rgbImg.copy()
Expand Down
6 changes: 4 additions & 2 deletions scripts/vs_nodeHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ def navigate(self):
self.switchDirection()
print("#[INF] Turning Mode disabled, Entering next lane")
self.updateNavigationStage()
self.imageProcessor.reset()
self.imageProcessor.isInitialized = False
self.imageProcessor.cropRowEnd = False
else:
# if the condition is not fulfilled the robot moves continouisly sidewards
self.setRobotVelocities(0.0, -0.05, 0.0)
Expand All @@ -247,7 +250,6 @@ def navigate(self):
round(self.velocityMsg.angular.z, 3),
self.imageProcessor.numOfCropRows)


def publishImageTopics(self):
# Publish the Graphics image
self.imageProcessor.drawGraphics()
Expand Down Expand Up @@ -428,7 +430,7 @@ def isUsingBackCamera(self):
def switchDirection(self):
"""Function to manage the control variable for the driving direction
"""
# self.linearMotionDir = -self.linearMotionDir
self.linearMotionDir = -self.linearMotionDir
print("#####################switched Direction of Motion ...", self.linearMotionDir)

def switchRotationDir(self):
Expand Down

0 comments on commit 1a95cad

Please sign in to comment.