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

Pass receive #61

Open
wants to merge 7 commits into
base: fsm
Choose a base branch
from
Open

Conversation

ultrainstinct30
Copy link
Contributor

@ultrainstinct30 ultrainstinct30 commented May 31, 2019

I have edited pass_and_receive.py to use only skills like GoToPoint and turnAround.
In turnAround.py, the allowable error was fixed to 2xROTATION_FACTOR which is nearly 17 deg. So I changed it so that the allowable error is now a parameter with default value equal to the above value.
In math_functions.py, there were two definitions of the method getPointBehindTheBall, so I removed one of them, and changed the definition to:
x = x_0 + r.cos(theta)
y = y_0 + r.sin(theta)
with r = 3.5xBOT_RADIUS
The coordinated-pass.py is the same structure as the goalie_vs_attacker.py
I have tested the above changes 15-20 times. It works well. The current issues are that sometimes the kick is somewhat off from the receiver bot, but unless the bot is very near to the boundary, this doesn't cause much problem as the ball stops before going out of vision and the receiver goes to ball as the ball stops. Other than this, it works nearly perfectly

@thebhatman
Copy link
Member

Make a digraph for this FSM using graphviz. When you run the code, an image will be formed in Digraph folder. Put that image in this thread.

@ultrainstinct30
Copy link
Contributor Author

PassReceive

@thebhatman
Copy link
Member

Since there have been recent commits and Merges in fsm branch, there are merge conflicts now. Resolve them.

# y = point.y +(3.5 * BOT_RADIUS) *(math.sin(theta))
# return Vector2D(int(x), int(y))
def getPointBehindTheBall(point ,theta, factor=3.5):
x = point.x +(factor * BOT_RADIUS) *(math.cos(theta))
Copy link
Member

Choose a reason for hiding this comment

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

Indentation has been affected.

Copy link
Member

Choose a reason for hiding this comment

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

@ultrainstinct30 , I think in your last PR of adding variable threshold for getbehindBall, the indentation got changed. Also it would be good to remove the redundant getPointbehindBall here :

def getPointBehindTheBall(point, theta):
. Just have one function for this with variable threshold. It would be good to make a new PR only for this. Then edit this Pass receive PR.

@saurabhkgp21
Copy link
Member

Ref: #35

@saurabhkgp21
Copy link
Member

Do passer and receiver move parallelly with this code?

@ultrainstinct30
Copy link
Contributor Author

Yes, passer and receiver move together. When we pass two bot ids, those two pass the ball amongst each other. The passer and receiver are decided with the help of their distance from the ball. This pass_and_receive.py is written so that the two bots pass to each other in a loop.

@saurabhkgp21
Copy link
Member

Okay.. we can keep this for testing pass receive skills of bots but during the play we dont want passer and receiver to keep passing the ball among them. Role needs to be completed or failed or cancelled.

@saurabhkgp21
Copy link
Member

There should be a coordinate passing tactic in 'tactics/'. You can also look at that for any help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants