当前位置: 首页>>代码示例>>Python>>正文


Python PointStamped.header方法代码示例

本文整理汇总了Python中geometry_msgs.msg.PointStamped.header方法的典型用法代码示例。如果您正苦于以下问题:Python PointStamped.header方法的具体用法?Python PointStamped.header怎么用?Python PointStamped.header使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在geometry_msgs.msg.PointStamped的用法示例。


在下文中一共展示了PointStamped.header方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: move

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
    def move(self, group, target="", pose=None):

        assert target != "" or pose is not None

        # group.set_workspace([minX, minY, minZ, maxX, maxY, maxZ])

        if pose is not None:
            group.set_pose_target(pose)
            pt = PointStamped()
            pt.header = pose.header
            pt.point = pose.pose.position
            self.look_at_cb(pt)
        else:

            group.set_named_target(target)



        group.allow_looking(False)
        group.allow_replanning(False)
        group.set_num_planning_attempts(1)

        cnt = 3

        while cnt > 0:

            if group.go(wait=True):
                return True

            rospy.sleep(1)

        return False
开发者ID:Kapim,项目名称:arcor-pr2,代码行数:34,代码来源:node.py

示例2: to_msg_vector

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
def to_msg_vector(vector):
    msg = PointStamped()
    msg.header = vector.header
    msg.point.x = vector[0]
    msg.point.y = vector[1]
    msg.point.z = vector[2]
    return msg
开发者ID:abhat91,项目名称:ros_osx,代码行数:9,代码来源:tf2_kdl.py

示例3: pose_cb

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
    def pose_cb(self, pose):
        m_pose = PointStamped()
        m_pose.header = pose.header
        m_pose.point = pose.pose.position
        m_pose = self.listener.transformPoint(self.reference_frame,m_pose)
        self.goal_x = m_pose.point.x
        self.goal_y = m_pose.point.y
        print "New goal: %.2f %.2f" % (self.goal_x, self.goal_y)

        marker = Marker()
        marker.header = pose.header
        marker.ns = "goal_marker"
        marker.id = 10
        marker.type = Marker.CYLINDER
        marker.action = Marker.ADD
        marker.pose = pose.pose
        marker.scale.x = 0.1
        marker.scale.y = 0.1
        marker.scale.z = 0.5;
        marker.color.a = 1.0;
        marker.color.r = 1.0;
        marker.color.g = 1.0;
        marker.color.b = 0.0;
        marker.lifetime.secs=-1.0
        self.marker_pub.publish(marker)
开发者ID:achuwilson,项目名称:vrep_ros_stack,代码行数:27,代码来源:goto_xy.py

示例4: estimation

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
def estimation(msg):
    uwbdis = msg.distance

    point = PointStamped()
    point.header = Header()
    point.header.frame_id = "vicon"
    point.header.stamp = rospy.Time.now()
    point.point = msg.position

 
    listener.waitForTransform("ned", "vicon", rospy.Time.now(), rospy.Duration(0.05))
    point_tf = listener.transformPoint("ned", point)
    uwbanchor = array([point_tf.point.x, point_tf.point.y, point_tf.point.z])

    imp = array(msg.point)
    global q,a,r,xe
    
    #xe, _ = uwb.locate(xe, Q, 1.0/100, uwbdis, uwbanchor, q, a, r)
    xe, _ = vision.locate(xe, Q, 1.0/100, imp, visionanchor, q, a, r)
 
    
    x_msg = state()
    x_msg.state.header = Header()
    x_msg.state.header.frame_id = "ned"
    x_msg.state.header.stamp = rospy.Time.now()
    x_msg.state.pose.position = Point(xe[0], xe[1], xe[2])
    x_msg.state.pose.orientation = Quaternion(xe[3], xe[4], xe[5], xe[6])
    x_msg.velocity = Vector3(xe[7], xe[8], xe[9])
    x_msg.bias = xe[10]
    pub.publish(x_msg)
开发者ID:JeffsanC,项目名称:svcam,代码行数:32,代码来源:test_ji.py

