-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add sReceiveBall #16
base: Working
Are you sure you want to change the base?
Add sReceiveBall #16
Conversation
scripts/skills/sReceiveBall.py
Outdated
def execute(param, state, bot_id): | ||
ballInitialpos=Vector2D() | ||
ballFinalpos=Vector2D() | ||
currentBotpos = Vector2D(state.homePos, botDestination) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really think Vector2D
has Vector2D(state.homePos, botDestination)
as it's constructor !
It should be Vector2D(<x-pos>, <y-pos>)
where x-pos
and y-pos
are of type int
and moreover what's botDestination
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
scripts/skills/sReceiveBall.py
Outdated
ballFinalpos=Vector2D() | ||
currentBotpos = Vector2D(state.homePos, botDestination) | ||
if(execute.framecount == 1): | ||
ballInitialpos = state.ballPos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is right implementation. state.ballPos
is of type geometry_msgs.Pose2D
which has x
, y
, theta
as it's members whereas ballInitialpos
has only two fields (x
, y
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
scripts/skills/sReceiveBall.py
Outdated
return | ||
elif((execute.framecount % 10) == 0): | ||
execute.framecount = 1 | ||
ballFinalpos = state.ballPos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
scripts/skills/sReceiveBall.py
Outdated
param.GoToPointP.x = botDestination_x | ||
param.GoToPointP.y = botDestination_y | ||
param.GoToPointP.finalslope = 0 | ||
param.GoToPointP(param) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct way of initializing param.GoToPointP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
scripts/skills/sReceiveBall.py
Outdated
|
||
skill_node.send_command(state.isteamyellow, bot_ID, 0, 0, 0, 0, False) | ||
|
||
execute.framecount=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
execute.framecount
? What type is execute
of ? Explain this bit briefly here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
execute
is the name of the function here. This is an implementation of static variables (of C) in Python. But execute.framecount
must be defined as 1 at some point at the beginning of execution, not in each python file separately.
scripts/skills/sReceiveBall.py
Outdated
botDestination_y = (a*c2 - b*c1)/(a*a + b*b) | ||
param.GoToPointP.x = botDestination_x | ||
param.GoToPointP.y = botDestination_y | ||
param.GoToPointP.finalslope = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I don't get this, param.GoToPointP
is something that you should use in the skill, what's the point of assigning to it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
param.BotConfig
is present in the cpp code, whereas it has neither been defined in Cpp nor in Python. I guess we need to rewrite this part.
@MayankB11 Kindly restart build for the check. |
In sReceiveBall.cpp,
param.BotConfig
has been used a couple of times, but it's equivalent was not found in the declaration ofSParam
. Hence, I have usedGoToPointP
directly. Pl comment.