Talk:Wave Suffering

From Robowiki
Revision as of 18:49, 30 March 2011 by Voidious (talk | contribs) (hmm)
Jump to navigation Jump to search

I think it would help if we in this article listed many of the causes of wave surfing. That is to say the small details that usually hold up an implementation of wave surfing. Listing the usual problems will serve as a useful checklist for future wave surfers if nothing else. Considering I have never gotten past 'wave suffering' I am far from the idea author for this article. — Chase-san 11:23, 26 July 2010 (UTC)

Hi, I have a problem that I discovered while trying to perfect my wave surfing, though it may be unrelated. Basically, I am getting impossible values for the enemy position and it seems to be caused by some inaccuracy in my absolute bearings, which appear to be off by up to 20 degrees. What makes this even wierder, is that I calculate this value twice (once for my gun, and once for the wave surfing) and they are both identical, so I should't be accidentally changing them. As if that wasn't odd enough, I tested this morning and didn't notice this bug (the waves are painted with the centers at incorrect points, so I think I would have noticed this). Any ideas on what could be causing this? (I am perfectly willing to give the source code, but it is very long and the bot isn't quite ready for the rumble yet so I haven't uploaded it anywhere.)--AW 02:46, 30 March 2011 (UTC)

I'm not sure, that i correct understand you, but try launch wave not from current enemy position, but from previous enemy position. It's works for me. But in my model i at first update enemy state (process all events) and then launch waves etc --Jdev 06:09, 30 March 2011 (UTC)

In my code I have a function:
Point2D.Double doProjectPos( Point2D.Double startpos, double head, double dist){
return new Point2D.Double( startpos.x + (dist * Math.sin( head)), startpos.y + (dist * Math.cos( head)));
}
To get the position of enemy, I feed it mypos, (robot.getHeadingRadians() + e.getBearingRadians()) and e.getDistance(). I know it sounds a bit silly, but do you have your own position correct? Maybe there is somewhere a Math.toDegrees missing (or too much) if you are still working with Degrees. Print stuff to the console and step through the tics manually, so you could check the values you're using. Good luck with the bughunt. --GrubbmGait 07:18, 30 March 2011 (UTC)

Thanks, I am not sure that my position is correct, but this is a huge error (I have gotten the enemy's positions as (-40, some Y coordinate) )so I think I would notice. I have a screenshot of the error in abs bearing that I could upload to the wiki if I knew how.--AW 14:34, 30 March 2011 (UTC)

You can upload images with the "Upload file" link in the "toolbox" on the left side of the wiki. It seems to me if you draw the enemy location, your own location, and the line for the abs bearing, you should be able to see where it's going wrong. How do you calculate abs bearing? Nothing comes to mind as an obvious mistake you might make with these values, but it probably is something silly... --Voidious 14:43, 30 March 2011 (UTC)

Thanks, here is the link Media:WaveSuffering.jpg . I am sure I calculate the AbsBearing correctly, because one of the calculations is from the wave surfing tutorial and the other is, well, correct (getHeadingRadians() + e.getBearingRadians()). As for it being a silly mistake, no question there, "silly mistakes" is my middle name. And one more thing, in the picture, the top line is (nearly, off by one pixel) horizontal, the middle line is an absBearing of about 100 degrees, and the lowest line is about 130 degrees.--AW 15:09, 30 March 2011 (UTC)

So the bottom line appears to correctly point to the enemy bot. What are the other two supposed to be pointing to? Wave sources? If so, do they start off pointing to the wrong spot, or start off correct (touching the enemy bot) and then move off the battlefield? --Voidious 17:49, 30 March 2011 (UTC)