本文整理汇总了Python中smach.State类的典型用法代码示例。如果您正苦于以下问题:Python State类的具体用法?Python State怎么用?Python State使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了State类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self,msg=None):
State.__init__(self, outcomes=['succeeded',"succeeded",'preempted'])
# self.pub=rospy.Publisher('serial_switch_model',xm_SerialSwitchMode,queue_size=5 )
# self.msg=xm_SerialSwitchMode()
# self.msg.data=msg
self.ser=rospy.ServiceProxy("serialswitchmode",xm_SerialSwitchMode)
self.msg = msg
开发者ID:xm-project,项目名称:xm_strategy,代码行数:7,代码来源:operate_recognize_object.py
示例2: __init__
def __init__(self, speed, goal):
State.__init__(self, outcomes=["full_rotate", "not_full_rotate"])
# Initialize the tf listener
self.tf_listener = tf.TransformListener()
# Give tf some time to fill its buffer
rospy.sleep(2)
# Set the odom frame
self.odom_frame = "/odom"
# Find out if the robot uses /base_link or /base_footprint
try:
self.tf_listener.waitForTransform(self.odom_frame, "/base_footprint", rospy.Time(), rospy.Duration(1.0))
self.base_frame = "/base_footprint"
except (tf.Exception, tf.ConnectivityException, tf.LookupException):
try:
self.tf_listener.waitForTransform(self.odom_frame, "/base_link", rospy.Time(), rospy.Duration(1.0))
self.base_frame = "/base_link"
except (tf.Exception, tf.ConnectivityException, tf.LookupException):
rospy.loginfo("Cannot find transform between /odom and /base_link or /base_footprint")
rospy.signal_shutdown("tf Exception")
self.cmd_vel = rospy.Publisher("cmd_vel", Twist)
self.r = rospy.Rate(20)
self.angular_speed = speed
self.angular_tolerance = radians(2.5)
self.goal_angle = goal
开发者ID:osamazhar,项目名称:KURAbot,代码行数:30,代码来源:rotate360.py
示例3: __init__
def __init__(self, room, timer):
State.__init__(self, outcomes=['succeeded','aborted','preempted'])
self.task = 'scrub_tub'
self.room = room
self.timer = timer
self.cmd_vel_pub = rospy.Publisher('cmd_vel', Twist)
开发者ID:osamazhar,项目名称:KURAbot,代码行数:7,代码来源:clean_house_smach.py
示例4: __init__
def __init__(self):
self.object_detector = ObjectDetector()
self.collision_map_processing_srv = rospy.ServiceProxy('/tabletop_collision_map_processing/tabletop_collision_map_processing',
TabletopCollisionMapProcessing)
State.__init__(self,
outcomes=['found_clusters','no_clusters'],
output_keys=['segmentation_result','cluster_information'])
开发者ID:Kenkoko,项目名称:ua-ros-pkg,代码行数:7,代码来源:infomax_action_sm.py
示例5: __init__
def __init__(self):
State.__init__(self, outcomes=['succeeded','aborted','preempted'], input_keys=['speed','distance'])
self.cmd_vel_pub = rospy.Publisher('/PETIT/cmd_vel', Twist)
self.pause_pub = rospy.Publisher('/PETIT/pause_pathwrapper', Empty)
self.resume_pub = rospy.Publisher('/PETIT/resume_pathwrapper', Empty)
pass
开发者ID:smart-robotics-team,项目名称:eurobot-ros-pkg,代码行数:7,代码来源:smach_ai.py
示例6: __init__
def __init__(self, input_keys=['arm', 'object_id']):
action_uri = 'pickup_im_object_action'
self.pickup_client = actionlib.SimpleActionClient(action_uri, PickupIMObjectAction)
rospy.loginfo("waiting for %s"%action_uri)
self.pickup_client.wait_for_server()
rospy.loginfo("%s found"%action_uri)
State.__init__(self, outcomes=['succeeded', 'failed'], input_keys = input_keys)
开发者ID:KaijenHsiao,项目名称:interactive-manipulation-sandbox,代码行数:7,代码来源:pickup_object.py
示例7: __init__
def __init__(self, question, resp=True):
State.__init__(self, outcomes=['yes', 'no'])
self.resp = 'yes' if resp else 'no'
if resp:
self.prompt = '%s [%s]|%s: ' % (question, 'y', 'n')
else:
self.prompt = '%s [%s]|%s: ' % (question, 'n', 'y')
开发者ID:fsfrk,项目名称:hbrs-youbot-hackathon,代码行数:7,代码来源:confirm_state.py
示例8: __init__
def __init__(self, room, timer):
State.__init__(self, outcomes=['succeeded','aborted','preempted'])
self.task = 'mop_floor'
self.room = room
self.timer = timer
self.cmd_vel_pub = rospy.Publisher('cmd_vel', Twist, queue_size=5)
开发者ID:JanMichaelQuadrant16,项目名称:robo_hand_01,代码行数:7,代码来源:clean_house_smach.py
示例9: __init__
def __init__(self):
State.__init__(self, outcomes=['succeeded','aborted','preempted'])
self.move_base = actionlib.SimpleActionClient("move_base", MoveBaseAction)
# Wait up to 60 seconds for the action server to become available
self.move_base.wait_for_server(rospy.Duration(60))
rospy.loginfo("Connected to move_base action server")
开发者ID:xm-project,项目名称:xm_strategy,代码行数:7,代码来源:navgation_smach.py
示例10: __init__
def __init__(self, room, timer):
State.__init__(self, outcomes=["succeeded", "aborted", "preempted"])
self.task = "mop_floor"
self.room = room
self.timer = timer
self.cmd_vel_pub = rospy.Publisher("cmd_vel", Twist)
开发者ID:peterheim1,项目名称:robbie,代码行数:7,代码来源:clean_house_smach.py
示例11: __init__
def __init__(self, input_keys=['arm', 'action', 'lift']):
action_uri = 'imgui_action'
self.action_client = actionlib.SimpleActionClient(action_uri, IMGUIAction)
rospy.loginfo("waiting for %s"%action_uri)
self.action_client.wait_for_server()
rospy.loginfo("%s found"%action_uri)
State.__init__(self, outcomes=['succeeded', 'failed'], input_keys = input_keys)
开发者ID:KaijenHsiao,项目名称:interactive-manipulation-sandbox,代码行数:7,代码来源:interactive_gripper.py
示例12: __init__
def __init__(self, topic, msg_type, max_checks = -1):
State.__init__(self, outcomes=['invalid','valid','preempted'])
self._topic = topic
self._msg_type = msg_type
self._cond_cb = self.execute_cb
self._max_checks = max_checks
self._n_checks = 0
self._trigger_cond = threading.Condition()
self.bridge = CvBridge()
rospy.sleep(1)
self.task = 'Face Detection'
cv.NamedWindow(self.task, cv.CV_WINDOW_NORMAL)
# cv.ResizeWindow(self.task, 640, 480)
# cv2.imshow(self.task, np.zeros((480,640), dtype = np.uint8))
rospy.loginfo("waiting for images...")
pkg_path = rospkg.RosPack().get_path('ros_project')
cascade_1 = pkg_path+"/data/haar_detectors/haarcascade_frontalface_alt.xml"
self.cascade1 = cv2.CascadeClassifier(cascade_1)
cascade_2 = pkg_path+"/data/haar_detectors/haarcascade_frontalface_alt2.xml"
self.cascade2 = cv2.CascadeClassifier(cascade_2)
cascade_3 = pkg_path+"/data/haar_detectors/haarcascade_profileface.xml"
self.cascade3 = cv2.CascadeClassifier(cascade_3)
self.haar_params = dict(scaleFactor = 1.3,minNeighbors = 3,
flags = cv.CV_HAAR_DO_CANNY_PRUNING,
minSize = (30, 30),maxSize = (150, 150))
开发者ID:sandeepmanandhargithub,项目名称:ROS-Turtlebot2,代码行数:30,代码来源:face_detect.py
示例13: __init__
def __init__(self, position, orientation):
State.__init__(self, outcomes=['success'])
#global pub
# Get an action client
self.client = actionlib.SimpleActionClient('move_base', MoveBaseAction)
self.client.wait_for_server()
# Define the goal
self.goal = MoveBaseGoal()
self.goal.target_pose.header.frame_id = '/map'
self.goal.target_pose.pose.position.x = position[0]
self.goal.target_pose.pose.position.y = position[1]
self.goal.target_pose.pose.position.z = 0.0
self.goal.target_pose.pose.orientation.x = orientation[0]
self.goal.target_pose.pose.orientation.y = orientation[1]
self.goal.target_pose.pose.orientation.z = orientation[2]
self.goal.target_pose.pose.orientation.w = orientation[3]
#publlish waypoint
self.target_pose = PoseStamped()
self.target_pose.header.frame_id = '/map'
self.target_pose.pose.position.x = position[0]
self.target_pose.pose.position.y = position[1]
self.target_pose.pose.position.z = 0.0
self.target_pose.pose.orientation.x = orientation[0]
self.target_pose.pose.orientation.y = orientation[1]
self.target_pose.pose.orientation.z = orientation[2]
self.target_pose.pose.orientation.w = orientation[3]
开发者ID:neobotix,项目名称:neo_navigation,代码行数:29,代码来源:MultipleGoalDriver.py
示例14: __init__
def __init__(self):
State.__init__(self, outcomes=["succeeded", "aborted", "preempted"])
self.move_base = actionlib.SimpleActionClient("move_base", MoveBaseAction)
self.pub = rospy.Publisher("speech", String)
# Wait up to 60 seconds for the action server to become available
self.move_base.wait_for_server(rospy.Duration(60))
rospy.loginfo("Connected to move_base action server")
开发者ID:xm-project,项目名称:xm_strategy,代码行数:8,代码来源:just_follow.py
示例15: __init__
def __init__(self, smm):
State.__init__(self,
outcomes=["clear_front",
"clear_left",
"clear_right",
"blocked",
"unknown"])
self.smm = smm
开发者ID:CognitiveComputingResearchGroup,项目名称:Cryptoquip,代码行数:8,代码来源:cq_modules.py
示例16: __init__
def __init__(self, value):
State.__init__(self, outcomes=['succeeded','aborted','preempted'])
self.value = value
self.distance_pub = rospy.Publisher('/PETIT/alpha_ardu', Int32)
self.pause_pub = rospy.Publisher('/PETIT/pause_pathwrapper', Empty)
self.resume_pub = rospy.Publisher('/PETIT/resume_pathwrapper', Empty)
pass
开发者ID:smart-robotics-team,项目名称:eurobot-ros-pkg,代码行数:8,代码来源:smach_ai.py
示例17: __init__
def __init__(self):
State.__init__(self,
input_keys=['clusters',
'bounding_boxes',
'names',
'response'],
output_keys=['response'],
outcomes=['done'])
开发者ID:fsfrk,项目名称:hbrs-youbot-hackathon,代码行数:8,代码来源:object_detector.py
示例18: __init__
def __init__(self, topic_name, topic_type, output_key_name='topic_data', timeout=None):
State.__init__(self, outcomes=['succeeded', 'timeouted', 'preempted'], output_keys=[output_key_name])
self._topic = topic_name
self._topic_type = topic_type
self._timeout = rospy.Duration(timeout) if timeout else None
self._topic_data = None
self._output_key_name = output_key_name
self._mutex = threading.Lock()
开发者ID:gerardcanal,项目名称:NAO-UPC,代码行数:8,代码来源:read_topic_state.py
示例19: __init__
def __init__(self, dataset, object_id):
State.__init__(self,
outcomes=['stored'],
input_keys=['bounding_boxes', 'clusters', 'mean',
'median', 'points'])
base = roslib.packages.get_pkg_dir(PACKAGE)
self.dataset = Dataset(join(base, 'common', 'data'), dataset)
self.object_id = object_id
开发者ID:fsfrk,项目名称:hbrs-youbot-hackathon,代码行数:8,代码来源:collect_training_data.py
示例20: __init__
def __init__(self, square_topic='/nao_square', timeout=3.0, sleeptime=2.0):
State.__init__(self, outcomes=['succeeded', 'aborted'], output_keys=['square'])
self._topic = square_topic
self._square = None
self._squareBuffer = []
self._countBuffer = 0
self._timeout = rospy.Duration(timeout)
self._sleeptime = sleeptime
开发者ID:gerardcanal,项目名称:NAO-UPC,代码行数:8,代码来源:navigation_states.py
注:本文中的smach.State类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论