Skip to content

Commit

Permalink
Fix Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hanruihua committed Dec 26, 2024
1 parent dd87131 commit a8a9fe0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions irsim/lib/handler/geometry_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def get_init_Gh(self):
"""
Generate initial G and h for convex object.
init_vertices: [[x1, y1], [x2, y2].... [[x1, y1]]]; [x1, y1] will repeat twice
Returns:
tuple: G matrix, h vector
"""
Expand All @@ -72,10 +74,10 @@ def get_init_Gh(self):

elif self.name == "polygon" or self.name == "rectangle":

convex_flag, _ = is_convex_and_ordered(self.init_vertices)
convex_flag, _ = is_convex_and_ordered(self.init_vertices[:, :-1])

if convex_flag:
G, h = gen_inequal_from_vertex(self.init_vertices)
G, h = gen_inequal_from_vertex(self.init_vertices[:, :-1])
cone_type = "Rpositive"
else:
G, h, cone_type = None, None, None
Expand All @@ -102,6 +104,10 @@ def vertices(self):

@property
def init_vertices(self):
'''
return init_vertices: [[x1, y1], [x2, y2].... [[x1, y1]]]; [x1, y1] will repeat twice
'''

if self.name == "linestring":
x = self._init_geometry.xy[0]
y = self._init_geometry.xy[1]
Expand Down

0 comments on commit a8a9fe0

Please sign in to comment.