Skip to content

Commit

Permalink
fix/refactor: filter for people and general cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
jws-1 committed Mar 8, 2024
1 parent 6cbc919 commit dc8a90e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion skills/src/lasr_skills/detect_3d.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python3
import rospy
import smach

Expand Down
3 changes: 1 addition & 2 deletions skills/src/lasr_skills/detect_3d_in_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from lasr_skills import Detect3D


from typing import List

from shapely.geometry import Point
Expand Down Expand Up @@ -38,7 +37,7 @@ def execute(self, userdata):

def __init__(
self,
area_polygon: List[List[float]],
area_polygon: Polygon,
depth_topic: str = "/xtion/depth_registered/points",
model: str = "yolov8n-seg.pt",
filter: List[str] | None = None,
Expand Down
3 changes: 0 additions & 3 deletions skills/src/lasr_skills/wait_for_person.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

import smach

from lasr_skills import Detect
Expand All @@ -25,7 +23,6 @@ def __init__(self):
smach.StateMachine.__init__(
self,
outcomes=["succeeded", "failed"],
input_keys=["depth_topic"],
output_keys=["detections"],
)

Expand Down
9 changes: 4 additions & 5 deletions skills/src/lasr_skills/wait_for_person_in_area.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python3

import smach

from lasr_skills import Detect3DInArea

from shapely.geometry.polygon import Polygon


class WaitForPersonInArea(smach.StateMachine):

Expand All @@ -20,18 +20,17 @@ def execute(self, userdata):
else:
return "not_done"

def __init__(self):
def __init__(self, area_polygon: Polygon):
smach.StateMachine.__init__(
self,
outcomes=["succeeded", "failed"],
input_keys=["depth_topic", "area_polygon"],
output_keys=["detections_3d"],
)

with self:
smach.StateMachine.add(
"DETECT_PEOPLE_3D",
Detect3DInArea(),
Detect3DInArea(area_polygon=area_polygon, filter=["person"]),
transitions={"succeeded": "CHECK_FOR_PERSON", "failed": "failed"},
)
smach.StateMachine.add(
Expand Down

0 comments on commit dc8a90e

Please sign in to comment.