示例5: runFilter

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
	def runFilter(self):

		r = rospy.Rate(self.filterRate) 
		while not rospy.is_shutdown():
			if self.flag_reset:
				self.kf.reset(self.getReset())
				self.flag_reset = 0

			self.kf.iteration(self.getMeasures())

			self.pose_pub_.publish(self.kf.getState())
			
			person_point = PointStamped()
			person_point.header = self.kf.getState().header
			person_point.header.stamp = rospy.Time.now()
			person_point.point = self.kf.getState().pose.position
			self.point_pub_.publish(person_point)

			self.tf_person.sendTransform((self.kf.getState().pose.position.x,self.kf.getState().pose.position.y,0),
                     		(self.kf.getState().pose.orientation.x,self.kf.getState().pose.orientation.y,self.kf.getState().pose.orientation.z,self.kf.getState().pose.orientation.w),
                     		rospy.Time.now(),
                     		"person_link",
                     		self.kf.getState().header.frame_id)

			r.sleep()
开发者ID:gitAnto,项目名称:multisensor_filters,代码行数:27,代码来源:filter_node_kf.py

示例6: euroc_object_to_odom_combined

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
def euroc_object_to_odom_combined(euroc_object):
    header = Header(0, rospy.Time(0), euroc_object.frame_id)

    # Convert the centroid
    camera_point = PointStamped()
    camera_point.header = header
    camera_point.point = euroc_object.c_centroid
    odom_point = manipulation.transform_to(camera_point, '/odom_combined')
    euroc_object.c_centroid = odom_point.point
    euroc_object.frame_id = '/odom_combined'

    # Convert the cuboid
    if euroc_object.c_cuboid_success:
        cuboid_posestamped = PoseStamped(header, euroc_object.object.primitive_poses[0])
        cuboid_posestamped = manipulation.transform_to(cuboid_posestamped, '/odom_combined')
        euroc_object.object.primitive_poses[0] = cuboid_posestamped.pose
        euroc_object.object.header.frame_id = '/odom_combined'

    # Convert the mpe_object
    if euroc_object.mpe_success:
        for i in range(0, len(euroc_object.mpe_object.primitive_poses)):
            posestamped = PoseStamped(header, euroc_object.mpe_object.primitive_poses[i])
            posestamped = manipulation.transform_to(posestamped, '/odom_combined')
            euroc_object.mpe_object.primitive_poses[i] = posestamped.pose
            euroc_object.mpe_object.header.frame_id = '/odom_combined'
开发者ID:SUTURO,项目名称:euroc_planning,代码行数:27,代码来源:utils.py

示例7: main

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
def main():
  
    rospy.init_node('pr2_state_machine')
    brain = PR2RobotBrain()
    brain.getReady()
    
    area_to_explore = PolygonStamped()
    center_point = PointStamped()
    
    now = rospy.Time.now()
    
    area_to_explore.header.stamp = now
    area_to_explore.header.frame_id = "map"
    points = [Point32(-1.65, -1.56, 0.0),
              Point32(5.41, -1.7, 0.0),
              Point32(5.57, 4.44, 0.0),
              Point32(-1.75, 4.37, 0.0)]
              
    area_to_explore.polygon = Polygon(points)
    
    center_point.header = area_to_explore.header
    center_point.point.x = 1.83
    center_point.point.y = 1.57
    center_point.point.z = 0.0
    
    brain = PR2RobotBrain(area_to_explore, center_point)
    brain.loop()
开发者ID:robofit,项目名称:r5-cop,代码行数:29,代码来源:pr2_state_machine.py

示例8: face_callback

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
    def face_callback(self, msg):
        if not self.found_face:
            face = PointStamped()
            face.header = msg.people[0].header
            face.point = msg.people[0].pos
            self.face_parent_frame = msg.people[0].header.frame_id
            # self.listener.waitForTransform(face.header.frame_id, 'base_link', rospy.Time.now(), rospy.Duration(5.0))
            d = sqrt(face.point.x * face.point.x + face.point.y * face.point.y)
       
            # Change the axes from camera-type axes 
            self.quaternion = quaternion_from_euler(pi/2, pi/2, 0.0)
            pose = PoseStamped()
            pose.header = face.header
            pose.pose.position = face.point
            pose.pose.orientation.x = self.quaternion[0]
            pose.pose.orientation.y = self.quaternion[1]
            pose.pose.orientation.z = self.quaternion[2]
            pose.pose.orientation.w = self.quaternion[3]

            # Transform to base_link
            # pose = self.listener.transformPose('base_link', pose)
            face = pose.pose.position
            self.quaternion = (pose.pose.orientation.x, pose.pose.orientation.y, pose.pose.orientation.z, pose.pose.orientation.w)


            self.origin = (face.x, face.y, face.z)

            # Flip the bit
            self.found_face = True
