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

Fix Python 3 issue and bug #95

Open
wants to merge 3 commits into
base: noetic
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion people_msgs/msg/Person.msg
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ geometry_msgs/Point velocity
float64 reliability
string[] tagnames
string[] tags

people_msgs/PositionMeasurement position_measurement
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other changes make sense, but why this one?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the last commit has nothing to do with this PR. I needed the covariance from the PositionMeasurement so I included it in the tracked message. Is it possible to exclude that commit from the PR?

7 changes: 4 additions & 3 deletions people_velocity_tracker/scripts/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def get_person(self):
p.position = self.pos.pos
p.velocity = self.velocity()
p.reliability = self.reliability
p.position_measurement = self.pos
return self.pos.header.frame_id, p


Expand Down Expand Up @@ -123,9 +124,9 @@ def spin(self):
while not rospy.is_shutdown():
# Remove People Older Than timeout param
now = rospy.Time.now()
for p in self.people.values():
for p in list(self.people.values()):
if now - p.age() > self.TIMEOUT:
del self.people[p.id()]
del self.people[p.get_id()]
self.publish()
rate.sleep()

Expand All @@ -134,7 +135,7 @@ def publish(self):
pl = People()
pl.header.frame_id = None

for p in self.people.values():
for p in list(self.people.values()):
p.publish_markers(self.mpub)
frame, person = p.get_person()
pl.header.frame_id = frame
Expand Down