Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement hrep from vrep for VPolygon #5

Closed
mforets opened this issue Oct 12, 2017 · 1 comment
Closed

Implement hrep from vrep for VPolygon #5

mforets opened this issue Oct 12, 2017 · 1 comment
Assignees
Labels
feature ➕ A new feature

Comments

@mforets
Copy link
Member

mforets commented Oct 12, 2017

We have hrep -> vrep, but we are missing the converse.

@mforets mforets added the feature ➕ A new feature label Oct 12, 2017
@mforets mforets added the good first issue 🐤 Good for newcomers label Oct 27, 2017
@mforets mforets self-assigned this Nov 13, 2017
@schillic schillic removed the good first issue 🐤 Good for newcomers label Nov 13, 2017
@mforets mforets changed the title Implement hrep from vrep for HPolygon Implement hrep from vrep for VPolygon Nov 20, 2017
@schillic
Copy link
Member

schillic commented Jan 5, 2018

This is just adding an edge for each consecutive pair of vertices, right? And I think this is optimal.
The constraints should be sorted automatically (CCW) if we start with the first edge between the first and second vertex. Below is the code where the LinearConstraint generation is still missing.

function tohrep(P::VPolygon{N})::AbstractHPolygon{N} where {N<:Real}
    @inline function to_lc(p1::Vector{N}, p2::Vector{N})::LinearConstraint{N}
        # TODO
    end

    n = length(P.vertices_list)
    constraints_list = Vector{LinearConstraint{N}}(n)
    for i in 1:n-1
        constraints_list[i] = to_lc(P.vertices_list[i+1], P.vertices_list[i])
    end
    constraints_list[n] = to_lc(P.vertices_list[1], P.vertices_list[end])
end

@schillic schillic assigned schillic and unassigned mforets Jul 8, 2018
@schillic schillic removed the discussion 🗣️ Requires human input label Jul 8, 2018
schillic added a commit that referenced this issue Jul 26, 2018
#5 - Implement hrep from vrep for VPolygon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ➕ A new feature
Projects
None yet
Development

No branches or pull requests

2 participants