serializers.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:ros-interop 作者: mcgill-robotics 项目源码 文件源码
def __get_search_grid(cls, data, frame):
        """
        Deserializes a the search grid into a polygon message.

        Args:
            data: List of dictionaries corresponding to the search grid points.
            frame: Frame for the polygon.

        Returns:
            Message of type PolygonStamped with the bounds of the search grid.
        """
        header = Header()
        header.stamp = rospy.get_rostime()
        header.frame_id = frame

        search_grid = GeoPolygonStamped()
        search_grid.header = header

        for point in data:
            boundary_pnt = GeoPoint()

            altitude = feet_to_meters(point["altitude_msl"])

            boundary_pnt.latitude = point["latitude"]
            boundary_pnt.longitude = point["longitude"]
            boundary_pnt.altitude = altitude

            search_grid.polygon.points.append(boundary_pnt)

        return search_grid
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号