Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 7b56e89a authored by jad's avatar jad

ready to test seq

parent 9f336671
......@@ -6,9 +6,9 @@ from projectTools import GenTools,DroneCommand
from Regulator import RegulatorClass
from std_msgs.msg import Float32,Int32
from nav_msgs.msg import Odometry
from activation_class import NodeActivate
from activation_class import NodeActivate,returnResp
class TurnDrone(NodeActivate):
class TurnDrone(NodeActivate,returnResp):
def __init__(self,tar_in):
super(TurnDrone,self).__init__("turnAng")
#self.tar_sub = rospy.Subscriber("/ang_in_z",Float32,self.read_tar)
......@@ -27,4 +27,6 @@ class TurnDrone(NodeActivate):
self.cur_ang = 2*np.arcsin(cur_ang_quat)
cmd = self.dc.computeCommand(self.cur_ang,self.tar_ang)
cmd = GenTools.setMax(cmd,0.3)
self.cmd_pub_z.publish(cmd)
\ No newline at end of file
self.cmd_pub_z.publish(cmd)
if(np.absolute(self.cur_ang - self.tar_ang) < 0.5):
self.send_conf()
\ No newline at end of file
......@@ -21,7 +21,7 @@ class ComputeXTar(NodeActivate):
self.cmd_publisher = rospy.Publisher("/vel_in_x",Float32,queue_size=1)
self.targX = 0.2
def sync_cmd(self,ros_data):
if(self.node_active == 0):
if(self.node_active == False):
return
self.cmd_publisher.publish(self.targX)
def main(args):
......
......@@ -22,7 +22,7 @@ class ComputeYTar(NodeActivate):
self.targY = 0
#self.act_publisher.publish(0)
def read_sDiffs(self,ros_data):
if(self.node_active == 0):
if(self.node_active == False):
return
#read the centroid and send the data
self.targY = ros_data.data
......
......@@ -26,7 +26,7 @@ class ComputeZTar(NodeActivate):
#self.act_publisher.publish(1)
def read_centroid(self,ros_data):
#read the centroid and send the data
if(self.node_active == 0):
if(self.node_active == False):
return
self.centroid = ros_data.data
self.cmd = self.dc.computeCommand(self.centroid,self.TargCentroid)
......
......@@ -196,8 +196,8 @@ class image_convert(NodeActivate):
def callback(self,ros_data):
#msg = ""
#if(self.node_active == 0):
# return
if(self.node_active == False):
return
cv2_img = self.br.imgmsg_to_cv2(ros_data)
#np_arr = np.fromstring(ros_data.data, np.uint8)
#image_np = cv2.imdecode(np_arr, cv2.IMREAD_COLOR)
......
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