示例#1
0
    def __init__(self):
        p3_rpu.PeriodicNode.__init__(self, 'ros_pat_publish_transform')
        pos_ned = [0, 0, -1]
        self.T_w2b = np.eye(4)
        dm_ae = p1_fw_dyn.DynamicModel()
        Xe, Ue = dm_ae.trim({
            'h': 0,
            'va': 8,
            'gamma': 0
        },
                            report=True,
                            debug=True)
        va, alpha, beta = Xe[p3_fr.SixDOFAeroEuler.sv_slice_vaero]
        #va, alpha, beta = 10, np.deg2rad(3), np.deg2rad(0)
        phi, theta, psi = Xe[p3_fr.SixDOFAeroEuler.sv_slice_eul]
        #phi, theta, psi = np.deg2rad(0), np.deg2rad(20), np.deg2rad(0)
        p3_u.set_rot(self.T_w2b, p3_al.rmat_of_euler([phi, theta, psi]))
        self.T_b2w = np.linalg.inv(self.T_w2b)
        p3_u.set_trans(self.T_b2w, pos_ned)
        self.T_a2b = np.eye(4)
        p3_u.set_rot(self.T_a2b, p3_fr.R_aero_to_body(alpha, beta))
        self.T_b2a = self.T_a2b  #np.linalg.inv(self.T_a2b) # FIXME

        self.tf_pub = p3_rpu.TransformPublisher()
        self.marker_pub = p3_rpu.PoseArrayPublisher(dae='glider.dae')
示例#2
0
 def __init__(self, traj, time_factor=1.):
     self.time_factor = time_factor
     self.traj = traj
     self.tf_pub = pru.TransformPublisher()
     #self.pose_pub = pru.PoseArrayPublisher(dae='quad.dae')
     self.pose_pub = pru.PoseArrayPublisher(dae='glider.dae')
     self.traj_pub = pru.TrajectoryPublisher(self.traj)
     self.fdm = fdm.FDM()
     self.df = ctl.DiffFlatness()
示例#3
0
 def __init__(self):
     self.h_ctl = HoverController()
     self.wps_ctl = WPSeqCtl(self.h_ctl)
     cc_rpu.PeriodicNode.__init__(self, 'test_sjtu_drone')
     self.twist_pub = rospy.Publisher('/cmd_vel', geometry_msgs.msg.Twist, queue_size=1)
     self.transform_pub = p3_rpu.TransformPublisher()
     self.marker_pub = p3_rpu.PoseArrayPublisher(dae='quad_murat.dae')
     self.odom_pub = p3_rpu.OdomPublisher()
     self.pose_lst = cc_rpu.PoseListener('/drone/gt_pose')
示例#4
0
 def __init__(self, _traj=None, time_factor=1.):
     self.time_factor = time_factor
     _fdm = fdm.MR_FDM()
     #_fdm = fdm.UFOFDM()
     #_fdm = fdm.SolidFDM()
     self.traj_pub = pru.TrajectoryPublisher(_traj)
     _ctl_in = ctl.TrajRef(_traj, _fdm)
     _ctl = ctl.PosController(_fdm, _ctl_in)
     self.sim = pmu.Sim(_fdm, _ctl)
     self.tf_pub = pru.TransformPublisher()
     self.pose_pub = pru.QuadAndRefPublisher()
示例#5
0
    def __init__(self, name='ros_pat_glider_trim'):
        p3_rpu.PeriodicNode.__init__(self, name)
        self.joint_state_pub = p3_rpu.JointStatePublisher(what=name)
        #self.ivel_pub = p3_rpu.PosePublisher(what=name)
        self.txt_pub = p3_rpu.TextMarkerPublisher('/ds_glider/trim_txt', 'ds_glider/base_link', scale=0.1, what=name)
        self.tf_pub = p3_rpu.TransformPublisher()
        self.tf_pub.send_w_enu_to_ned_transform(rospy.Time.now())

        ac_name = 'cularis'
        self.dm = p1_fw_dyn.DynamicModel(os.path.join(p3_u.pat_dir(), 'data/vehicles/{}.xml'.format(ac_name)))
        self.trim_args = {'h':0, 'va':10, 'throttle':0}
        self._trim()
        self.dyn_cfg_srv = dynamic_reconfigure.server.Server(ros_pat.cfg.glider_trimConfig, self.dyn_cfg_callback)
