Difference between revisions of "Talk:Wave Suffering"

From Robowiki
Jump to navigation Jump to search
(reply)
(reply)
Line 6: Line 6:
 
It's works for me. But in my model i at first update enemy state (process all events) and then launch waves etc
 
It's works for me. But in my model i at first update enemy state (process all events) and then launch waves etc
 
--[[User:Jdev|Jdev]] 06:09, 30 March 2011 (UTC)
 
--[[User:Jdev|Jdev]] 06:09, 30 March 2011 (UTC)
 +
 +
In my code I have a function:<br>
 +
<code> Point2D.Double doProjectPos( Point2D.Double startpos, double head, double dist){<br>
 +
return new Point2D.Double( startpos.x + (dist * Math.sin( head)), startpos.y + (dist * Math.cos( head)));<br>
 +
}<br></code>
 +
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. --[[User:GrubbmGait|GrubbmGait]] 07:18, 30 March 2011 (UTC)

Revision as of 09:18, 30 March 2011

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)