Giter VIP home page Giter VIP logo

Comments (1)

rikba avatar rikba commented on July 30, 2024

Hi! Thanks for the extensive workflow description. We were able to replicate your error. It seems that we are not catching a division error.

To solve your problem you have to set the altitude of your polygon. In coverage_planner.yaml you set the sensor_model_type: 1 # [0: Line, 1: Frustum]. This refers to a view frustum at with a nadir camera configuration with a certain opening angle and at a constant altitude >0.0. You need to define this altitude by setting the first z-component of your polygon. Here is your adapted code snippet.

#!/usr/bin/env python

import rospy
from geometry_msgs.msg import Point32
from polygon_coverage_msgs.srv import PolygonService
from polygon_coverage_msgs.msg import PolygonWithHolesStamped

if __name__ == '__main__':
    rospy.init_node('polygon_setter')
    rospy.wait_for_service('/coverage_planner/set_polygon')
    try:
        set_poly_srv = rospy.ServiceProxy('/coverage_planner/set_polygon', PolygonService)
        poly = PolygonWithHolesStamped()
        poly.header.stamp = rospy.Time.now()
        poly.header.frame_id="map"
        poly.polygon.hull.points = [Point32(-29.5515, 31.0672, 1.0), # Fix polygon altitude greater than 0.0
                                    Point32(-17.7991, 99.7963, 0.0),
                                    Point32(-40.5039, 80.0898, 0.0),
                                    Point32(-51.1835, 51.8711, 0.0)]
        resp = set_poly_srv(poly)
        print resp.success
    except rospy.ServiceException as e:
        print("Service call failed: %s"%e)

Then it should work.
rviz_screenshot_2020_10_26-23_41_41

Note that instead of using the view frustum, you can also use sensor_model_type: 0 # [0: Line, 1: Frustum]. This allows you to set the sweeping width through the parameter lateral_footprint: 1.0 # Only for line sensor model.. For example by setting the footprint to 10.0 you increase the sweep distance. In this case, you can leave the altitude at 0.0.
rviz_screenshot_2020_10_26-23_52_59

from polygon_coverage_planning.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.