Closed Dionysus7777777 closed 1 month ago
The answer depends on the level of precision required in identifying the player handling the ball during the dribbling phase.
If you need to detect with high precision when a player is specifically dribbling the ball (or get the intention of the player or any other kind of information that is hard to detect visually), you will likely need to use communication. This would be more complex, as it requires precious communication cycles, but provides a much higher level of accuracy.
If an approximate solution is sufficient, you can infer that the player close to the ball is likely the one dribbling. Track the positions of all players and the ball. If a player's position is consistently near the ball and the ball is in motion, it's reasonable to assume that this player is handling the ball.
Ultimately, it depends on how critical it is for you to differentiate between "handling" the ball and just being close to it.
Thank you for your response. I previously used the approximation method, where we replaced with the nearest players, but the actual results were not ideal (the accuracy was low). Moving forward, we plan to achieve this through communication methods. Do you have any suggestions?
If you're exploring the communication route, the following information may be useful:
You can start by launching the Team_Communication utility via the main menu by running Run_Utils.py
. Next, examine /scripts/utils/Team_Communication.py
to review the communication-related functions and gain a better understanding of how the communication protocol works.
In the provided codebase (specifically /agent/Agent.py
), communication is actively used to share ball and player locations among teammates. This happens through the think_and_send
method, where, in the third step, the method self.radio.broadcast()
is called to send data.
Note that broadcasting doesn’t always lead to a message being sent, as mechanisms are in place to avoid collisions. However, the communication channel is heavily utilized, so this might restrict the introduction of new types of messages unless the current broadcasting mechanism is adjusted. For a comprehensive overview of the team communication strategy, refer to Chapter 3.3 of this FC Portugal RoboCup 2022 paper.
The logic for receiving messages is handled in /agent/Base_Agent.py
. Here, a World_Parser
object is instantiated via self.world_parser = World_Parser(self.world, self.hear_message if hear_callback is None else hear_callback)
. This parser redirects incoming messages to self.hear_message
, which ultimately calls self.radio.receive(msg)
to parse the teammate's message.
To use the communication channel for additional purposes (such as detecting who is dribbling), you would either:
self.radio.broadcast()
, orPersonally, I would recommend refining the approximation method for detecting the dribbler rather than altering the communication protocol. You might enhance your proximity-based logic by incorporating velocity and analyzing previous time steps. However, if you choose to pursue the communication approach, I hope the steps outlined above will be helpful.
Thank you very much for your reply. As always, your response is precise and helpful. We will try to achieve this goal through two approaches.
Hello, we are trying to figure out how to obtain the number of the player who is currently dribbling. However, by "dribbling," we are not referring to the entire dribbling motion. Dribbling typically includes moving toward the ball and then executing the specific action of handling the ball. What we want to know is how to get the number of the player who is currently in the handling phase. Is this a simple question, or does it involve communication processing?