strands-project / strands_perception_people

long-term detection, tracking and recognition of people
97 stars 70 forks source link

strands_perception_people_msgs/PedestrianTracking meaning #92

Closed hawesie closed 10 years ago

hawesie commented 10 years ago

I'm looking to inspect the tracked pedestrians to see if one is within a given range for a particular length of time. With the pose array I can easily do the distance, but I can't check whether the same track uuid reoccurs. Looking at PedestrianTracking I can see that I can get the uuid but, not being able to run the system right now (at home with laptop), I can't work out what frame the x,y,z of these trajectories are in and whether to look at the start of these lists. Does the header frame_id tell me the tf frame used for traj_x etc.?

cdondrup commented 10 years ago

The traj_*_camera values are in the frame_id coordinate system (head_xtion_depth_optical_frame). The traj_* values are some form of world coordinates calculated based on visual features which we don't really need when it's running on the robot. I just use the traj_*_camera coordinates to create the pose message:

        geometry_msgs::PoseStamped poseInCamCoords;
        poseInCamCoords.header = pta.header;
        poseInCamCoords.pose.position.x = pt.traj_x_camera[0];
        poseInCamCoords.pose.position.y = pt.traj_y_camera[0];
        poseInCamCoords.pose.position.z = pt.traj_z_camera[0];

It is then transformed form head_xtion_depth_optical_frame into the given target frame. Therefore, just looking at those values is as good looking at the pose in camera coordinates.

cdondrup commented 10 years ago

Also these values represent a history over the last detections. The first element is the current detection. I don't know the number of detections that are saved in the history from the top of my head, but just looking at the first one gives you the current position.

hawesie commented 10 years ago

Thanks, I'll try this when I get back to the lab.

hawesie commented 10 years ago

Is the id the way to get the tracked person across readings? uuid appears to change every reading.

cdondrup commented 10 years ago

The uuid should be the unique one. I will have a look why it changes.

cdondrup commented 10 years ago

If you don't restart the tracker you can use id as well. The uuid is just created using the startup time of the tracker plus the id.

hawesie commented 10 years ago

Ok, I will stick with id. I'm seeing same id but changing uuid.

cdondrup commented 10 years ago

Above PR fixes the issue. The uuid is now stable as well. But as I said, if you do not restart the tracker or don't care if the ids are consistent even after restart, you can just use the id.