From 483856a31275279079f6d656cd33fc2c35504ed2 Mon Sep 17 00:00:00 2001 From: jad Date: Tue, 11 Jun 2019 23:46:08 +0200 Subject: [PATCH] changes --- README.md | 3 +++ src/image_proc.py | 4 ++-- src/testDenseOpticalFlow.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b18ea1d..34c1b9d 100755 --- a/README.md +++ b/README.md @@ -64,6 +64,9 @@ self.new_seq = Sequencer(new_seq_list) Where ```mode_name``` is the string that when we receive on the ```/mode``` topic , the sequence will run. Where ```node_1``` and ```node_2``` are the names of nodes that will be activated in the phase 1 of this sequence, and ```cond_1``` and ```cond_2``` are the names of nodes confirmations we are waiting for to continue to the next step. +### NB: +Having ```[]``` as condition means always True, and having ```[""]``` means always False. + ### Running the sequence To run the sequence, you need to add 2 lines of code to the ```Sequencer.py``` class . diff --git a/src/image_proc.py b/src/image_proc.py index 009b8b7..6f63fc3 100755 --- a/src/image_proc.py +++ b/src/image_proc.py @@ -29,7 +29,7 @@ class image_convert(NodeActivate): self.pubDiff = rospy.Publisher('/sDiffs',Float32,queue_size=1) self.pubForBag = rospy.Publisher('/imgForBag/front/compressed', CompressedImage, queue_size=1) #self.subscriber = rospy.Subscriber("/bebop/image_raw",Image, self.callback) - self.subscriber = rospy.Subscriber("/bebop/image_raw",Image, self.callback) + self.subscriber = rospy.Subscriber("/bebop/image_raw/compressed",CompressedImage, self.callback) self.lsd = cv2.createLineSegmentDetector(0) self.real_centr = np.array([160,120]) self.old_centr = np.array([160,120]) @@ -198,7 +198,7 @@ class image_convert(NodeActivate): #msg = "" if(self.node_active == False): return - cv2_img = self.br.imgmsg_to_cv2(ros_data) + cv2_img = self.br.compressed_imgmsg_to_cv2(ros_data) #np_arr = np.fromstring(ros_data.data, np.uint8) #image_np = cv2.imdecode(np_arr, cv2.IMREAD_COLOR) image,cx,sDiff = self.getVanishingPoint(cv2_img) diff --git a/src/testDenseOpticalFlow.py b/src/testDenseOpticalFlow.py index f4f997e..8244b8b 100755 --- a/src/testDenseOpticalFlow.py +++ b/src/testDenseOpticalFlow.py @@ -46,7 +46,7 @@ class EnterDoors(NodeActivate,returnResp): self.y_vel = 0 self.act_time = -1 def update_vel(self,ros_data): - if(self.node_active == 0): + if(self.node_active == False): self.act_time = time.time() return twist = ros_data.twist.twist -- 2.22.0