示例#6
0
 def __init__(self):
     _fdm = fdm.FDM()
     _ctl = ctl.ZAttController(_fdm)
     self.sim = pmu.Sim(_fdm, _ctl)
     self.tf_pub = pru.TransformPublisher()
     self.pose_pub = pru.PoseArrayPublisher()
     rospy.Subscriber('/joy',
                      sensor_msgs.msg.Joy,
                      self.on_joy_msg,
                      queue_size=1)
     #self.input = ctl.StepZInput(0.1)
     #self.input = ctl.StepEulerInput(pal.e_phi, _a=np.deg2rad(1.), p=4, dt=1)
     self.input = ctl.StepEulerInput(pal.e_theta,
                                     _a=np.deg2rad(1.),
                                     p=4,
                                     dt=1)
示例#7
0
    def __init__(self):
      _fdm = fdm.FDM()

      if 0:
          _ctl_in = ctl.PosStep()
          self.traj_pub = None
      else:
          #_traj = pmt.Circle([0, 0, -0.5], r=1.5, v=2.)
          _traj =  pmt.FigureOfEight(v=1.)
          #_traj = pmt.Oval(l=1, r=1, v=2.)
          self.traj_pub = pru.TrajectoryPublisher(_traj)
          _ctl_in = ctl.TrajRef(_traj, _fdm)

      _ctl = ctl.PosController(_fdm, _ctl_in)
      self.sim = pmu.Sim(_fdm, _ctl)
      self.tf_pub = pru.TransformPublisher()
      self.pose_pub = pru.QuadAndRefPublisher()
示例#8
0
    def __init__(self, traj, time_factor=1.):
        traj = p3_fw_guid.CircleRefTraj2(c=[0, 0, 10], r=15)
        self.time_factor = time_factor
        self.traj = traj
        self.tf_pub = pru.TransformPublisher()
        self.pose_pub = pru.PoseArrayPublisher(dae='glider.dae')
        self.traj_pub = pru.TrajectoryPublisher(self.traj)

        self.carrot_pub  = pru.MarkerPublisher('guidance/goal', 'w_ned')
        self.carrot_pub2 = pru.MarkerPublisher('guidance/goal2', 'b_frd', argb=(1., 1., 1., 0.))
 
        self.fdm = fdm.FDM()
        param_filename='/home/poine/work/pat/data/vehicles/cularis.xml'
        self.dm = p1_fw_dyn.DynamicModel(param_filename)
        self.guidance = p3_fw_guid.Guidance(self.dm, traj, {'h':0, 'va':15, 'gamma':0})
        
        self.df = ctl.DiffFlatness()
