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

Add sReceiveBall #16

Open
wants to merge 3 commits into
base: Working
Choose a base branch
from
Open

Add sReceiveBall #16

wants to merge 3 commits into from

Conversation

americast
Copy link
Contributor

@americast americast commented May 16, 2017

In sReceiveBall.cpp, param.BotConfig has been used a couple of times, but it's equivalent was not found in the declaration of SParam. Hence, I have used GoToPointP directly. Pl comment.

@americast
Copy link
Contributor Author

@MayankB11

def execute(param, state, bot_id):
ballInitialpos=Vector2D()
ballFinalpos=Vector2D()
currentBotpos = Vector2D(state.homePos, botDestination)
Copy link
Contributor

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

ballFinalpos=Vector2D()
currentBotpos = Vector2D(state.homePos, botDestination)
if(execute.framecount == 1):
ballInitialpos = state.ballPos
Copy link
Contributor

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

return
elif((execute.framecount % 10) == 0):
execute.framecount = 1
ballFinalpos = state.ballPos
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

param.GoToPointP.x = botDestination_x
param.GoToPointP.y = botDestination_y
param.GoToPointP.finalslope = 0
param.GoToPointP(param)
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above.


skill_node.send_command(state.isteamyellow, bot_ID, 0, 0, 0, 0, False)

execute.framecount=1
Copy link
Contributor

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.

Copy link
Contributor Author

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.

botDestination_y = (a*c2 - b*c1)/(a*a + b*b)
param.GoToPointP.x = botDestination_x
param.GoToPointP.y = botDestination_y
param.GoToPointP.finalslope = 0
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

@americast americast changed the base branch from master to Working May 23, 2017 06:46
@americast
Copy link
Contributor Author

americast commented May 23, 2017

@MayankB11 Kindly restart build for the check.

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.

2 participants