Exemplo n.º 1
0
    def __init__(self):

        self.vision = AnalysisStake("base_stake")
        self.control = CommandInterfaces("STAKE")

        self.rate = rospy.Rate(5)
        self.status_mission = 0
Exemplo n.º 2
0
    def __init__(self):

        self.vision = AnalysisDrop("base_drop")
        self.control = CommandInterfaces("DROP")

        self.rate = rospy.Rate(5)
        self.status_mission = 0
Exemplo n.º 3
0
 def __init__(self, gate_proxy):
     self.gate_proxy = gate_proxy
     self.param = {
         'checkDeep': {
             'wanted': -0.85,
             'acceptableError': 0.10,
         },
         'firstFinding': {
             'threshold': 0.9,
             'rotateAngle': 30 * 3.1416 / 180,  # Tune value
             # Should be ~120 when switch is used.
             'maxAngle': 120 * 3.1416 / 180,
         },
         'forwardToGate': {
             'cxThresold': 0.2,  # Tune value
             'rotateAngle': 10,
             'moveDist': 0.25,
             'normalDist': 0.5,
             # If don't found gat will go to last mode. Use in Step02
             'timeLimit': 30,
         },
         'finalMoveDist': 4.0,
         'endThreshold': 0.2,
         'visionStatusHistory': 20,
     }
     self.control = CommandInterfaces('Gate')
Exemplo n.º 4
0
    def __init__(self):

        self.vision = AnalysisBuoy("base_buoy")
        self.control = CommandInterfaces("BUOY")

        self.rate = rospy.Rate(5)

        self.status_mission = 0

        self.ok_count = 5
Exemplo n.º 5
0
    def __init__(self):

        self.vision = AnalysisPath("base_path")
        self.control = CommandInterfaces("PATH")

        self.rate = rospy.Rate(5)

        self.status_mission = 0

        self.ok_count = 5
Exemplo n.º 6
0
    def __init__(self):

        self.vision = AnalysisGate("base_gate")
        self.control = CommandInterfaces("GATE")

        self.rate = rospy.Rate(5)

        self.state_mission = 0

        self.save_point_x = 0
        self.save_point_y = 0
        self.last_distance_to_found = 0
Exemplo n.º 7
0
    def __init__( self ):
        self.control = CommandInterfaces( "strategy" )

        self.control.publish_data( "Waiting service name /vision/gate" )
        rospy.wait_for_service('/vision/gate')

        self.rate = rospy.Rate( 10 )

        # Step setup mission Gate
        self.mission_gate = Gate()

        # Step setup mission Path 
        self.mission_path = Path()
        self.vision_path = AnalysisPath()

        # Step setup mission Buoy
        self.mission_buoy = Buoy()
        self.vision_buoy = AnalysisBuoy()

        # Step setup mission Drop
        self.mission_drop = Drop()
        self.vision_drop = AnalysisDrop()

        # Step setup mission Exposed analysis coffin
        self.mission_exposed = Exposed()
        self.vision_coffin = AnalysisCoffin( "base_coffin" )

        self.mission_stake = Stake()
        self.vision_stake = AnalysisStake( "base_stake" )

        self.current_play = False

        # Step setup service of strategy_mission
        self.service_service = rospy.Service(
            '/mission/strategy' , SendBool() , self.callback_service )

        self.control.publish_data( "Waiting command to run mission")
        while( not rospy.is_shutdown() ):
            if( self.current_play ):
                self.main()
                self.current_play = False
                break
            self.rate.sleep()
Exemplo n.º 8
0
    def __init__(self):
        self.control = CommandInterfaces("strategy")

        self.control.publish_data("Waiting service name /vision/gate")
        rospy.wait_for_service('/vision/gate')

        self.rate = rospy.Rate(10)

        # Step setup mission gate
        #        try:
        #            gate_srv = rospy.ServiceProxy('/vision/gate', VisionGate)
        #        except rospy.ServiceException, e:
        #            print("Service call failed: %s" % e)
        #        self.mission_gate = Gate(gate_srv)
        self.mission_gate = Gate()

        # Step setup mission Path
        self.mission_path = Path(_CONSTANT_PATH_1_MOVEMENT_X_,
                                 _CONSTANT_PATH_1_MOVEMENT_Y_)
        self.vision_path = AnalysisPath()

        # Step setup mission buoy
        self.mission_buoy = Buoy()
        self.vision_buoy = AnalysisBuoy()

        self.current_play = False

        # Step setup service of strategy_mission
        self.service_service = rospy.Service('/mission/strategy', SendBool(),
                                             self.callback_service)

        self.control.publish_data("Waiting command to run mission")
        while (not rospy.is_shutdown()):
            if (self.current_play):
                self.main()
                self.current_play = False
                break
            self.rate.sleep()
Exemplo n.º 9
0
#!/usr/bin/python2
from __future__ import print_function
import rospy
import math
from zeabus_utility.srv import VisionSrvQualification
from zeabus.control.command_interfaces import CommandInterfaces
from std_msgs.msg import String

control = CommandInterfaces('mission_qualify_2')


def main():
    # rospy.sleep(20)
    service_name = 'vision/qualification'
    print('wait service')
    rospy.wait_for_service(service_name)
    print('service start')
    call = rospy.ServiceProxy(service_name, VisionSrvQualification)
    i = 0
    last = 0
    last_move = False
    finish_marker = False
    old_cx = 0.5
    control.reset_state()
    control.absolute_z(-1.2)
    r = rospy.Rate(10)
    while control.check_z(0.15) == False:
        print("Wait for Z")
        r.sleep()
        continue
    while not rospy.is_shutdown():
Exemplo n.º 10
0
from __future__ import print_function

from zeabus.control.command_interfaces import CommandInterfaces

import rospy

import math

if __name__ == "__main__":

    rospy.init_node("testing")

    name_node = rospy.get_name()

    auv_control = CommandInterfaces(name_node)

    auv_control.reset_state(0, 0)

    auv_control.echo_data()

    print("Now I will absolute yaw to north")

    auv_control.absolute_yaw(math.pi / 2)

    auv_control.echo_data()

    print("I will waiting yaw")

    while (not rospy.is_shutdown()):
        if (auv_control.check_yaw(0.5)):
Exemplo n.º 11
0
    def __init__(self):

        self.vision = AnalysisCoffin("base_coffin")
        self.control = CommandInterfaces("PATH")

        self.rate = rospy.Rate(5)