开发者ID:OSUrobotics,项目名称:input_bakeoff_study,代码行数:31,代码来源:face_frame.py

示例9: point_cb

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
 def point_cb(self, msg):
     #self.point = msg
     cloud = read_points_np(msg)
     point = PointStamped()
     point.header = msg.header
     if cloud.shape[1] == 0: return
     point.point.x, point.point.y, point.point.z = cloud[0][0]
     self.point = point
开发者ID:OSUrobotics,项目名称:ros-3d-interaction,代码行数:10,代码来源:object_manipulation.py

示例10: publish

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
 def publish(self, msg):
     
     pt = PointStamped()
     
     pt.header = msg.header
     pt.point = msg.pos   
     
     self._point_pub.publish(pt)
开发者ID:ZdenekM,项目名称:LetsMove2014,代码行数:10,代码来源:people_to_point.py

示例11: do_transform_point

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
def do_transform_point(point, transform):
    p = transform_to_kdl(transform) * PyKDL.Vector(point.point.x, point.point.y, point.point.z)
    res = PointStamped()
    res.point.x = p[0]
    res.point.y = p[1]
    res.point.z = p[2]
    res.header = transform.header
    return res
开发者ID:mkjaergaard,项目名称:geometry_experimental,代码行数:10,代码来源:tf2_geometry_msgs.py

示例12: people_cb

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
def people_cb(meas):
    global mouth_center
    ps = PointStamped()
    ps.point = meas.pos
    ps.header = meas.header
    ps.header.stamp = rospy.Time(0)
    point = tfl.transformPoint(model.tf_frame, ps)
    mouth_center = model.project3dToPixel((point.point.x, point.point.y + mouth_offset, point.point.z))
开发者ID:OSUrobotics,项目名称:ros-mouth-click,代码行数:10,代码来源:find_mouth.py

示例13: transform_pos

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
 def transform_pos(self, pt, hdr):
     ps = PointStamped()
     ps.point = pt
     ps.header = hdr
     #ps.header.stamp = hdr.stamp
     print "set:"+str(ps)
     self.tfl.waitForTransform(ps.header.frame_id, '/map', ps.header.stamp, rospy.Duration(3.0))
     point_in_map = self.tfl.transformPoint('/map', ps)
     return point_in_map
开发者ID:cvpapero,项目名称:mysql_connector,代码行数:11,代码来源:human_relations_old.py

示例14: callback

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
def callback(data):
    #height = data.differential_height
    height = data.height
    
    rospy.loginfo(rospy.get_caller_id() + "Pressure: %f", height)
    pt = PointStamped()
    pt.header = data.header
    pt.point.z = height
    pub = rospy.Publisher('pressure_height_point', PointStamped, queue_size=1)
    pub.publish(pt)
开发者ID:avansig,项目名称:asctec_mav_framework,代码行数:12,代码来源:pressure_point_publisher.py

示例15: handle_detection

# 需要导入模块: from geometry_msgs.msg import PointStamped [as 别名]
# 或者: from geometry_msgs.msg.PointStamped import header [as 别名]
 def handle_detection(self,detection):
     if self.done: return
     for i in range(len(detection.ids)):
         pt = PointStamped()
         pt.header = detection.header
         pt.point.x = detection.xs[i]
         pt.point.y = detection.ys[i]
         pt.point.z = detection.zs[i] + detection.hs[i]
         self.cylinders[detection.ids[i]].append((pt,detection.rs[i], detection.hs[i]))
     self.num_detections += 1
开发者ID:rll,项目名称:sushichallenge,代码行数:12,代码来源:spinning_table_states.py


注:本文中的geometry_msgs.msg.PointStamped.header方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。