示例#9
0
    def __init__(self, _traj=None, time_factor=1.):
        traj = p3_traj3d.CircleRefTraj(c=[0, 0, -20], r=15)
        #traj = p3_fw_guid.LineRefTraj(p1=[0, 0, 0], p2=[50, 50, 0])
        #traj = p3_fw_guid.SquareRefTraj()
        #traj = p3_fw_guid.OctogonRefTraj()
        self.time_factor = time_factor
        param_filename = '/home/poine/work/pat/data/vehicles/cularis.xml'
        _fdm = p1_fw_dyn.DynamicModel(param_filename)
        _fms = p3_fms.FMS(_fdm, {'h': 0, 'va': 10, 'gamma': 0})
        #_ctl = p3_fw_guid.Guidance(_fdm, traj, {'h':0, 'va':10, 'gamma':0})
        #_ctl = p3_guid.GuidanceThermal(_fdm, traj, {'h':0, 'va':10, 'gamma':0})
        #_atm = p3_atm.AtmosphereCstWind([0, 0, -1])
        #_atm = p3_atm.AtmosphereThermal1()
        _atm = p3_atm.AtmosphereThermalMulti()
        #_atm = p3_atm.AtmosphereWharington()#center=None, radius=50, strength=-2, cst=[0, 0, 0])
        #_atm = p3_atm.AtmosphereGedeon(center=[55, 0, 0], radius=50, strength=-2, cst=[0, 0, 0])
        #_atm = p3_atm.AtmosphereRidge()

        self.sim = pmu.Sim(_fdm, _fms, _atm)
        self.tf_pub = p3_rpu.TransformPublisher()
        self.carrot_pub = p3_rpu.MarkerPublisher('guidance/goal',
                                                 'w_ned',
                                                 scale=(0.25, 0.25, 0.5))
        self.traj_pub = p3_rpu.TrajectoryPublisher2(traj, ms=0.2)
        #self.pose_pub = p3_rpu.PoseArrayPublisher(dae='glider.dae')
        self.pose_pub = p3_rpu.PoseArrayPublisher(dae='ds_glider_full.dae')
        self.atm_pub = None  #p3_rpu.AtmPointCloudPublisher(_atm)
        self.status_pub = p3_rpu.GuidanceStatusPublisher()
        self.atm_disp_dyn_rec_client = dynamic_reconfigure.client.Client(
            "display_atmosphere",
            timeout=1,
            config_callback=self.atm_config_callback)
        #self.my_own_reconfigure_client = dynamic_reconfigure.client.Client("real_time_sim", timeout=1, config_callback=None)

        self.cur_thermal_id = 0
        self.dyn_cfg_srv = dyn_rec_srv.Server(ros_pat.cfg.guidanceConfig,
                                              self.dyn_cfg_callback)
        # we can not have two servers... f**k...
        #self.atm_cfg_srv = dyn_rec_srv.Server(ros_pat.cfg.atmosphereConfig,
        #                                      self.atm_dyn_cfg_callback)#, subname='foo')
        self.nav_goal_sub = rospy.Subscriber("/move_base_simple/goal",
                                             geometry_msgs.msg.PoseStamped,
                                             self.nav_goal_callback)
        self.joy_sub = rospy.Subscriber('/joy', sensor_msgs.msg.Joy,
                                        self.joy_callback)
        self.periodic_cnt = 0
示例#10
0
    def __init__(self):
        #self.atm = p3_atm.AtmosphereThermal1()
        #self.atm = p3_atm.AtmosphereThermalMoving()
        self.atm = p3_atm.AtmosphereThermalMulti()
        #self.atm.set_params(xc=15., yc=15., zi=850., wstar=256.)

        #self.atm = p3_atm.AtmosphereRidge()

        #self.atm_pub = p3_rpu.AtmPublisher( self.atm, z0=-14. )
        self.atm_pub = p3_rpu.AtmPointCloudPublisher(self.atm,
                                                     center=[0, 0, -50],
                                                     dx=200.,
                                                     dy=200.,
                                                     dz=-100.,
                                                     dens=5.)
        self.tf_pub = p3_rpu.TransformPublisher()
        self.atm_cfg_srv = dyn_rec_srv.Server(ros_pat.cfg.atmosphereConfig,
                                              self.atm_dyn_cfg_callback)
示例#11
0
 def __init__(self, ds):
     self.ds = ds
     self.tf_pub = p3_rpu.TransformPublisher()
     self.marker_pub = p3_rpu.PoseArrayPublisher(dae='quad_murat.dae')
     self.odom_pub = p3_rpu.OdomPublisher()
     self.i=0
示例#12
0
 def __init__(self):
     p3_rpu.PeriodicNode.__init__(self, 'simulator_interface_node')
     self.transform_pub = p3_rpu.TransformPublisher()
     self.pose_lst = cc_rpu.PoseListener('/drone/gt_pose')