ros-sports / soccer_interfaces

A set of packages which contain common soccer interface files
Apache License 2.0
8 stars 3 forks source link

What to do if a field_boundary was not observed? #58

Closed ijnek closed 2 years ago

ijnek commented 2 years ago

In soccer_vision_2d/3d_msgs, most messages are arrays. One exception is the FieldBoundary.msg, it doesn't have an array message.

What should we do in the case where a FieldBoundary is not detected in an image? Reasons may include failure in field boundary detection algo or simply the field boundary isn't in the image.

Some options:

I prefer the second option, what do others think? @ros-sports/soccer_interfaces

Flova commented 2 years ago

At Bit-Bots the field boundary is simply equal to the bottom border of the image if it is not observed. This originates from the way we detect the field boundary. We to scan lines from the top to the bottom and if no field is found all scan lines are at the bottom.

This approach is not optimal as after the projection by the ipm the information is lost and a wrong field boundary is assumed. This is not really an issue for the Bit-Bots as the field boundary is only really used in image space to filter e.g. Balls.

For the image space representation, I would prefer the usage of a now optional point datatype, which has a boolean field called out_of_image, so the point would still be at the bottom of the image but with the additional info that this point is an upper boundary and the real field boundary might be lower. This allows for easy under / over field boundary checks in image space ignoring the additional property (you cant go lower than the bottom of the image in image space for most cases), but it signals the ipm that the field boundary needs to be split at this point.

For cartesian space a FieldBoundaryArray seems the way to go as the ipm would need to split the field boundary at out of image points.

ijnek commented 2 years ago

Here are some circumstances I can think of when a field boundary won't be detected:

For a lot of these cases, having a point array at the bottom of the image wouldn't quite make sense, even if we had an out_of_image flag. Now I'm thinking option 1 -

Use the existing FieldBoundary.msg, but have an empty array for the points field of the msg

is the best option.

Flova commented 2 years ago

This sounds reasonable