Commit 483856a3 authored by jad's avatar jad

changes

parent ef5b9341
Pipeline #7707 failed with stages
in 23 seconds
...@@ -64,6 +64,9 @@ self.new_seq = Sequencer(new_seq_list) ...@@ -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 ```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. 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 ### Running the sequence
To run the sequence, you need to add 2 lines of code to the ```Sequencer.py``` class . To run the sequence, you need to add 2 lines of code to the ```Sequencer.py``` class .
......
...@@ -29,7 +29,7 @@ class image_convert(NodeActivate): ...@@ -29,7 +29,7 @@ class image_convert(NodeActivate):
self.pubDiff = rospy.Publisher('/sDiffs',Float32,queue_size=1) self.pubDiff = rospy.Publisher('/sDiffs',Float32,queue_size=1)
self.pubForBag = rospy.Publisher('/imgForBag/front/compressed', CompressedImage, 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",Image, self.callback) self.subscriber = rospy.Subscriber("/bebop/image_raw/compressed",CompressedImage, self.callback)
self.lsd = cv2.createLineSegmentDetector(0) self.lsd = cv2.createLineSegmentDetector(0)
self.real_centr = np.array([160,120]) self.real_centr = np.array([160,120])
self.old_centr = np.array([160,120]) self.old_centr = np.array([160,120])
...@@ -198,7 +198,7 @@ class image_convert(NodeActivate): ...@@ -198,7 +198,7 @@ class image_convert(NodeActivate):
#msg = "" #msg = ""
if(self.node_active == False): if(self.node_active == False):
return 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) #np_arr = np.fromstring(ros_data.data, np.uint8)
#image_np = cv2.imdecode(np_arr, cv2.IMREAD_COLOR) #image_np = cv2.imdecode(np_arr, cv2.IMREAD_COLOR)
image,cx,sDiff = self.getVanishingPoint(cv2_img) image,cx,sDiff = self.getVanishingPoint(cv2_img)
......
...@@ -46,7 +46,7 @@ class EnterDoors(NodeActivate,returnResp): ...@@ -46,7 +46,7 @@ class EnterDoors(NodeActivate,returnResp):
self.y_vel = 0 self.y_vel = 0
self.act_time = -1 self.act_time = -1
def update_vel(self,ros_data): def update_vel(self,ros_data):
if(self.node_active == 0): if(self.node_active == False):
self.act_time = time.time() self.act_time = time.time()
return return
twist = ros_data.twist.twist twist = ros_data.twist.twist
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment